aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/com/zeapo
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2020-04-19 14:09:55 +0530
committerHarsh Shandilya <me@msfjarvis.dev>2020-04-19 14:11:19 +0530
commitaaeb899fb63af1f755d88219e119bde2f62fb039 (patch)
treef85ac6f4609e1959aa86b4cb6555393c3bef9e03 /app/src/main/java/com/zeapo
parent17385892cbe4e0359c45a6221036dd5d6c9cb283 (diff)
PgpActivity: hide category view when there's no text
Co-Authored-By: Fabian Henneke <fabian@henneke.me> Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'app/src/main/java/com/zeapo')
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt7
1 files changed, 6 insertions, 1 deletions
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 be18472d..63e916d7 100644
--- a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt
+++ b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt
@@ -161,7 +161,6 @@ class PgpActivity : AppCompatActivity(), OpenPgpServiceConnection.OnBound {
title = getString(R.string.new_password_title)
crypto_password_category.apply {
- setText(getRelativePath(fullPath, repoPath))
// If the activity has been provided with suggested info or is meant to generate
// a password, we allow the user to edit the path, otherwise we style the
// EditText like a TextView.
@@ -170,6 +169,12 @@ class PgpActivity : AppCompatActivity(), OpenPgpServiceConnection.OnBound {
} else {
setBackgroundColor(getColor(android.R.color.transparent))
}
+ val path = getRelativePath(fullPath, repoPath)
+ // Keep empty path field visible if it is editable.
+ if (path.isEmpty() && !isEnabled)
+ visibility = View.GONE
+ else
+ setText(path)
}
suggestedName?.let { crypto_password_file_edit.setText(it) }
// Allow the user to quickly switch between storing the username as the filename or