mirror of
https://github.com/android-password-store/Android-Password-Store
synced 2025-09-01 14:55:19 +00:00
Restyle new password formular
This commit is contained in:
@@ -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;
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 394 B |
Binary file not shown.
Before Width: | Height: | Size: 362 B |
Binary file not shown.
Before Width: | Height: | Size: 441 B |
Binary file not shown.
Before Width: | Height: | Size: 495 B |
@@ -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>
|
@@ -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>
|
15
app/src/main/res/menu/pgp_handler_new_password.xml
Normal file
15
app/src/main/res/menu/pgp_handler_new_password.xml
Normal file
@@ -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>
|
Reference in New Issue
Block a user