From c1db901feab2b8130f53b9cd6cc57e37a6c54387 Mon Sep 17 00:00:00 2001 From: Mohamed Date: Sun, 19 Nov 2017 12:27:31 +0100 Subject: hide password label if password is empty fix #295 --- app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt | 9 +++++++++ app/src/main/res/layout/decrypt_layout.xml | 1 + 2 files changed, 10 insertions(+) (limited to 'app/src') diff --git a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt index 3b47bf66..d0174a9a 100644 --- a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt +++ b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt @@ -199,6 +199,15 @@ class PgpActivity : AppCompatActivity(), OpenPgpServiceConnection.OnBound { return@executeApiAsync } + if (entry.password.isEmpty()) { + crypto_password_show.visibility = View.GONE + crypto_password_show_label.visibility = View.GONE + } else { + crypto_password_show.visibility = View.VISIBLE + crypto_password_show_label.visibility = View.VISIBLE + crypto_password_show.typeface = monoTypeface + crypto_password_show.text = entry.password + } crypto_password_show.typeface = monoTypeface crypto_password_show.text = entry.password diff --git a/app/src/main/res/layout/decrypt_layout.xml b/app/src/main/res/layout/decrypt_layout.xml index 727b6376..1fde3b79 100644 --- a/app/src/main/res/layout/decrypt_layout.xml +++ b/app/src/main/res/layout/decrypt_layout.xml @@ -67,6 +67,7 @@ android:layout_height="wrap_content">