From ac2dfd86e454e39d275d78176bc3145e9aa14843 Mon Sep 17 00:00:00 2001 From: Patryk Michalik Date: Sat, 23 Oct 2021 13:41:14 +0200 Subject: [PATCH] Remove unnecessary SDK version check --- .../ui/preferences/GeneralPreferences.kt | 44 +++++++++---------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/lawnchair/src/app/lawnchair/ui/preferences/GeneralPreferences.kt b/lawnchair/src/app/lawnchair/ui/preferences/GeneralPreferences.kt index ec441a0693..a223047639 100644 --- a/lawnchair/src/app/lawnchair/ui/preferences/GeneralPreferences.kt +++ b/lawnchair/src/app/lawnchair/ui/preferences/GeneralPreferences.kt @@ -75,31 +75,29 @@ fun GeneralPreferences() { label = stringResource(id = R.string.font_label) ) } - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - val wrapAdaptiveIcons = prefs.wrapAdaptiveIcons.getAdapter() - PreferenceGroup( - heading = stringResource(id = R.string.auto_adaptive_icons_label), - description = stringResource(id = (R.string.adaptive_icon_background_description)), - showDescription = wrapAdaptiveIcons.state.value + val wrapAdaptiveIcons = prefs.wrapAdaptiveIcons.getAdapter() + PreferenceGroup( + heading = stringResource(id = R.string.auto_adaptive_icons_label), + description = stringResource(id = (R.string.adaptive_icon_background_description)), + showDescription = wrapAdaptiveIcons.state.value + ) { + SwitchPreference( + adapter = wrapAdaptiveIcons, + label = stringResource(id = R.string.auto_adaptive_icons_label), + description = stringResource(id = R.string.auto_adaptive_icons_description), + ) + AnimatedVisibility( + visible = wrapAdaptiveIcons.state.value, + enter = expandVertically() + fadeIn(), + exit = shrinkVertically() + fadeOut() ) { - SwitchPreference( - adapter = wrapAdaptiveIcons, - label = stringResource(id = R.string.auto_adaptive_icons_label), - description = stringResource(id = R.string.auto_adaptive_icons_description), + SliderPreference( + label = stringResource(id = R.string.background_lightness_label), + adapter = prefs.coloredBackgroundLightness.getAdapter(), + valueRange = 0F..1F, + step = 0.1f, + showAsPercentage = true ) - AnimatedVisibility( - visible = wrapAdaptiveIcons.state.value, - enter = expandVertically() + fadeIn(), - exit = shrinkVertically() + fadeOut() - ) { - SliderPreference( - label = stringResource(id = R.string.background_lightness_label), - adapter = prefs.coloredBackgroundLightness.getAdapter(), - valueRange = 0F..1F, - step = 0.1f, - showAsPercentage = true - ) - } } } }