diff options
author | Joel Beckmeyer <joel@thebeckmeyers.xyz> | 2018-09-25 13:45:54 -0400 |
---|---|---|
committer | حسين <zidhussein@gmail.com> | 2018-09-25 18:45:54 +0100 |
commit | eea0e68dda1eb7248c6d458f52baeedb318b466a (patch) | |
tree | 73ff2b2f121b8db3097671f0e0639906edc2abea /app/src/main/res/layout | |
parent | ac889abdd3d71ffb7f064a384c375ec22e7734c4 (diff) |
Display HOTP code if password contains HOTP secret, unify HOTP and TOTP code (#413)
* Display HOTP code if password contains HOTP secret, unify HOTP and TOTP code
* Add ability to show HOTP instead of showing every decrypt
* Fix off by 1 error
* fix return intent logic so that edits and HOTP increments are properly committed
* fix linting errors
* Fix broken logic for case when a password is created
* add ability to choose if password entry will be updated on HOTP code calculation
Diffstat (limited to 'app/src/main/res/layout')
-rw-r--r-- | app/src/main/res/layout/decrypt_layout.xml | 91 | ||||
-rw-r--r-- | app/src/main/res/layout/otp_confirm_layout.xml | 21 |
2 files changed, 67 insertions, 45 deletions
diff --git a/app/src/main/res/layout/decrypt_layout.xml b/app/src/main/res/layout/decrypt_layout.xml index ac274e4e..d08e0dbf 100644 --- a/app/src/main/res/layout/decrypt_layout.xml +++ b/app/src/main/res/layout/decrypt_layout.xml @@ -3,15 +3,15 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context="com.zeapo.pwdstore.crypto.PgpActivity" + android:background="@color/background" android:orientation="vertical" - android:background="@color/background"> + tools:context="com.zeapo.pwdstore.crypto.PgpActivity"> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" - android:padding="16dp" - android:orientation="vertical"> + android:orientation="vertical" + android:padding="16dp"> <LinearLayout android:layout_width="match_parent" @@ -61,17 +61,17 @@ <ImageView android:layout_width="match_parent" android:layout_height="wrap_content" - android:src="@drawable/divider" - android:layout_marginTop="16dp" android:layout_marginBottom="16dp" + android:layout_marginTop="16dp" + android:src="@drawable/divider" tools:ignore="ContentDescription" /> <LinearLayout android:id="@+id/crypto_container_decrypt" - android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="@dimen/activity_vertical_margin" + android:orientation="vertical" android:visibility="invisible"> <GridLayout @@ -83,39 +83,40 @@ android:id="@+id/crypto_password_show_label" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:textStyle="bold" - android:textColor="@android:color/black" - android:text="@string/password" + android:layout_column="0" android:layout_row="0" - android:layout_column="0"/> + android:text="@string/password" + android:textColor="@android:color/black" + android:textStyle="bold" /> + <TextView android:id="@+id/crypto_password_show" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:typeface="monospace" - android:textColor="@android:color/black" android:layout_column="2" - android:layout_row="0"/> + android:layout_row="0" + android:textColor="@android:color/black" + android:typeface="monospace" /> <ProgressBar android:id="@+id/pbLoading" + style="?android:attr/progressBarStyleHorizontal" android:layout_width="match_parent" android:layout_height="8dp" - android:layout_marginTop="8dp" - android:layout_marginBottom="8dp" - style="?android:attr/progressBarStyleHorizontal" - android:layout_row="1" android:layout_column="0" - android:layout_columnSpan="3"/> + android:layout_columnSpan="3" + android:layout_marginBottom="8dp" + android:layout_marginTop="8dp" + android:layout_row="1" /> <Button android:id="@+id/crypto_password_toggle_show" android:layout_width="match_parent" - android:text="@string/show_password" android:layout_height="wrap_content" - android:layout_row="2" android:layout_column="0" - android:layout_columnSpan="3"/> + android:layout_columnSpan="3" + android:layout_row="2" + android:text="@string/show_password" /> </GridLayout> @@ -129,13 +130,13 @@ android:id="@+id/crypto_copy_username" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_alignParentRight="true" android:layout_alignParentEnd="true" + android:layout_alignParentRight="true" android:layout_alignParentTop="true" - android:contentDescription="@string/copy_username" - android:visibility="invisible" android:background="@color/background" - android:src="@drawable/ic_content_copy"/> + android:contentDescription="@string/copy_username" + android:src="@drawable/ic_content_copy" + android:visibility="invisible" /> <TextView android:id="@+id/crypto_username_show_label" @@ -146,10 +147,10 @@ android:layout_alignParentTop="true" android:layout_toLeftOf="@id/crypto_copy_username" android:layout_toStartOf="@id/crypto_copy_username" - android:visibility="invisible" android:text="@string/username" android:textColor="@android:color/black" - android:textStyle="bold" /> + android:textStyle="bold" + android:visibility="invisible" /> <TextView android:id="@+id/crypto_username_show" @@ -160,45 +161,45 @@ android:layout_below="@id/crypto_username_show_label" android:layout_toLeftOf="@id/crypto_copy_username" android:layout_toStartOf="@id/crypto_copy_username" - android:visibility="invisible" android:textColor="@android:color/black" android:textIsSelectable="true" - android:typeface="monospace" /> + android:typeface="monospace" + android:visibility="invisible" /> <ImageButton - android:id="@+id/crypto_copy_totp" + android:id="@+id/crypto_copy_otp" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_alignParentRight="true" android:layout_alignParentEnd="true" + android:layout_alignParentRight="true" android:layout_below="@id/crypto_username_show" - android:visibility="invisible" - android:contentDescription="@string/copy_totp" android:background="@color/background" - android:src="@drawable/ic_content_copy"/> + android:contentDescription="@string/copy_otp" + android:src="@drawable/ic_content_copy" + android:visibility="invisible" /> <TextView - android:id="@+id/crypto_totp_show_label" + android:id="@+id/crypto_otp_show_label" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" - android:layout_toLeftOf="@id/crypto_copy_totp" - android:layout_toStartOf="@id/crypto_copy_totp" android:layout_below="@id/crypto_username_show" - android:text="@string/totp" + android:layout_toLeftOf="@id/crypto_copy_otp" + android:layout_toStartOf="@id/crypto_copy_otp" + android:text="@string/otp" android:textColor="@android:color/black" android:textStyle="bold" /> <TextView - android:id="@+id/crypto_totp_show" + android:id="@+id/crypto_otp_show" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" - android:layout_below="@id/crypto_totp_show_label" - android:layout_toLeftOf="@id/crypto_copy_totp" - android:layout_toStartOf="@id/crypto_copy_totp" + android:layout_below="@id/crypto_otp_show_label" + android:layout_toLeftOf="@id/crypto_copy_otp" + android:layout_toStartOf="@id/crypto_copy_otp" android:textColor="@android:color/black" android:textIsSelectable="true" android:typeface="monospace" /> @@ -209,7 +210,7 @@ android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" - android:layout_below="@id/crypto_totp_show" + android:layout_below="@id/crypto_otp_show" android:text="@string/extra_content" android:textColor="@android:color/black" android:textStyle="bold" /> @@ -230,4 +231,4 @@ </LinearLayout> -</ScrollView>
\ No newline at end of file +</ScrollView> diff --git a/app/src/main/res/layout/otp_confirm_layout.xml b/app/src/main/res/layout/otp_confirm_layout.xml new file mode 100644 index 00000000..d2cb597e --- /dev/null +++ b/app/src/main/res/layout/otp_confirm_layout.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="utf-8"?> +<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent"> + + <CheckBox + android:id="@+id/hotp_remember_checkbox" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginEnd="16dp" + android:layout_marginRight="16dp" + android:layout_marginStart="16dp" + android:layout_marginTop="8dp" + android:text="@string/dialog_update_check" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + +</android.support.constraint.ConstraintLayout>
\ No newline at end of file |