mirror of
https://github.com/android-password-store/Android-Password-Store
synced 2025-09-01 06:45: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.activity = this;
|
||||||
this.clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
|
this.clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
|
||||||
|
|
||||||
|
if (getIntent().getStringExtra("Operation").equals("ENCRYPT")) {
|
||||||
|
setTitle("New password");
|
||||||
|
}
|
||||||
|
|
||||||
// some persistance
|
// some persistance
|
||||||
settings = PreferenceManager.getDefaultSharedPreferences(this);
|
settings = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
String providerPackageName = settings.getString("openpgp_provider_list", "");
|
String providerPackageName = settings.getString("openpgp_provider_list", "");
|
||||||
@@ -121,7 +125,11 @@ public class PgpHandler extends AppCompatActivity implements OpenPgpServiceConne
|
|||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
// Inflate the menu; this adds items to the action bar if it is present.
|
// Inflate the menu; this adds items to the action bar if it is present.
|
||||||
|
if (getIntent().getStringExtra("Operation").equals("ENCRYPT")) {
|
||||||
|
getMenuInflater().inflate(R.menu.pgp_handler_new_password, menu);
|
||||||
|
} else {
|
||||||
getMenuInflater().inflate(R.menu.pgp_handler, menu);
|
getMenuInflater().inflate(R.menu.pgp_handler, menu);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -141,6 +149,13 @@ public class PgpHandler extends AppCompatActivity implements OpenPgpServiceConne
|
|||||||
break;
|
break;
|
||||||
case R.id.edit_password:
|
case R.id.edit_password:
|
||||||
editPassword();
|
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);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
@@ -205,12 +220,6 @@ public class PgpHandler extends AppCompatActivity implements OpenPgpServiceConne
|
|||||||
case R.id.crypto_show_button:
|
case R.id.crypto_show_button:
|
||||||
decryptAndVerify(new Intent());
|
decryptAndVerify(new Intent());
|
||||||
break;
|
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:
|
case R.id.crypto_delete_button:
|
||||||
// deletePassword();
|
// deletePassword();
|
||||||
break;
|
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:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
tools:context="com.zeapo.pwdstore.crypto.PgpHandler"
|
tools:context="com.zeapo.pwdstore.crypto.PgpHandler"
|
||||||
android:background="#eee">
|
android:background="#eee"
|
||||||
|
android:padding="@dimen/activity_horizontal_margin">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:orientation="vertical">
|
||||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
|
||||||
android:paddingRight="@dimen/activity_horizontal_margin">
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/crypto_password_category"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textStyle="bold"
|
android:textColor="@color/grey_500"
|
||||||
android:textColor="@android:color/holo_blue_dark"
|
android:text="CATEGORY HERE"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:id="@+id/crypto_password_category"
|
||||||
android:text="CATEGORY/"/>
|
android:layout_gravity="center_vertical"
|
||||||
|
android:textSize="18dp"
|
||||||
|
android:textIsSelectable="false"
|
||||||
|
android:layout_marginLeft="@dimen/activity_horizontal_margin" />
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
@@ -30,11 +30,11 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:id="@+id/crypto_password_file_edit"
|
android:id="@+id/crypto_password_file_edit"
|
||||||
android:hint="@string/crypto_name_hint"
|
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>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
<ScrollView android:layout_width="fill_parent"
|
<ScrollView android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:layout_marginTop="@dimen/activity_vertical_margin"
|
android:layout_marginTop="@dimen/activity_vertical_margin"
|
||||||
@@ -45,11 +45,9 @@
|
|||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_marginTop="@dimen/activity_vertical_margin"
|
android:layout_marginTop="@dimen/activity_vertical_margin"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content">
|
||||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
|
||||||
android:paddingRight="@dimen/activity_horizontal_margin">
|
|
||||||
|
|
||||||
<LinearLayout
|
<RelativeLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
@@ -57,20 +55,29 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:text="@string/crypto_pass_label"/>
|
android:text="@string/crypto_pass_label"
|
||||||
|
android:id="@+id/textView2"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:layout_alignParentStart="true" />
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/crypto_password_edit"
|
android:id="@+id/crypto_password_edit"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:typeface="monospace"
|
android:typeface="monospace"
|
||||||
android:layout_weight="1"/>
|
android:layout_weight="1"
|
||||||
|
android:layout_toRightOf="@+id/textView2"
|
||||||
|
android:layout_toEndOf="@+id/textView2" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:id="@+id/generate_password"
|
android:id="@+id/generate_password"
|
||||||
android:text="@string/pwd_generate_button"
|
android:text="@string/pwd_generate_button"
|
||||||
android:onClick="handleClick"/>
|
android:onClick="handleClick"
|
||||||
</LinearLayout>
|
android:layout_gravity="right" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@@ -90,37 +97,4 @@
|
|||||||
|
|
||||||
</ScrollView>
|
</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>
|
</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