From d1c15a43d50f8df719a87251e7bb91c8f0acceb2 Mon Sep 17 00:00:00 2001 From: DSIW Date: Fri, 10 Jun 2016 06:30:25 +0200 Subject: Restyle new password formular --- .../java/com/zeapo/pwdstore/crypto/PgpHandler.java | 23 +++-- app/src/main/res/drawable-hdpi/ic_action_save.png | Bin 394 -> 0 bytes app/src/main/res/drawable-mdpi/ic_action_save.png | Bin 362 -> 0 bytes app/src/main/res/drawable-xhdpi/ic_action_save.png | Bin 441 -> 0 bytes .../main/res/drawable-xxhdpi/ic_action_save.png | Bin 495 -> 0 bytes app/src/main/res/drawable/selected_rectangle.xml | 21 ----- app/src/main/res/layout/encrypt_layout.xml | 102 ++++++++------------- app/src/main/res/menu/pgp_handler_new_password.xml | 15 +++ 8 files changed, 69 insertions(+), 92 deletions(-) delete mode 100644 app/src/main/res/drawable-hdpi/ic_action_save.png delete mode 100644 app/src/main/res/drawable-mdpi/ic_action_save.png delete mode 100644 app/src/main/res/drawable-xhdpi/ic_action_save.png delete mode 100644 app/src/main/res/drawable-xxhdpi/ic_action_save.png delete mode 100644 app/src/main/res/drawable/selected_rectangle.xml create mode 100644 app/src/main/res/menu/pgp_handler_new_password.xml (limited to 'app/src') diff --git a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java index a80e4800..f984ad31 100644 --- a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java +++ b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java @@ -81,6 +81,10 @@ public class PgpHandler extends AppCompatActivity implements OpenPgpServiceConne this.activity = this; this.clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE); + if (getIntent().getStringExtra("Operation").equals("ENCRYPT")) { + setTitle("New password"); + } + // some persistance settings = PreferenceManager.getDefaultSharedPreferences(this); String providerPackageName = settings.getString("openpgp_provider_list", ""); @@ -121,7 +125,11 @@ public class PgpHandler extends AppCompatActivity implements OpenPgpServiceConne @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. - getMenuInflater().inflate(R.menu.pgp_handler, menu); + if (getIntent().getStringExtra("Operation").equals("ENCRYPT")) { + getMenuInflater().inflate(R.menu.pgp_handler_new_password, menu); + } else { + getMenuInflater().inflate(R.menu.pgp_handler, menu); + } return true; } @@ -141,6 +149,13 @@ public class PgpHandler extends AppCompatActivity implements OpenPgpServiceConne break; case R.id.edit_password: editPassword(); + case R.id.crypto_confirm_add: + encrypt(new Intent()); + break; + case R.id.crypto_cancel_add: + setResult(RESULT_CANCELED); + finish(); + return true; } return super.onOptionsItemSelected(item); } @@ -205,12 +220,6 @@ public class PgpHandler extends AppCompatActivity implements OpenPgpServiceConne case R.id.crypto_show_button: decryptAndVerify(new Intent()); break; - case R.id.crypto_confirm_add: - encrypt(new Intent()); - break; - case R.id.crypto_cancel_add: - finish(); - break; case R.id.crypto_delete_button: // deletePassword(); break; diff --git a/app/src/main/res/drawable-hdpi/ic_action_save.png b/app/src/main/res/drawable-hdpi/ic_action_save.png deleted file mode 100644 index 0fe36a1e..00000000 Binary files a/app/src/main/res/drawable-hdpi/ic_action_save.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/ic_action_save.png b/app/src/main/res/drawable-mdpi/ic_action_save.png deleted file mode 100644 index 664260d8..00000000 Binary files a/app/src/main/res/drawable-mdpi/ic_action_save.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/ic_action_save.png b/app/src/main/res/drawable-xhdpi/ic_action_save.png deleted file mode 100644 index dde278b5..00000000 Binary files a/app/src/main/res/drawable-xhdpi/ic_action_save.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_save.png b/app/src/main/res/drawable-xxhdpi/ic_action_save.png deleted file mode 100644 index ccf8c82c..00000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_action_save.png and /dev/null differ diff --git a/app/src/main/res/drawable/selected_rectangle.xml b/app/src/main/res/drawable/selected_rectangle.xml deleted file mode 100644 index ec8d2ad8..00000000 --- a/app/src/main/res/drawable/selected_rectangle.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/encrypt_layout.xml b/app/src/main/res/layout/encrypt_layout.xml index 1ee8e3c9..98a6b04d 100644 --- a/app/src/main/res/layout/encrypt_layout.xml +++ b/app/src/main/res/layout/encrypt_layout.xml @@ -5,24 +5,24 @@ android:layout_height="match_parent" android:orientation="vertical" tools:context="com.zeapo.pwdstore.crypto.PgpHandler" - android:background="#eee"> + android:background="#eee" + android:padding="@dimen/activity_horizontal_margin"> + android:orientation="vertical"> + android:textColor="@color/grey_500" + android:text="CATEGORY HERE" + android:id="@+id/crypto_password_category" + android:layout_gravity="center_vertical" + android:textSize="18dp" + android:textIsSelectable="false" + android:layout_marginLeft="@dimen/activity_horizontal_margin" /> - + android:textAppearance="@android:style/TextAppearance.DeviceDefault.Medium" + android:textSize="24dp" + android:textColor="@color/accent" /> - + android:layout_height="wrap_content"> - @@ -57,20 +55,29 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:textStyle="bold" - android:text="@string/crypto_pass_label"/> - -