diff options
author | Harsh Shandilya <me@msfjarvis.dev> | 2020-04-19 14:09:55 +0530 |
---|---|---|
committer | Harsh Shandilya <me@msfjarvis.dev> | 2020-04-19 14:11:19 +0530 |
commit | aaeb899fb63af1f755d88219e119bde2f62fb039 (patch) | |
tree | f85ac6f4609e1959aa86b4cb6555393c3bef9e03 /app | |
parent | 17385892cbe4e0359c45a6221036dd5d6c9cb283 (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')
-rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt | 7 |
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 |