summaryrefslogtreecommitdiff
path: root/app/src/main/res
diff options
context:
space:
mode:
authorzeapo <mohamed@zenadi.com>2014-08-17 01:13:46 +0200
committerzeapo <mohamed@zenadi.com>2014-08-17 01:13:46 +0200
commit1858fb5e52eb764924d1b57dcd6c395ead54cbc3 (patch)
tree5eb506679c2b108a151388798e8be495fc1df0e3 /app/src/main/res
parent3debc057071e4468921f99f2ebeb59f54eae9307 (diff)
major ui improvement to the list using SwipeListView
Diffstat (limited to 'app/src/main/res')
-rw-r--r--app/src/main/res/drawable-xxhdpi/gray_rectangle.xml24
-rw-r--r--app/src/main/res/layout/child_row_layout.xml4
-rw-r--r--app/src/main/res/layout/decrypt_layout.xml46
-rw-r--r--app/src/main/res/layout/fragment_password_list.xml19
-rw-r--r--app/src/main/res/layout/password_row_layout.xml92
5 files changed, 117 insertions, 68 deletions
diff --git a/app/src/main/res/drawable-xxhdpi/gray_rectangle.xml b/app/src/main/res/drawable-xxhdpi/gray_rectangle.xml
new file mode 100644
index 00000000..b1858c80
--- /dev/null
+++ b/app/src/main/res/drawable-xxhdpi/gray_rectangle.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item>
+ <shape android:shape="rectangle"
+ android:dither="true">
+ <corners android:radius="2dp"/>
+ <solid android:color="#ccc" />
+
+ </shape>
+ </item>
+
+ <item android:bottom="2dp">
+ <shape android:shape="rectangle" android:dither="true">
+ <corners android:radius="2dp" />
+ <solid android:color="@android:color/darker_gray" />
+
+ <padding android:bottom="8dp"
+ android:left="8dp"
+ android:right="8dp"
+ android:top="8dp" />
+ </shape>
+ </item>
+</layer-list> \ No newline at end of file
diff --git a/app/src/main/res/layout/child_row_layout.xml b/app/src/main/res/layout/child_row_layout.xml
index 0fc5e33d..75efefad 100644
--- a/app/src/main/res/layout/child_row_layout.xml
+++ b/app/src/main/res/layout/child_row_layout.xml
@@ -2,7 +2,9 @@
<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
- android:layout_height="match_parent">
+ android:layout_height="match_parent"
+ android:id="@+id/child_row_layout"
+ android:layout_marginTop="@dimen/activity_vertical_margin">
<ImageButton
android:id="@+id/crypto_delete_button"
diff --git a/app/src/main/res/layout/decrypt_layout.xml b/app/src/main/res/layout/decrypt_layout.xml
index e81f288b..300e1d49 100644
--- a/app/src/main/res/layout/decrypt_layout.xml
+++ b/app/src/main/res/layout/decrypt_layout.xml
@@ -9,13 +9,14 @@
<LinearLayout
android:layout_width="fill_parent"
- android:layout_height="fill_parent"
+ android:layout_height="wrap_content"
android:orientation="vertical">
- <GridLayout
+ <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:background="@drawable/rectangle">
+ android:background="@drawable/rectangle"
+ android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
@@ -24,10 +25,7 @@
android:text="CATEGORY HERE"
android:id="@+id/crypto_password_category"
android:layout_gravity="center_vertical"
- android:layout_marginLeft="8dp"
- android:layout_column="0"
- android:layout_row="0"
- android:layout_columnSpan="2"/>
+ android:layout_marginLeft="@dimen/activity_horizontal_margin"/>
<TextView
android:layout_width="wrap_content"
@@ -38,38 +36,8 @@
android:text="PASSWORD FILE NAME HERE"
android:id="@+id/crypto_password_file"
android:layout_gravity="center_vertical"
- android:layout_marginLeft="8dp"
- android:layout_column="0"
- android:layout_columnSpan="2"
- android:layout_row="1"/>
-
-
- <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:onClick="handleClick"
- android:layout_column="3"
- android:layout_row="0"
- android:layout_rowSpan="2"/>
-
- <ImageButton
- android:id="@+id/crypto_show_button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:src="@drawable/ico_key"
- android:background="@drawable/blue_rectangle"
- android:layout_gravity="center_vertical"
- android:layout_marginLeft="8dp"
- android:onClick="handleClick"
- android:layout_column="4"
- android:layout_row="0"
- android:layout_rowSpan="2"/>
-
- </GridLayout>
+ android:layout_marginLeft="@dimen/activity_horizontal_margin"/>
+ </LinearLayout>
<LinearLayout
android:id="@+id/crypto_container"
diff --git a/app/src/main/res/layout/fragment_password_list.xml b/app/src/main/res/layout/fragment_password_list.xml
index 6ae0c0d8..43a8a91b 100644
--- a/app/src/main/res/layout/fragment_password_list.xml
+++ b/app/src/main/res/layout/fragment_password_list.xml
@@ -5,12 +5,21 @@
android:layout_height="match_parent"
tools:context="com.zeapo.pwdstore.PasswordFragment">
- <ExpandableListView
+ <com.fortysevendeg.swipelistview.SwipeListView
+ xmlns:swipe="http://schemas.android.com/apk/res-auto"
android:id="@+id/pass_list"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
android:dividerHeight="@dimen/activity_vertical_margin"
android:divider="@android:color/transparent"
- android:groupIndicator="@android:drawable/screen_background_light_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_row_layout.xml b/app/src/main/res/layout/password_row_layout.xml
index f8d656fd..641f4f85 100644
--- a/app/src/main/res/layout/password_row_layout.xml
+++ b/app/src/main/res/layout/password_row_layout.xml
@@ -1,25 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
-<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:id="@+id/pass_row_layout"
- android:background="@drawable/rectangle"
- android:orientation="horizontal">
- <TextView
- android:id="@+id/type"
- android:text="TYPE"
- android:layout_column="0"
- android:layout_width="wrap_content"
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent">
+
+
+ <GridLayout
+ android:id="@+id/back"
+ android:orientation="horizontal"
+ android:layout_width="match_parent"
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"/>
-</GridLayout>
+ 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_key"
+ 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>