diff options
author | zeapo <mohamed@zenadi.com> | 2014-10-19 16:45:54 +0200 |
---|---|---|
committer | zeapo <mohamed@zenadi.com> | 2014-10-19 16:45:54 +0200 |
commit | 24892e6a9555f36a5d6cbe5658edb6f51ab85eba (patch) | |
tree | 1e500233aa887e8b55aa6bbd6b70fb303b11e995 /app/src/main/res | |
parent | 83c3231ab02fcfa40d369248c257a80579988a4b (diff) |
Using RecyclerView rather than ListView
Diffstat (limited to 'app/src/main/res')
-rw-r--r-- | app/src/main/res/layout/activity_pwdstore.xml | 4 | ||||
-rw-r--r-- | app/src/main/res/layout/fragment_password_grid.xml | 20 | ||||
-rw-r--r-- | app/src/main/res/layout/fragment_password_list.xml | 25 | ||||
-rw-r--r-- | app/src/main/res/layout/password_recycler_view.xml | 16 | ||||
-rw-r--r-- | app/src/main/res/layout/password_row_layout.xml | 94 | ||||
-rw-r--r-- | app/src/main/res/values-large/refs.xml | 2 | ||||
-rw-r--r-- | app/src/main/res/values-sw600dp/refs.xml | 2 |
7 files changed, 42 insertions, 121 deletions
diff --git a/app/src/main/res/layout/activity_pwdstore.xml b/app/src/main/res/layout/activity_pwdstore.xml index 1e6f1e41..b7074083 100644 --- a/app/src/main/res/layout/activity_pwdstore.xml +++ b/app/src/main/res/layout/activity_pwdstore.xml @@ -2,10 +2,6 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - android:paddingLeft="@dimen/activity_horizontal_margin" - android:paddingRight="@dimen/activity_horizontal_margin" - android:paddingTop="@dimen/activity_vertical_margin" - android:paddingBottom="@dimen/activity_vertical_margin" android:background="#eee" tools:context=".pwdstore" android:orientation="vertical"> diff --git a/app/src/main/res/layout/fragment_password_grid.xml b/app/src/main/res/layout/fragment_password_grid.xml deleted file mode 100644 index b23aa4d3..00000000 --- a/app/src/main/res/layout/fragment_password_grid.xml +++ /dev/null @@ -1,20 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:tools="http://schemas.android.com/tools" - android:layout_width="match_parent" - android:layout_height="match_parent" - tools:context="com.zeapo.pwdstore.PasswordFragment"> - - <GridView - android:id="@android:id/list" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:numColumns="2" /> - - <TextView - android:id="@android:id/empty" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:gravity="center" /> - -</FrameLayout> diff --git a/app/src/main/res/layout/fragment_password_list.xml b/app/src/main/res/layout/fragment_password_list.xml deleted file mode 100644 index 43a8a91b..00000000 --- a/app/src/main/res/layout/fragment_password_list.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:tools="http://schemas.android.com/tools" - android:layout_width="match_parent" - android:layout_height="match_parent" - tools:context="com.zeapo.pwdstore.PasswordFragment"> - - <com.fortysevendeg.swipelistview.SwipeListView - xmlns:swipe="http://schemas.android.com/apk/res-auto" - android:id="@+id/pass_list" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:dividerHeight="@dimen/activity_vertical_margin" - android:divider="@android:color/transparent" - swipe:swipeFrontView="@+id/front" - swipe:swipeBackView="@+id/back" - swipe:swipeActionLeft="reveal" - swipe:swipeActionRight="reveal" - swipe:swipeMode="both" - swipe:swipeCloseAllItemsWhenMoveList="true" - swipe:swipeOpenOnLongPress="true" - swipe:swipeAnimationTime="200" - android:listSelector="#00000000"/> -</FrameLayout> - diff --git a/app/src/main/res/layout/password_recycler_view.xml b/app/src/main/res/layout/password_recycler_view.xml new file mode 100644 index 00000000..c50f5952 --- /dev/null +++ b/app/src/main/res/layout/password_recycler_view.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:paddingLeft="@dimen/activity_horizontal_margin" + android:paddingRight="@dimen/activity_horizontal_margin" + android:orientation="vertical" + tools:context="com.zeapo.pwdstore.PasswordFragment"> + + <android.support.v7.widget.RecyclerView + android:id="@+id/pass_recycler" + android:scrollbars="vertical" + android:layout_width="match_parent" + android:layout_height="match_parent"/> +</LinearLayout> diff --git a/app/src/main/res/layout/password_row_layout.xml b/app/src/main/res/layout/password_row_layout.xml index 05bf3457..3636a20b 100644 --- a/app/src/main/res/layout/password_row_layout.xml +++ b/app/src/main/res/layout/password_row_layout.xml @@ -1,71 +1,29 @@ <?xml version="1.0" encoding="utf-8"?> -<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="fill_parent" - android:layout_height="fill_parent"> +<LinearLayout + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:id="@+id/front" + android:tag="front" + android:background="@drawable/rectangle" + android:layout_marginTop="8dp" + android:layout_marginBottom="8dp" + android:layout_gravity="start|center_vertical"> - - <GridLayout - android:id="@+id/back" - android:orientation="horizontal" - android:layout_width="match_parent" + <TextView + android:id="@+id/type" + android:text="TYPE" + android:layout_width="wrap_content" android:layout_height="wrap_content" - android:tag="back" - android:background="@drawable/gray_rectangle" - android:layout_gravity="left|center_vertical"> - - <TextView - android:id="@+id/label_back" - android:text="FILE_NAME" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="center_vertical" - android:padding="8dp" - android:layout_column="0"/> - - <ImageButton - android:id="@+id/crypto_delete_button" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:src="@drawable/ico_del" - android:background="@drawable/red_rectangle" - android:layout_gravity="center_vertical" - android:layout_column="2"/> - - <ImageButton - android:id="@+id/crypto_show_button" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:src="@drawable/ico_eye" - android:background="@drawable/blue_rectangle" - android:layout_gravity="center_vertical" - android:layout_marginLeft="8dp" - android:layout_column="3"/> - </GridLayout> - - <LinearLayout - android:layout_width="match_parent" - android:layout_height="fill_parent" - android:id="@+id/front" - android:tag="front" - android:background="@android:color/white" - android:layout_gravity="left|center_vertical"> - - <TextView - android:id="@+id/type" - android:text="TYPE" - android:layout_column="0" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:padding="8dp" - android:textStyle="bold" - android:layout_gravity="center_vertical" - /> - <TextView - android:id="@+id/label" - android:text="FILE_NAME" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="center_vertical" - android:padding="8dp"/> - </LinearLayout> -</FrameLayout> + android:padding="8dp" + android:textStyle="bold" + android:layout_gravity="center_vertical" + /> + <TextView + android:id="@+id/label" + android:text="FILE_NAME" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_vertical" + android:padding="8dp"/> +</LinearLayout>
\ No newline at end of file diff --git a/app/src/main/res/values-large/refs.xml b/app/src/main/res/values-large/refs.xml index 975e10fa..91cab110 100644 --- a/app/src/main/res/values-large/refs.xml +++ b/app/src/main/res/values-large/refs.xml @@ -9,6 +9,4 @@ http://developer.android.com/training/multiscreen/screensizes.html#TaskUseAliasFilters --> - <item name="fragment_password" type="layout">@layout/fragment_password_grid</item> - </resources>
\ No newline at end of file diff --git a/app/src/main/res/values-sw600dp/refs.xml b/app/src/main/res/values-sw600dp/refs.xml index 975e10fa..91cab110 100644 --- a/app/src/main/res/values-sw600dp/refs.xml +++ b/app/src/main/res/values-sw600dp/refs.xml @@ -9,6 +9,4 @@ http://developer.android.com/training/multiscreen/screensizes.html#TaskUseAliasFilters --> - <item name="fragment_password" type="layout">@layout/fragment_password_grid</item> - </resources>
\ No newline at end of file |