From a064116e8027997fe8f3bb7f19778dd1bebbe441 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Tue, 23 Jul 2024 01:57:41 +0530 Subject: fix: only show cache checkbox when enabled --- app/src/main/java/app/passwordstore/ui/crypto/PasswordDialog.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -> -- cgit v1.2.3