diff options
Diffstat (limited to 'app')
17 files changed, 106 insertions, 127 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/utils/PasswordAdapter.java b/app/src/main/java/com/zeapo/pwdstore/utils/PasswordAdapter.java index 2aaa0bf5..fb9442fb 100644 --- a/app/src/main/java/com/zeapo/pwdstore/utils/PasswordAdapter.java +++ b/app/src/main/java/com/zeapo/pwdstore/utils/PasswordAdapter.java @@ -58,24 +58,6 @@ public class PasswordAdapter extends ArrayAdapter<PasswordItem>{ viewHolder.back_name = (TextView) rowView.findViewById(R.id.label_back); viewHolder.type = (TextView) rowView.findViewById(R.id.type); rowView.setTag(viewHolder); - - - View.OnClickListener onClickListener = new View.OnClickListener() { - @Override - public void onClick(View view) { - switch (view.getId()) { - case R.id.crypto_show_button: - activity.decryptPassword(pass); - break; - case R.id.crypto_delete_button: - activity.deletePassword(pass); - break; - } - } - }; - - ((ImageButton) rowView.findViewById(R.id.crypto_show_button)).setOnClickListener(onClickListener); - ((ImageButton) rowView.findViewById(R.id.crypto_delete_button)).setOnClickListener(onClickListener); } ViewHolder holder = (ViewHolder) rowView.getTag(); @@ -94,6 +76,24 @@ public class PasswordAdapter extends ArrayAdapter<PasswordItem>{ holder.back_name.setTextColor(this.activity.getResources().getColor(android.R.color.white)); holder.back_name.setTypeface(Typeface.create(Typeface.DEFAULT, Typeface.BOLD_ITALIC)); + + + View.OnClickListener onClickListener = new View.OnClickListener() { + @Override + public void onClick(View view) { + switch (view.getId()) { + case R.id.crypto_show_button: + activity.decryptPassword(pass); + break; + case R.id.crypto_delete_button: + activity.deletePassword(pass); + break; + } + } + }; + + ((ImageButton) rowView.findViewById(R.id.crypto_show_button)).setOnClickListener(onClickListener); + ((ImageButton) rowView.findViewById(R.id.crypto_delete_button)).setOnClickListener(onClickListener); } return rowView; diff --git a/app/src/main/res/drawable-hdpi/ico_add.png b/app/src/main/res/drawable-hdpi/ico_add.png Binary files differindex fbbf25aa..b5544aaa 100644 --- a/app/src/main/res/drawable-hdpi/ico_add.png +++ b/app/src/main/res/drawable-hdpi/ico_add.png diff --git a/app/src/main/res/drawable-hdpi/ico_eye.png b/app/src/main/res/drawable-hdpi/ico_eye.png Binary files differnew file mode 100644 index 00000000..a7604ac4 --- /dev/null +++ b/app/src/main/res/drawable-hdpi/ico_eye.png diff --git a/app/src/main/res/drawable-hdpi/ico_sync.png b/app/src/main/res/drawable-hdpi/ico_sync.png Binary files differnew file mode 100644 index 00000000..16f1f00d --- /dev/null +++ b/app/src/main/res/drawable-hdpi/ico_sync.png diff --git a/app/src/main/res/drawable-mdpi/ico_add.png b/app/src/main/res/drawable-mdpi/ico_add.png Binary files differindex c35e0c91..eec9dafc 100644 --- a/app/src/main/res/drawable-mdpi/ico_add.png +++ b/app/src/main/res/drawable-mdpi/ico_add.png diff --git a/app/src/main/res/drawable-mdpi/ico_eye.png b/app/src/main/res/drawable-mdpi/ico_eye.png Binary files differnew file mode 100644 index 00000000..84325f9a --- /dev/null +++ b/app/src/main/res/drawable-mdpi/ico_eye.png diff --git a/app/src/main/res/drawable-mdpi/ico_sync.png b/app/src/main/res/drawable-mdpi/ico_sync.png Binary files differnew file mode 100644 index 00000000..6c69bce0 --- /dev/null +++ b/app/src/main/res/drawable-mdpi/ico_sync.png diff --git a/app/src/main/res/drawable-xhdpi/ico_add.png b/app/src/main/res/drawable-xhdpi/ico_add.png Binary files differindex 4bd0d714..598647f0 100644 --- a/app/src/main/res/drawable-xhdpi/ico_add.png +++ b/app/src/main/res/drawable-xhdpi/ico_add.png diff --git a/app/src/main/res/drawable-xhdpi/ico_eye.png b/app/src/main/res/drawable-xhdpi/ico_eye.png Binary files differnew file mode 100644 index 00000000..517360ba --- /dev/null +++ b/app/src/main/res/drawable-xhdpi/ico_eye.png diff --git a/app/src/main/res/drawable-xhdpi/ico_sync.png b/app/src/main/res/drawable-xhdpi/ico_sync.png Binary files differnew file mode 100644 index 00000000..80346dd3 --- /dev/null +++ b/app/src/main/res/drawable-xhdpi/ico_sync.png diff --git a/app/src/main/res/drawable-xxhdpi/ico_add.png b/app/src/main/res/drawable-xxhdpi/ico_add.png Binary files differindex 6ecf9567..b617b81e 100644 --- a/app/src/main/res/drawable-xxhdpi/ico_add.png +++ b/app/src/main/res/drawable-xxhdpi/ico_add.png diff --git a/app/src/main/res/drawable-xxhdpi/ico_eye.png b/app/src/main/res/drawable-xxhdpi/ico_eye.png Binary files differnew file mode 100644 index 00000000..8dec5464 --- /dev/null +++ b/app/src/main/res/drawable-xxhdpi/ico_eye.png diff --git a/app/src/main/res/drawable-xxhdpi/ico_sync.png b/app/src/main/res/drawable-xxhdpi/ico_sync.png Binary files differnew file mode 100644 index 00000000..c0b7dd9d --- /dev/null +++ b/app/src/main/res/drawable-xxhdpi/ico_sync.png diff --git a/app/src/main/res/layout/activity_pwdstore.xml b/app/src/main/res/layout/activity_pwdstore.xml index 08dcf2ad..89a4c122 100644 --- a/app/src/main/res/layout/activity_pwdstore.xml +++ b/app/src/main/res/layout/activity_pwdstore.xml @@ -16,17 +16,4 @@ android:layout_height="wrap_content" android:orientation="vertical"></LinearLayout> - - <ImageButton - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:src="@drawable/ico_add" - android:background="@drawable/oval" - android:layout_gravity="center_vertical" - android:onClick="createPassword" - android:layout_column="2" - android:layout_alignParentBottom="true" - android:layout_alignRight="@+id/main_layout" - android:layout_alignEnd="@+id/main_layout" /> - </RelativeLayout> diff --git a/app/src/main/res/layout/encrypt_layout.xml b/app/src/main/res/layout/encrypt_layout.xml index 3abfd7d6..1b89b0df 100644 --- a/app/src/main/res/layout/encrypt_layout.xml +++ b/app/src/main/res/layout/encrypt_layout.xml @@ -1,127 +1,116 @@ <?xml version="1.0" encoding="utf-8"?> -<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" - android:layout_width="fill_parent" - android:layout_height="fill_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:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical" + tools:context="com.zeapo.pwdstore.crypto.PgpHandler" android:background="#eee"> - <GridLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:tools="http://schemas.android.com/tools" + <LinearLayout android:layout_width="match_parent" - android:layout_height="fill_parent" - tools:context="com.zeapo.pwdstore.crypto.PgpHandler"> - - - <LinearLayout - android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@drawable/rectangle" + android:orientation="horizontal" + android:layout_row="1" + android:layout_column="0"> + + <TextView + android:id="@+id/crypto_password_category" + android:layout_gravity="center_vertical" + android:layout_width="wrap_content" android:layout_height="wrap_content" - android:background="@drawable/rectangle" - android:orientation="horizontal" - android:layout_row="1" - android:layout_column="0"> - - <TextView - android:id="@+id/crypto_password_category" - android:layout_gravity="center_vertical" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:textStyle="bold" - android:textColor="@android:color/holo_blue_dark" - android:textAppearance="?android:attr/textAppearanceMedium" - android:text="CATEGORY/"/> + android:textStyle="bold" + android:textColor="@android:color/holo_blue_dark" + android:textAppearance="?android:attr/textAppearanceMedium" + android:text="CATEGORY/"/> - <EditText - android:layout_gravity="center_vertical" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:id="@+id/crypto_password_file_edit" - android:hint="@string/crypto_name_hint" - android:textColor="@android:color/holo_orange_dark"/> + <EditText + android:layout_gravity="center_vertical" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:id="@+id/crypto_password_file_edit" + android:hint="@string/crypto_name_hint" + android:textColor="@android:color/holo_orange_dark"/> - </LinearLayout> + </LinearLayout> + <ScrollView android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:layout_marginTop="@dimen/activity_vertical_margin" + android:layout_marginBottom="@dimen/activity_vertical_margin" + android:background="@drawable/rectangle" + android:layout_weight="1"> <LinearLayout android:id="@+id/crypto_container" android:orientation="vertical" android:layout_width="fill_parent" android:layout_marginTop="@dimen/activity_vertical_margin" - android:background="@drawable/rectangle" android:layout_height="wrap_content" - android:layout_row="2" - android:layout_column="0"> + android:paddingLeft="@dimen/activity_horizontal_margin" + android:paddingRight="@dimen/activity_horizontal_margin"> <LinearLayout - android:id="@+id/crypto_password_edit_layout" android:layout_width="match_parent" android:layout_height="wrap_content" - android:orientation="vertical"> - - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="horizontal"> - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:textStyle="bold" - android:text="@string/crypto_pass_label"/> - <EditText - android:id="@+id/crypto_password_edit" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:typeface="monospace"/> - </LinearLayout> - + android:orientation="horizontal"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginTop="8dp" android:textStyle="bold" - android:text="@string/crypto_extra_label"/> - + android:text="@string/crypto_pass_label"/> <EditText - android:id="@+id/crypto_extra_edit" - android:layout_width="match_parent" + android:id="@+id/crypto_password_edit" + android:layout_width="fill_parent" android:layout_height="wrap_content" - android:enabled="true" - android:visibility="visible" android:typeface="monospace"/> </LinearLayout> - </LinearLayout> - <RelativeLayout - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:layout_row="3" - android:layout_column="0"> - <ImageButton - android:layout_height="wrap_content" + <TextView android:layout_width="wrap_content" - android:src="@drawable/ico_check" - android:background="@drawable/oval" - android:id="@+id/crypto_confirm_add" - android:onClick="handleClick" - android:layout_alignParentTop="true" - android:layout_alignParentRight="true" - android:layout_alignParentEnd="true" /> - - <ImageButton android:layout_height="wrap_content" - android:layout_width="wrap_content" - android:src="@drawable/ico_cancel" - android:background="@drawable/oval" - android:id="@+id/crypto_cancel_add" - android:onClick="handleClick" - android:layout_alignParentTop="true" - android:layout_alignParentLeft="true" - android:layout_alignParentStart="true" /> - </RelativeLayout> + android:layout_marginTop="8dp" + android:textStyle="bold" + android:text="@string/crypto_extra_label"/> + + <EditText + android:id="@+id/crypto_extra_edit" + android:layout_width="match_parent" + android:layout_height="fill_parent" + android:enabled="true" + android:visibility="visible" + android:typeface="monospace"/> + </LinearLayout> - </GridLayout> -</ScrollView> + </ScrollView> + <RelativeLayout + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:layout_weight="0"> + <ImageButton + android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:src="@drawable/ico_check" + android:background="@drawable/oval" + android:id="@+id/crypto_confirm_add" + android:onClick="handleClick" + android:layout_alignParentTop="true" + android:layout_alignParentRight="true" + android:layout_alignParentEnd="true" /> + + <ImageButton + android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:src="@drawable/ico_cancel" + android:background="@drawable/oval" + android:id="@+id/crypto_cancel_add" + android:onClick="handleClick" + android:layout_alignParentTop="true" + android:layout_alignParentLeft="true" + android:layout_alignParentStart="true" /> + </RelativeLayout> + + +</LinearLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/password_row_layout.xml b/app/src/main/res/layout/password_row_layout.xml index 641f4f85..05bf3457 100644 --- a/app/src/main/res/layout/password_row_layout.xml +++ b/app/src/main/res/layout/password_row_layout.xml @@ -35,7 +35,7 @@ android:id="@+id/crypto_show_button" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:src="@drawable/ico_key" + android:src="@drawable/ico_eye" android:background="@drawable/blue_rectangle" android:layout_gravity="center_vertical" android:layout_marginLeft="8dp" diff --git a/app/src/main/res/menu/pwdstore.xml b/app/src/main/res/menu/pwdstore.xml index facca6c4..65bc0272 100644 --- a/app/src/main/res/menu/pwdstore.xml +++ b/app/src/main/res/menu/pwdstore.xml @@ -1,7 +1,10 @@ <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" tools:context=".pwdstore" > + <item android:id="@+id/menu_add_password" + android:icon="@drawable/ico_add" + android:showAsAction="always" android:title="New password"/> <!--<item android:id="@+id/menu_add_category"--> @@ -15,7 +18,7 @@ <item android:id="@+id/referesh" android:title="Refresh list" android:showAsAction="ifRoom" - android:icon="@android:drawable/ic_popup_sync"/> + android:icon="@drawable/ico_sync"/> <item android:id="@+id/user_pref" android:title="Settings" |