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>
This commit is contained in:
parent
17385892cb
commit
aaeb899fb6
1 changed files with 6 additions and 1 deletions
|
@ -161,7 +161,6 @@ class PgpActivity : AppCompatActivity(), OpenPgpServiceConnection.OnBound {
|
||||||
|
|
||||||
title = getString(R.string.new_password_title)
|
title = getString(R.string.new_password_title)
|
||||||
crypto_password_category.apply {
|
crypto_password_category.apply {
|
||||||
setText(getRelativePath(fullPath, repoPath))
|
|
||||||
// If the activity has been provided with suggested info or is meant to generate
|
// 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
|
// a password, we allow the user to edit the path, otherwise we style the
|
||||||
// EditText like a TextView.
|
// EditText like a TextView.
|
||||||
|
@ -170,6 +169,12 @@ class PgpActivity : AppCompatActivity(), OpenPgpServiceConnection.OnBound {
|
||||||
} else {
|
} else {
|
||||||
setBackgroundColor(getColor(android.R.color.transparent))
|
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) }
|
suggestedName?.let { crypto_password_file_edit.setText(it) }
|
||||||
// Allow the user to quickly switch between storing the username as the filename or
|
// Allow the user to quickly switch between storing the username as the filename or
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue