summaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
authorDSIW <dsiw@dsiw-it.de>2016-06-10 06:30:25 +0200
committerDSIW <dsiw@dsiw-it.de>2016-06-10 06:30:25 +0200
commitd1c15a43d50f8df719a87251e7bb91c8f0acceb2 (patch)
treeb9e5ce28c7ac1974296029e2fb16d7fa3a302d5d /app/src/main
parentda1e95241db7c4377058c1abff9115ca3557c81a (diff)
Restyle new password formular
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java23
-rw-r--r--app/src/main/res/drawable-hdpi/ic_action_save.pngbin394 -> 0 bytes
-rw-r--r--app/src/main/res/drawable-mdpi/ic_action_save.pngbin362 -> 0 bytes
-rw-r--r--app/src/main/res/drawable-xhdpi/ic_action_save.pngbin441 -> 0 bytes
-rw-r--r--app/src/main/res/drawable-xxhdpi/ic_action_save.pngbin495 -> 0 bytes
-rw-r--r--app/src/main/res/drawable/selected_rectangle.xml21
-rw-r--r--app/src/main/res/layout/encrypt_layout.xml102
-rw-r--r--app/src/main/res/menu/pgp_handler_new_password.xml15
8 files changed, 69 insertions, 92 deletions
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
--- a/app/src/main/res/drawable-hdpi/ic_action_save.png
+++ /dev/null
Binary files 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
--- a/app/src/main/res/drawable-mdpi/ic_action_save.png
+++ /dev/null
Binary files 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
--- a/app/src/main/res/drawable-xhdpi/ic_action_save.png
+++ /dev/null
Binary files 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
--- a/app/src/main/res/drawable-xxhdpi/ic_action_save.png
+++ /dev/null
Binary files 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 @@
-<?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="@color/blue_grey_200" />
-
- </shape>
- </item>
-
- <item android:bottom="2dp" android:left="1dp" android:right="1dp">
- <shape android:shape="rectangle" android:dither="true">
- <corners android:radius="2dp" />
- <solid android:color="@color/blue_grey_100" />
-
- <padding android:bottom="2dp" android:left="1dp"/>
- </shape>
- </item>
-</layer-list> \ 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">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:paddingLeft="@dimen/activity_horizontal_margin"
- android:paddingRight="@dimen/activity_horizontal_margin">
+ android:orientation="vertical">
<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: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" />
<EditText
android:layout_gravity="center_vertical"
@@ -30,11 +30,11 @@
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"/>
-
+ android:textAppearance="@android:style/TextAppearance.DeviceDefault.Medium"
+ android:textSize="24dp"
+ android:textColor="@color/accent" />
</LinearLayout>
-
<ScrollView android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginTop="@dimen/activity_vertical_margin"
@@ -45,11 +45,9 @@
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_marginTop="@dimen/activity_vertical_margin"
- android:layout_height="wrap_content"
- android:paddingLeft="@dimen/activity_horizontal_margin"
- android:paddingRight="@dimen/activity_horizontal_margin">
+ android:layout_height="wrap_content">
- <LinearLayout
+ <RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
@@ -57,20 +55,29 @@
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"
- android:layout_weight="1"/>
- <Button
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:id="@+id/generate_password"
- android:text="@string/pwd_generate_button"
- android:onClick="handleClick"/>
- </LinearLayout>
+ android:text="@string/crypto_pass_label"
+ android:id="@+id/textView2"
+ android:layout_centerVertical="true"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentStart="true" />
+ </RelativeLayout>
+
+ <EditText
+ android:id="@+id/crypto_password_edit"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:typeface="monospace"
+ android:layout_weight="1"
+ android:layout_toRightOf="@+id/textView2"
+ android:layout_toEndOf="@+id/textView2" />
+
+ <Button
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:id="@+id/generate_password"
+ android:text="@string/pwd_generate_button"
+ android:onClick="handleClick"
+ android:layout_gravity="right" />
<TextView
android:layout_width="wrap_content"
@@ -90,37 +97,4 @@
</ScrollView>
- <RelativeLayout
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:paddingLeft="@dimen/activity_horizontal_margin"
- android:paddingRight="@dimen/activity_horizontal_margin"
- android:paddingTop="8dp"
- android:paddingBottom="8dp"
- android:background="@android:color/darker_gray"
- android:layout_weight="0">
- <ImageButton
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:src="@drawable/ic_action_save"
- android:background="@drawable/blue_rectangle"
- 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/ic_action_cancel"
- android:background="@drawable/red_rectangle"
- 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/menu/pgp_handler_new_password.xml b/app/src/main/res/menu/pgp_handler_new_password.xml
new file mode 100644
index 00000000..92be4363
--- /dev/null
+++ b/app/src/main/res/menu/pgp_handler_new_password.xml
@@ -0,0 +1,15 @@
+<menu xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ xmlns:pwstore="http://schemas.android.com/apk/res-auto"
+ tools:context="com.zeapo.pwdstore.crypto.PgpHandler" >
+ <item android:title="Cancel"
+ android:icon="@drawable/ic_action_cancel"
+ pwstore:showAsAction="ifRoom"
+ android:id="@+id/crypto_cancel_add"
+ />
+ <item android:title="Save"
+ android:icon="@drawable/ic_action_accept"
+ pwstore:showAsAction="ifRoom"
+ android:id="@+id/crypto_confirm_add"
+ />
+</menu>