summaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2024-07-23 01:57:41 +0530
committerHarsh Shandilya <me@msfjarvis.dev>2024-07-23 01:57:41 +0530
commita064116e8027997fe8f3bb7f19778dd1bebbe441 (patch)
treeeff71d12d6e6ad8380dd8e6075c7401648bc3f44 /app/src/main/java
parent080387ce758987d52a66141241bcd0363a5bbfbc (diff)
fix: only show cache checkbox when enabled
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/app/passwordstore/ui/crypto/PasswordDialog.kt6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/src/main/java/app/passwordstore/ui/crypto/PasswordDialog.kt b/app/src/main/java/app/passwordstore/ui/crypto/PasswordDialog.kt
index f65a7305..11cfcd30 100644
--- a/app/src/main/java/app/passwordstore/ui/crypto/PasswordDialog.kt
+++ b/app/src/main/java/app/passwordstore/ui/crypto/PasswordDialog.kt
@@ -11,6 +11,7 @@ import android.os.Bundle
import android.view.KeyEvent
import android.view.WindowManager
import androidx.core.os.bundleOf
+import androidx.core.view.isVisible
import androidx.core.widget.doOnTextChanged
import androidx.fragment.app.DialogFragment
import androidx.fragment.app.setFragmentResult
@@ -32,7 +33,10 @@ class PasswordDialog : DialogFragment() {
builder.setView(binding.root)
builder.setTitle(R.string.password)
- if (requireArguments().getBoolean(CACHE_ENABLED_EXTRA, false)) {
+ val cacheEnabled = requireArguments().getBoolean(CACHE_ENABLED_EXTRA, false)
+ binding.autoClearCache.isVisible = cacheEnabled
+
+ if (cacheEnabled) {
clearCacheChecked = requireArguments().getBoolean(AUTO_CLEAR_CACHE_EXTRA)
binding.autoClearCache.isChecked = clearCacheChecked
binding.autoClearCache.setOnCheckedChangeListener { _, isChecked ->