Fix: Make path editable when generating a password (#688)

This commit is contained in:
Fabian Henneke 2020-04-06 08:02:06 +02:00 committed by GitHub
parent 4e8f5e0f69
commit 6a54404462
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -161,9 +161,10 @@ 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, we allow the user to
// edit the path, otherwise we style the EditText like a TextView.
if (suggestedName != null || suggestedPass != null) {
// 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.
if (suggestedName != null || suggestedPass != null || shouldGeneratePassword) {
isEnabled = true
} else {
setBackgroundColor(getColor(android.R.color.transparent))