From fcde6c2b84d83735675207144f1c0519070412d2 Mon Sep 17 00:00:00 2001 From: arkon Date: Fri, 14 May 2021 09:10:17 -0400 Subject: [PATCH] Minor cleanup --- .../ui/security/SecureActivityDelegate.kt | 27 ++++++++++--------- app/src/main/res/values/strings.xml | 2 +- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/security/SecureActivityDelegate.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/security/SecureActivityDelegate.kt index 67071e5a5..8ca4898cf 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/security/SecureActivityDelegate.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/security/SecureActivityDelegate.kt @@ -28,24 +28,25 @@ class SecureActivityDelegate(private val activity: FragmentActivity) { } fun onResume() { - val lockApp = preferences.useBiometricLock().get() - if (lockApp && BiometricUtil.isSupported(activity)) { - if (isAppLocked()) { - val intent = Intent(activity, BiometricUnlockActivity::class.java) - activity.startActivity(intent) - activity.overridePendingTransition(0, 0) + if (preferences.useBiometricLock().get()) { + if (BiometricUtil.isSupported(activity)) { + if (isAppLocked()) { + activity.startActivity(Intent(activity, BiometricUnlockActivity::class.java)) + activity.overridePendingTransition(0, 0) + } + } else { + preferences.useBiometricLock().set(false) } - } else if (lockApp) { - preferences.useBiometricLock().set(false) } } private fun isAppLocked(): Boolean { - return locked && - ( - preferences.lockAppAfter().get() <= 0 || - Date().time >= preferences.lastAppUnlock().get() + 60 * 1000 * preferences.lockAppAfter().get() - ) + if (!locked) { + return false + } + + return preferences.lockAppAfter().get() <= 0 || + Date().time >= preferences.lastAppUnlock().get() + 60 * 1000 * preferences.lockAppAfter().get() } companion object { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 4b86741cf..2a1939c99 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -295,7 +295,7 @@ Both Actions Show on long tap - Saves pages into separate folders + Save pages into separate folders Creates folders according to manga title Background color White