summaryrefslogtreecommitdiff
path: root/app/src/main/res
diff options
context:
space:
mode:
authorWiktor Kwapisiewicz <wiktor@metacode.biz>2017-11-06 12:41:00 +0100
committerMohamed Zenadi <zeapo@users.noreply.github.com>2017-11-19 11:14:45 +0100
commit3d5dd65e306ba3ca560b3c221830ee4cdb4363fb (patch)
tree6a417353098a9dc22093568c7e6c1dd505997512 /app/src/main/res
parent67a7b124eec9178f8539664bf4d2528a111465b2 (diff)
Display TOTP code if entry contains OTP secret
TOTP is calculated on display and on copy to clipboard from secret embedded in entry (either in password or in extra) and the current time.
Diffstat (limited to 'app/src/main/res')
-rw-r--r--app/src/main/res/layout/decrypt_layout.xml39
-rw-r--r--app/src/main/res/values/strings.xml2
2 files changed, 40 insertions, 1 deletions
diff --git a/app/src/main/res/layout/decrypt_layout.xml b/app/src/main/res/layout/decrypt_layout.xml
index 971331a9..727b6376 100644
--- a/app/src/main/res/layout/decrypt_layout.xml
+++ b/app/src/main/res/layout/decrypt_layout.xml
@@ -148,13 +148,50 @@
android:textIsSelectable="true"
android:typeface="monospace" />
+ <ImageButton
+ android:id="@+id/crypto_copy_totp"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentRight="true"
+ android:layout_alignParentEnd="true"
+ android:layout_alignParentTop="true"
+ android:contentDescription="@string/copy_username"
+ android:background="@color/background"
+ android:src="@drawable/ic_content_copy"/>
+
+ <TextView
+ android:id="@+id/crypto_totp_show_label"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentStart="true"
+ android:layout_alignParentTop="true"
+ android:layout_toLeftOf="@id/crypto_copy_totp"
+ android:layout_toStartOf="@id/crypto_copy_totp"
+ android:text="@string/totp"
+ android:textColor="@android:color/black"
+ android:textStyle="bold" />
+
+ <TextView
+ android:id="@+id/crypto_totp_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:textColor="@android:color/black"
+ android:textIsSelectable="true"
+ android:typeface="monospace" />
+
<TextView
android:id="@+id/crypto_extra_show_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
- android:layout_below="@id/crypto_username_show"
+ android:layout_below="@id/crypto_totp_show"
android:text="@string/extra_content"
android:textColor="@android:color/black"
android:textStyle="bold" />
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 65591586..dd286625 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -30,6 +30,7 @@
<string name="provider_toast_text">No OpenPGP Provider selected!</string>
<string name="clipboard_password_toast_text">Password copied to clipboard, you have %d seconds to paste it somewhere.</string>
<string name="clipboard_username_toast_text">Username copied to clipboard</string>
+ <string name="clipboard_totp_toast_text">TOTP code copied to clipboard</string>
<string name="file_toast_text">Please provide a file name</string>
<string name="empty_toast_text">You cannot use an empty password or empty extra content</string>
@@ -92,6 +93,7 @@
<string name="password">Password:</string>
<string name="extra_content">Extra content:</string>
<string name="username">Username:</string>
+ <string name="totp">TOTP:</string>
<string name="edit_password">Edit password</string>
<string name="copy_password">Copy password</string>
<string name="copy_username">Copy username</string>