aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/settings
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/settings')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/settings/Appearance.kt112
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/settings/Behaviour.kt15
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/settings/Debug.kt16
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/settings/Experimental.kt11
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/settings/Feed.kt99
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/settings/Network.kt3
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/settings/Notifications.kt70
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/settings/Security.kt15
8 files changed, 213 insertions, 128 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/settings/Appearance.kt b/app/src/main/kotlin/com/pitchedapps/frost/settings/Appearance.kt
index 64d9dba2..34f1ba1c 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/settings/Appearance.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/settings/Appearance.kt
@@ -33,7 +33,6 @@ import com.pitchedapps.frost.utils.frostEvent
import com.pitchedapps.frost.utils.frostNavigationBar
import com.pitchedapps.frost.utils.frostSnackbar
import com.pitchedapps.frost.utils.launchTabCustomizerActivity
-import com.pitchedapps.frost.utils.setFrostTheme
import com.pitchedapps.frost.views.KPrefTextSeekbar
/**
@@ -43,7 +42,7 @@ fun SettingsActivity.getAppearancePrefs(): KPrefAdapterBuilder.() -> Unit = {
header(R.string.theme_customization)
- text(R.string.theme, prefs::theme, { prefs.theme = it }) {
+ text(R.string.theme, prefs::theme, { themeProvider.setTheme(it) }) {
onClick = {
materialDialog {
title(R.string.theme)
@@ -55,7 +54,7 @@ fun SettingsActivity.getAppearancePrefs(): KPrefAdapterBuilder.() -> Unit = {
item.pref = index
shouldRestartMain()
reload()
- setFrostTheme(themeProvider, true)
+ activityThemer.setFrostTheme(forceTransparent = true)
themeExterior()
invalidateOptionsMenu()
frostEvent("Theme", "Count" to Theme(index).name)
@@ -70,7 +69,7 @@ fun SettingsActivity.getAppearancePrefs(): KPrefAdapterBuilder.() -> Unit = {
fun KPrefColorPicker.KPrefColorContract.dependsOnCustom() {
enabler = themeProvider::isCustomTheme
- onDisabledClick = { frostSnackbar(R.string.requires_custom_theme) }
+ onDisabledClick = { frostSnackbar(R.string.requires_custom_theme, themeProvider) }
allowCustom = true
}
@@ -78,53 +77,68 @@ fun SettingsActivity.getAppearancePrefs(): KPrefAdapterBuilder.() -> Unit = {
themeProvider.reset()
}
- colorPicker(R.string.text_color, prefs::customTextColor, {
- prefs.customTextColor = it
- reload()
- invalidateCustomTheme()
- shouldRestartMain()
- }) {
+ colorPicker(
+ R.string.text_color, prefs::customTextColor,
+ {
+ prefs.customTextColor = it
+ reload()
+ invalidateCustomTheme()
+ shouldRestartMain()
+ }
+ ) {
dependsOnCustom()
allowCustomAlpha = false
}
- colorPicker(R.string.accent_color, prefs::customAccentColor, {
- prefs.customAccentColor = it
- reload()
- invalidateCustomTheme()
- shouldRestartMain()
- }) {
+ colorPicker(
+ R.string.accent_color, prefs::customAccentColor,
+ {
+ prefs.customAccentColor = it
+ reload()
+ invalidateCustomTheme()
+ shouldRestartMain()
+ }
+ ) {
dependsOnCustom()
allowCustomAlpha = false
}
- colorPicker(R.string.background_color, prefs::customBackgroundColor, {
- prefs.customBackgroundColor = it
- bgCanvas.ripple(it, duration = 500L)
- invalidateCustomTheme()
- setFrostTheme(themeProvider, true)
- shouldRestartMain()
- }) {
+ colorPicker(
+ R.string.background_color, prefs::customBackgroundColor,
+ {
+ prefs.customBackgroundColor = it
+ bgCanvas.ripple(it, duration = 500L)
+ invalidateCustomTheme()
+ activityThemer.setFrostTheme(forceTransparent = true)
+ shouldRestartMain()
+ }
+ ) {
dependsOnCustom()
allowCustomAlpha = true
}
- colorPicker(R.string.header_color, prefs::customHeaderColor, {
- prefs.customHeaderColor = it
- frostNavigationBar(prefs, themeProvider)
- toolbarCanvas.ripple(it, RippleCanvas.MIDDLE, RippleCanvas.END, duration = 500L)
- reload()
- shouldRestartMain()
- }) {
+ colorPicker(
+ R.string.header_color, prefs::customHeaderColor,
+ {
+ prefs.customHeaderColor = it
+ frostNavigationBar(prefs, themeProvider)
+ toolbarCanvas.ripple(it, RippleCanvas.MIDDLE, RippleCanvas.END, duration = 500L)
+ reload()
+ shouldRestartMain()
+ }
+ ) {
dependsOnCustom()
allowCustomAlpha = true
}
- colorPicker(R.string.icon_color, prefs::customIconColor, {
- prefs.customIconColor = it
- invalidateOptionsMenu()
- shouldRestartMain()
- }) {
+ colorPicker(
+ R.string.icon_color, prefs::customIconColor,
+ {
+ prefs.customIconColor = it
+ invalidateOptionsMenu()
+ shouldRestartMain()
+ }
+ ) {
dependsOnCustom()
allowCustomAlpha = false
}
@@ -134,7 +148,8 @@ fun SettingsActivity.getAppearancePrefs(): KPrefAdapterBuilder.() -> Unit = {
text(
R.string.main_activity_layout,
prefs::mainActivityLayoutType,
- { prefs.mainActivityLayoutType = it }) {
+ { prefs.mainActivityLayoutType = it }
+ ) {
textGetter = { string(prefs.mainActivityLayout.titleRes) }
onClick = {
materialDialog {
@@ -158,11 +173,14 @@ fun SettingsActivity.getAppearancePrefs(): KPrefAdapterBuilder.() -> Unit = {
onClick = { launchTabCustomizerActivity() }
}
- checkbox(R.string.tint_nav, prefs::tintNavBar, {
- prefs.tintNavBar = it
- frostNavigationBar(prefs, themeProvider)
- setFrostResult(REQUEST_NAV)
- }) {
+ checkbox(
+ R.string.tint_nav, prefs::tintNavBar,
+ {
+ prefs.tintNavBar = it
+ frostNavigationBar(prefs, themeProvider)
+ setFrostResult(REQUEST_NAV)
+ }
+ ) {
descRes = R.string.tint_nav_desc
}
@@ -174,12 +192,16 @@ fun SettingsActivity.getAppearancePrefs(): KPrefAdapterBuilder.() -> Unit = {
) {
prefs.webTextScaling = it
setFrostResult(REQUEST_TEXT_ZOOM)
- })
+ }
+ )
)
- checkbox(R.string.enforce_black_media_bg, prefs::blackMediaBg, {
- prefs.blackMediaBg = it
- }) {
+ checkbox(
+ R.string.enforce_black_media_bg, prefs::blackMediaBg,
+ {
+ prefs.blackMediaBg = it
+ }
+ ) {
descRes = R.string.enforce_black_media_bg_desc
}
}
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/settings/Behaviour.kt b/app/src/main/kotlin/com/pitchedapps/frost/settings/Behaviour.kt
index 551b3ff1..a9d99763 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/settings/Behaviour.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/settings/Behaviour.kt
@@ -36,21 +36,24 @@ fun SettingsActivity.getBehaviourPrefs(): KPrefAdapterBuilder.() -> Unit = {
checkbox(
R.string.overlay_swipe,
prefs::overlayEnabled,
- { prefs.overlayEnabled = it; shouldRefreshMain() }) {
+ { prefs.overlayEnabled = it; shouldRefreshMain() }
+ ) {
descRes = R.string.overlay_swipe_desc
}
checkbox(
R.string.overlay_full_screen_swipe,
prefs::overlayFullScreenSwipe,
- { prefs.overlayFullScreenSwipe = it }) {
+ { prefs.overlayFullScreenSwipe = it }
+ ) {
descRes = R.string.overlay_full_screen_swipe_desc
}
checkbox(
R.string.open_links_in_default,
prefs::linksInDefaultApp,
- { prefs.linksInDefaultApp = it }) {
+ { prefs.linksInDefaultApp = it }
+ ) {
descRes = R.string.open_links_in_default_desc
}
@@ -61,14 +64,16 @@ fun SettingsActivity.getBehaviourPrefs(): KPrefAdapterBuilder.() -> Unit = {
checkbox(
R.string.force_message_bottom,
prefs::messageScrollToBottom,
- { prefs.messageScrollToBottom = it }) {
+ { prefs.messageScrollToBottom = it }
+ ) {
descRes = R.string.force_message_bottom_desc
}
checkbox(
R.string.auto_expand_text_box,
prefs::autoExpandTextBox,
- { prefs.autoExpandTextBox = it; shouldRefreshMain() }) {
+ { prefs.autoExpandTextBox = it; shouldRefreshMain() }
+ ) {
descRes = R.string.auto_expand_text_box_desc
}
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/settings/Debug.kt b/app/src/main/kotlin/com/pitchedapps/frost/settings/Debug.kt
index 9a4751b8..b2bb1d11 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/settings/Debug.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/settings/Debug.kt
@@ -36,14 +36,15 @@ import com.pitchedapps.frost.facebook.parsers.FrostParser
import com.pitchedapps.frost.facebook.parsers.MessageParser
import com.pitchedapps.frost.facebook.parsers.NotifParser
import com.pitchedapps.frost.facebook.parsers.SearchParser
+import com.pitchedapps.frost.prefs.Prefs
import com.pitchedapps.frost.utils.L
import com.pitchedapps.frost.utils.frostUriFromFile
import com.pitchedapps.frost.utils.sendFrostEmail
-import java.io.File
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.channels.Channel
import kotlinx.coroutines.launch
+import java.io.File
/**
* Created by Allan Wang on 2017-06-30.
@@ -89,10 +90,10 @@ fun SettingsActivity.getDebugPrefs(): KPrefAdapterBuilder.() -> Unit = {
val data = parser.parse(fbCookie.webCookie)
withMainContext {
loading.dismiss()
- createEmail(parser, data?.data)
+ createEmail(parser, data?.data, prefs)
}
} catch (e: Exception) {
- createEmail(parser, "Error: ${e.message}")
+ createEmail(parser, "Error: ${e.message}", prefs)
}
}
}
@@ -101,8 +102,11 @@ fun SettingsActivity.getDebugPrefs(): KPrefAdapterBuilder.() -> Unit = {
}
}
-private fun Context.createEmail(parser: FrostParser<*>, content: Any?) =
- sendFrostEmail("${string(R.string.debug_report)}: ${parser::class.java.simpleName}") {
+private fun Context.createEmail(parser: FrostParser<*>, content: Any?, prefs: Prefs) =
+ sendFrostEmail(
+ "${string(R.string.debug_report)}: ${parser::class.java.simpleName}",
+ prefs = prefs
+ ) {
addItem("Url", parser.url)
addItem("Contents", "$content")
}
@@ -148,7 +152,7 @@ fun SettingsActivity.sendDebug(url: String, html: String?) {
File(downloader.baseDir, "$ZIP_NAME.zip")
)
L.i { "Sending debug zip with uri $zipUri" }
- sendFrostEmail(R.string.debug_report_email_title) {
+ sendFrostEmail(R.string.debug_report_email_title, prefs = prefs) {
addItem("Url", url)
addAttachment(zipUri)
extras = {
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/settings/Experimental.kt b/app/src/main/kotlin/com/pitchedapps/frost/settings/Experimental.kt
index 30b16f81..995500f0 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/settings/Experimental.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/settings/Experimental.kt
@@ -36,10 +36,13 @@ fun SettingsActivity.getExperimentalPrefs(): KPrefAdapterBuilder.() -> Unit = {
// Experimental content ends here --------------------
- checkbox(R.string.verbose_logging, prefs::verboseLogging, {
- prefs.verboseLogging = it
- KL.shouldLog = { it != Log.VERBOSE }
- }) {
+ checkbox(
+ R.string.verbose_logging, prefs::verboseLogging,
+ {
+ prefs.verboseLogging = it
+ KL.shouldLog = { it != Log.VERBOSE }
+ }
+ ) {
descRes = R.string.verbose_logging_desc
}
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/settings/Feed.kt b/app/src/main/kotlin/com/pitchedapps/frost/settings/Feed.kt
index f8d10437..914874a2 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/settings/Feed.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/settings/Feed.kt
@@ -49,66 +49,93 @@ fun SettingsActivity.getFeedPrefs(): KPrefAdapterBuilder.() -> Unit = {
textGetter = { string(FeedSort(it).textRes) }
}
- checkbox(R.string.aggressive_recents, prefs::aggressiveRecents, {
- prefs.aggressiveRecents = it
- shouldRefreshMain()
- }) {
+ checkbox(
+ R.string.aggressive_recents, prefs::aggressiveRecents,
+ {
+ prefs.aggressiveRecents = it
+ shouldRefreshMain()
+ }
+ ) {
descRes = R.string.aggressive_recents_desc
}
- checkbox(R.string.composer, prefs::showComposer, {
- prefs.showComposer = it
- shouldRefreshMain()
- }) {
+ checkbox(
+ R.string.composer, prefs::showComposer,
+ {
+ prefs.showComposer = it
+ shouldRefreshMain()
+ }
+ ) {
descRes = R.string.composer_desc
}
- checkbox(R.string.create_fab, prefs::showCreateFab, {
- prefs.showCreateFab = it
- setFrostResult(REQUEST_FAB)
- }) {
+ checkbox(
+ R.string.create_fab, prefs::showCreateFab,
+ {
+ prefs.showCreateFab = it
+ setFrostResult(REQUEST_FAB)
+ }
+ ) {
descRes = R.string.create_fab_desc
}
- checkbox(R.string.suggested_friends, prefs::showSuggestedFriends, {
- prefs.showSuggestedFriends = it
- shouldRefreshMain()
- }) {
+ checkbox(
+ R.string.suggested_friends, prefs::showSuggestedFriends,
+ {
+ prefs.showSuggestedFriends = it
+ shouldRefreshMain()
+ }
+ ) {
descRes = R.string.suggested_friends_desc
}
- checkbox(R.string.suggested_groups, prefs::showSuggestedGroups, {
- prefs.showSuggestedGroups = it
- shouldRefreshMain()
- }) {
+ checkbox(
+ R.string.suggested_groups, prefs::showSuggestedGroups,
+ {
+ prefs.showSuggestedGroups = it
+ shouldRefreshMain()
+ }
+ ) {
descRes = R.string.suggested_groups_desc
}
- checkbox(R.string.show_stories, prefs::showStories, {
- prefs.showStories = it
- shouldRefreshMain()
- }) {
+ checkbox(
+ R.string.show_stories, prefs::showStories,
+ {
+ prefs.showStories = it
+ shouldRefreshMain()
+ }
+ ) {
descRes = R.string.show_stories_desc
}
- checkbox(R.string.show_post_actions, prefs::showPostActions, {
- prefs.showPostActions = it
- shouldRefreshMain()
- }) {
+ checkbox(
+ R.string.show_post_actions, prefs::showPostActions,
+ {
+ prefs.showPostActions = it
+ shouldRefreshMain()
+ }
+ ) {
descRes = R.string.show_post_actions_desc
}
- checkbox(R.string.show_post_reactions, prefs::showPostReactions, {
- prefs.showPostReactions = it
- shouldRefreshMain()
- }) {
+ checkbox(
+ R.string.show_post_reactions, prefs::showPostReactions,
+ {
+ prefs.showPostReactions = it
+ shouldRefreshMain()
+ }
+ ) {
descRes = R.string.show_post_reactions_desc
}
- checkbox(R.string.full_size_image, prefs::fullSizeImage, {
- prefs.fullSizeImage = it
- shouldRefreshMain()
- }) {
+ checkbox(
+ R.string.full_size_image, prefs::fullSizeImage,
+ {
+ prefs.fullSizeImage = it
+ shouldRefreshMain()
+ }
+ ) {
descRes = R.string.full_size_image_desc
}
}
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/settings/Network.kt b/app/src/main/kotlin/com/pitchedapps/frost/settings/Network.kt
index c275227f..9df8bf86 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/settings/Network.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/settings/Network.kt
@@ -28,7 +28,8 @@ fun SettingsActivity.getNetworkPrefs(): KPrefAdapterBuilder.() -> Unit = {
checkbox(
R.string.network_media_on_metered,
{ !prefs.loadMediaOnMeteredNetwork },
- { prefs.loadMediaOnMeteredNetwork = !it }) {
+ { prefs.loadMediaOnMeteredNetwork = !it }
+ ) {
descRes = R.string.network_media_on_metered_desc
}
}
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/settings/Notifications.kt b/app/src/main/kotlin/com/pitchedapps/frost/settings/Notifications.kt
index 397825f6..a0fd2e3d 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/settings/Notifications.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/settings/Notifications.kt
@@ -54,7 +54,8 @@ fun SettingsActivity.getNotificationPrefs(): KPrefAdapterBuilder.() -> Unit = {
text(
R.string.notification_frequency,
prefs::notificationFreq,
- { prefs.notificationFreq = it }) {
+ { prefs.notificationFreq = it }
+ ) {
val options = longArrayOf(15, 30, 60, 120, 180, 300, 1440, 2880)
val texts =
options.map { if (it <= 0) string(R.string.no_notifications) else minuteToText(it) }
@@ -87,34 +88,42 @@ fun SettingsActivity.getNotificationPrefs(): KPrefAdapterBuilder.() -> Unit = {
}
}
- checkbox(R.string.notification_general, prefs::notificationsGeneral,
+ checkbox(
+ R.string.notification_general, prefs::notificationsGeneral,
{
prefs.notificationsGeneral = it
reloadByTitle(R.string.notification_general_all_accounts)
if (!prefs.notificationsInstantMessages)
reloadByTitle(R.string.notification_frequency)
- }) {
+ }
+ ) {
descRes = R.string.notification_general_desc
}
- checkbox(R.string.notification_general_all_accounts, prefs::notificationAllAccounts,
- { prefs.notificationAllAccounts = it }) {
+ checkbox(
+ R.string.notification_general_all_accounts, prefs::notificationAllAccounts,
+ { prefs.notificationAllAccounts = it }
+ ) {
descRes = R.string.notification_general_all_accounts_desc
enabler = { prefs.notificationsGeneral }
}
- checkbox(R.string.notification_messages, prefs::notificationsInstantMessages,
+ checkbox(
+ R.string.notification_messages, prefs::notificationsInstantMessages,
{
prefs.notificationsInstantMessages = it
reloadByTitle(R.string.notification_messages_all_accounts)
if (!prefs.notificationsGeneral)
reloadByTitle(R.string.notification_frequency)
- }) {
+ }
+ ) {
descRes = R.string.notification_messages_desc
}
- checkbox(R.string.notification_messages_all_accounts, prefs::notificationsImAllAccounts,
- { prefs.notificationsImAllAccounts = it }) {
+ checkbox(
+ R.string.notification_messages_all_accounts, prefs::notificationsImAllAccounts,
+ { prefs.notificationsImAllAccounts = it }
+ ) {
descRes = R.string.notification_messages_all_accounts_desc
enabler = { prefs.notificationsInstantMessages }
}
@@ -129,13 +138,16 @@ fun SettingsActivity.getNotificationPrefs(): KPrefAdapterBuilder.() -> Unit = {
}
}
} else {
- checkbox(R.string.notification_sound, prefs::notificationSound, {
- prefs.notificationSound = it
- reloadByTitle(
- R.string.notification_ringtone,
- R.string.message_ringtone
- )
- })
+ checkbox(
+ R.string.notification_sound, prefs::notificationSound,
+ {
+ prefs.notificationSound = it
+ reloadByTitle(
+ R.string.notification_ringtone,
+ R.string.message_ringtone
+ )
+ }
+ )
fun KPrefText.KPrefTextContract<String>.ringtone(code: Int) {
enabler = prefs::notificationSound
@@ -162,21 +174,29 @@ fun SettingsActivity.getNotificationPrefs(): KPrefAdapterBuilder.() -> Unit = {
}
}
- text(R.string.notification_ringtone, prefs::notificationRingtone,
- { prefs.notificationRingtone = it }) {
+ text(
+ R.string.notification_ringtone, prefs::notificationRingtone,
+ { prefs.notificationRingtone = it }
+ ) {
ringtone(SettingsActivity.REQUEST_NOTIFICATION_RINGTONE)
}
- text(R.string.message_ringtone, prefs::messageRingtone,
- { prefs.messageRingtone = it }) {
+ text(
+ R.string.message_ringtone, prefs::messageRingtone,
+ { prefs.messageRingtone = it }
+ ) {
ringtone(SettingsActivity.REQUEST_MESSAGE_RINGTONE)
}
- checkbox(R.string.notification_vibrate, prefs::notificationVibrate,
- { prefs.notificationVibrate = it })
+ checkbox(
+ R.string.notification_vibrate, prefs::notificationVibrate,
+ { prefs.notificationVibrate = it }
+ )
- checkbox(R.string.notification_lights, prefs::notificationLights,
- { prefs.notificationLights = it })
+ checkbox(
+ R.string.notification_lights, prefs::notificationLights,
+ { prefs.notificationLights = it }
+ )
}
if (BuildConfig.DEBUG) {
@@ -195,7 +215,7 @@ fun SettingsActivity.getNotificationPrefs(): KPrefAdapterBuilder.() -> Unit = {
val text =
if (fetchNotifications()) R.string.notification_fetch_success
else R.string.notification_fetch_fail
- frostSnackbar(text)
+ frostSnackbar(text, themeProvider)
}
}
}
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/settings/Security.kt b/app/src/main/kotlin/com/pitchedapps/frost/settings/Security.kt
index aa38fffd..61c69f10 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/settings/Security.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/settings/Security.kt
@@ -31,18 +31,21 @@ fun SettingsActivity.getSecurityPrefs(): KPrefAdapterBuilder.() -> Unit = {
descRes = R.string.security_disclaimer_info
}
- checkbox(R.string.enable_biometrics, prefs::biometricsEnabled, {
- launch {
+ checkbox(
+ R.string.enable_biometrics, prefs::biometricsEnabled,
+ {
+ launch {
/*
* For security, we should request authentication when:
* - enabling to ensure that it is supported
* - disabling to ensure that it is permitted
*/
- BiometricUtils.authenticate(this@getSecurityPrefs, prefs, force = true).await()
- prefs.biometricsEnabled = it
- reloadByTitle(R.string.enable_biometrics)
+ BiometricUtils.authenticate(this@getSecurityPrefs, prefs, force = true).await()
+ prefs.biometricsEnabled = it
+ reloadByTitle(R.string.enable_biometrics)
+ }
}
- }) {
+ ) {
descRes = R.string.enable_biometrics_desc
enabler = { BiometricUtils.isSupported(this@getSecurityPrefs) }
}