Added AMOLED dark mode setting
Reverted lazy column back to column due to stutter
This commit is contained in:
1 parent
48a730e4a9
commit
5fd233e790
13 files changed
+341
-212
No files matched your search
@@ -6,6 +6,7 @@ package com.anthonyla.paperize.core
|
|||||||
object SettingsConstants {
|
object SettingsConstants {
|
||||||
const val SETTINGS_DATASTORE = "settings_datastore"
|
const val SETTINGS_DATASTORE = "settings_datastore"
|
||||||
const val DARK_MODE_TYPE = "dark_mode_type"
|
const val DARK_MODE_TYPE = "dark_mode_type"
|
||||||
|
const val AMOLED_THEME_TYPE = "amoled_theme_type"
|
||||||
const val DYNAMIC_THEME_TYPE = "dynamic_theme_type"
|
const val DYNAMIC_THEME_TYPE = "dynamic_theme_type"
|
||||||
const val ANIMATE_TYPE = "animate_type"
|
const val ANIMATE_TYPE = "animate_type"
|
||||||
const val ENABLE_CHANGER = "enable_changer"
|
const val ENABLE_CHANGER = "enable_changer"
|
||||||
|
|||||||
+1
-1
@@ -117,7 +117,7 @@ class MainActivity : ComponentActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PaperizeTheme(settingsState.value.darkMode, settingsState.value.dynamicTheming) {
|
PaperizeTheme(settingsState.value.darkMode, settingsState.value.amoledTheme, settingsState.value.dynamicTheming) {
|
||||||
Surface(tonalElevation = 5.dp) {
|
Surface(tonalElevation = 5.dp) {
|
||||||
PaperizeApp(isFirstLaunch, scheduler, topInset)
|
PaperizeApp(isFirstLaunch, scheduler, topInset)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -707,6 +707,9 @@ fun PaperizeApp(
|
|||||||
onDarkModeClick = {
|
onDarkModeClick = {
|
||||||
settingsViewModel.onEvent(SettingsEvent.SetDarkMode(it))
|
settingsViewModel.onEvent(SettingsEvent.SetDarkMode(it))
|
||||||
},
|
},
|
||||||
|
onAmoledClick = {
|
||||||
|
settingsViewModel.onEvent(SettingsEvent.SetAmoledTheme(it))
|
||||||
|
},
|
||||||
onDynamicThemingClick = {
|
onDynamicThemingClick = {
|
||||||
settingsViewModel.onEvent(SettingsEvent.SetDynamicTheming(it))
|
settingsViewModel.onEvent(SettingsEvent.SetDynamicTheming(it))
|
||||||
},
|
},
|
||||||
|
|||||||
+1
@@ -9,6 +9,7 @@ sealed class SettingsEvent {
|
|||||||
data object SetFirstLaunch: SettingsEvent()
|
data object SetFirstLaunch: SettingsEvent()
|
||||||
data object RefreshNextSetTime: SettingsEvent()
|
data object RefreshNextSetTime: SettingsEvent()
|
||||||
data class SetDarkMode(val darkMode: Boolean?): SettingsEvent()
|
data class SetDarkMode(val darkMode: Boolean?): SettingsEvent()
|
||||||
|
data class SetAmoledTheme(val amoledTheme: Boolean): SettingsEvent()
|
||||||
data class SetDynamicTheming(val dynamicTheming: Boolean): SettingsEvent()
|
data class SetDynamicTheming(val dynamicTheming: Boolean): SettingsEvent()
|
||||||
data class SetAnimate(val animate: Boolean): SettingsEvent()
|
data class SetAnimate(val animate: Boolean): SettingsEvent()
|
||||||
data class SetDarken(val darken: Boolean): SettingsEvent()
|
data class SetDarken(val darken: Boolean): SettingsEvent()
|
||||||
|
|||||||
+3
-1
@@ -22,6 +22,7 @@ fun SettingsScreen(
|
|||||||
topInsets: Dp,
|
topInsets: Dp,
|
||||||
onBackClick: () -> Unit,
|
onBackClick: () -> Unit,
|
||||||
onDarkModeClick: (Boolean?) -> Unit,
|
onDarkModeClick: (Boolean?) -> Unit,
|
||||||
|
onAmoledClick: (Boolean) -> Unit,
|
||||||
onDynamicThemingClick: (Boolean) -> Unit,
|
onDynamicThemingClick: (Boolean) -> Unit,
|
||||||
onAnimateClick: (Boolean) -> Unit,
|
onAnimateClick: (Boolean) -> Unit,
|
||||||
onPrivacyClick: () -> Unit,
|
onPrivacyClick: () -> Unit,
|
||||||
@@ -39,12 +40,13 @@ fun SettingsScreen(
|
|||||||
largeTopAppBarHeightPx = largeTopAppBarHeight,
|
largeTopAppBarHeightPx = largeTopAppBarHeight,
|
||||||
scroll = scroll,
|
scroll = scroll,
|
||||||
onDarkModeClick = onDarkModeClick,
|
onDarkModeClick = onDarkModeClick,
|
||||||
|
onAmoledClick = onAmoledClick,
|
||||||
onDynamicThemingClick = onDynamicThemingClick,
|
onDynamicThemingClick = onDynamicThemingClick,
|
||||||
onAnimateClick = onAnimateClick,
|
onAnimateClick = onAnimateClick,
|
||||||
onPrivacyClick = onPrivacyClick,
|
onPrivacyClick = onPrivacyClick,
|
||||||
onLicenseClick = onLicenseClick,
|
onLicenseClick = onLicenseClick,
|
||||||
onResetClick = onResetClick,
|
onResetClick = onResetClick,
|
||||||
onBackClick = onBackClick,
|
onBackClick = onBackClick
|
||||||
)
|
)
|
||||||
SettingsTitle(
|
SettingsTitle(
|
||||||
scroll = scroll,
|
scroll = scroll,
|
||||||
|
|||||||
+1
@@ -6,6 +6,7 @@ data class SettingsState(
|
|||||||
val firstLaunch: Boolean = true,
|
val firstLaunch: Boolean = true,
|
||||||
// App settings
|
// App settings
|
||||||
val darkMode: Boolean? = null,
|
val darkMode: Boolean? = null,
|
||||||
|
val amoledTheme: Boolean = false,
|
||||||
val dynamicTheming: Boolean = false,
|
val dynamicTheming: Boolean = false,
|
||||||
val animate: Boolean = true,
|
val animate: Boolean = true,
|
||||||
// Wallpaper settings
|
// Wallpaper settings
|
||||||
|
|||||||
+25
@@ -36,6 +36,7 @@ class SettingsViewModel @Inject constructor (
|
|||||||
currentGetJob = viewModelScope.launch(Dispatchers.IO) {
|
currentGetJob = viewModelScope.launch(Dispatchers.IO) {
|
||||||
val firstLaunch = async { settingsDataStoreImpl.getBoolean(SettingsConstants.FIRST_LAUNCH) ?: true }
|
val firstLaunch = async { settingsDataStoreImpl.getBoolean(SettingsConstants.FIRST_LAUNCH) ?: true }
|
||||||
val darkMode = async { settingsDataStoreImpl.getBoolean(SettingsConstants.DARK_MODE_TYPE) }
|
val darkMode = async { settingsDataStoreImpl.getBoolean(SettingsConstants.DARK_MODE_TYPE) }
|
||||||
|
val amoledTheme = async { settingsDataStoreImpl.getBoolean(SettingsConstants.AMOLED_THEME_TYPE) ?: false }
|
||||||
val dynamicTheming = async { settingsDataStoreImpl.getBoolean(SettingsConstants.DYNAMIC_THEME_TYPE) ?: false }
|
val dynamicTheming = async { settingsDataStoreImpl.getBoolean(SettingsConstants.DYNAMIC_THEME_TYPE) ?: false }
|
||||||
val enableChanger = async { settingsDataStoreImpl.getBoolean(SettingsConstants.ENABLE_CHANGER) ?: true }
|
val enableChanger = async { settingsDataStoreImpl.getBoolean(SettingsConstants.ENABLE_CHANGER) ?: true }
|
||||||
val setHomeWallpaper = async { settingsDataStoreImpl.getBoolean(SettingsConstants.HOME_WALLPAPER) ?: false }
|
val setHomeWallpaper = async { settingsDataStoreImpl.getBoolean(SettingsConstants.HOME_WALLPAPER) ?: false }
|
||||||
@@ -55,6 +56,7 @@ class SettingsViewModel @Inject constructor (
|
|||||||
_state.update {
|
_state.update {
|
||||||
it.copy(
|
it.copy(
|
||||||
darkMode = darkMode.await(),
|
darkMode = darkMode.await(),
|
||||||
|
amoledTheme = amoledTheme.await(),
|
||||||
dynamicTheming = dynamicTheming.await(),
|
dynamicTheming = dynamicTheming.await(),
|
||||||
homeInterval = homeWallpaperInterval.await(),
|
homeInterval = homeWallpaperInterval.await(),
|
||||||
lockInterval = lockWallpaperInterval.await(),
|
lockInterval = lockWallpaperInterval.await(),
|
||||||
@@ -104,6 +106,7 @@ class SettingsViewModel @Inject constructor (
|
|||||||
is SettingsEvent.Refresh -> {
|
is SettingsEvent.Refresh -> {
|
||||||
currentGetJob = viewModelScope.launch(Dispatchers.IO) {
|
currentGetJob = viewModelScope.launch(Dispatchers.IO) {
|
||||||
val darkMode = async { settingsDataStoreImpl.getBoolean(SettingsConstants.DARK_MODE_TYPE) }
|
val darkMode = async { settingsDataStoreImpl.getBoolean(SettingsConstants.DARK_MODE_TYPE) }
|
||||||
|
val amoledTheme = async { settingsDataStoreImpl.getBoolean(SettingsConstants.AMOLED_THEME_TYPE) ?: false }
|
||||||
val dynamicTheming = async { settingsDataStoreImpl.getBoolean(SettingsConstants.DYNAMIC_THEME_TYPE) ?: false }
|
val dynamicTheming = async { settingsDataStoreImpl.getBoolean(SettingsConstants.DYNAMIC_THEME_TYPE) ?: false }
|
||||||
val firstLaunch = async { settingsDataStoreImpl.getBoolean(SettingsConstants.FIRST_LAUNCH) ?: true }
|
val firstLaunch = async { settingsDataStoreImpl.getBoolean(SettingsConstants.FIRST_LAUNCH) ?: true }
|
||||||
val lastSetTime = async { settingsDataStoreImpl.getString(SettingsConstants.LAST_SET_TIME) }
|
val lastSetTime = async { settingsDataStoreImpl.getString(SettingsConstants.LAST_SET_TIME) }
|
||||||
@@ -122,6 +125,7 @@ class SettingsViewModel @Inject constructor (
|
|||||||
_state.update {
|
_state.update {
|
||||||
it.copy(
|
it.copy(
|
||||||
darkMode = darkMode.await(),
|
darkMode = darkMode.await(),
|
||||||
|
amoledTheme = amoledTheme.await(),
|
||||||
dynamicTheming = dynamicTheming.await(),
|
dynamicTheming = dynamicTheming.await(),
|
||||||
firstLaunch = firstLaunch.await(),
|
firstLaunch = firstLaunch.await(),
|
||||||
lastSetTime = lastSetTime.await(),
|
lastSetTime = lastSetTime.await(),
|
||||||
@@ -157,11 +161,30 @@ class SettingsViewModel @Inject constructor (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
is SettingsEvent.SetAmoledTheme -> {
|
||||||
|
viewModelScope.launch(Dispatchers.IO) {
|
||||||
|
settingsDataStoreImpl.putBoolean(SettingsConstants.AMOLED_THEME_TYPE, event.amoledTheme)
|
||||||
|
if (event.amoledTheme) {
|
||||||
|
settingsDataStoreImpl.putBoolean(SettingsConstants.DYNAMIC_THEME_TYPE, false)
|
||||||
|
}
|
||||||
|
_state.update {
|
||||||
|
it.copy(
|
||||||
|
amoledTheme = event.amoledTheme,
|
||||||
|
dynamicTheming = if (event.amoledTheme) false else it.dynamicTheming
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
is SettingsEvent.SetDynamicTheming -> {
|
is SettingsEvent.SetDynamicTheming -> {
|
||||||
viewModelScope.launch(Dispatchers.IO) {
|
viewModelScope.launch(Dispatchers.IO) {
|
||||||
settingsDataStoreImpl.putBoolean(SettingsConstants.DYNAMIC_THEME_TYPE, event.dynamicTheming)
|
settingsDataStoreImpl.putBoolean(SettingsConstants.DYNAMIC_THEME_TYPE, event.dynamicTheming)
|
||||||
|
if (event.dynamicTheming) {
|
||||||
|
settingsDataStoreImpl.putBoolean(SettingsConstants.AMOLED_THEME_TYPE, false)
|
||||||
|
}
|
||||||
_state.update {
|
_state.update {
|
||||||
it.copy(
|
it.copy(
|
||||||
|
amoledTheme = if (event.dynamicTheming) false else it.amoledTheme,
|
||||||
dynamicTheming = event.dynamicTheming
|
dynamicTheming = event.dynamicTheming
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -354,6 +377,7 @@ class SettingsViewModel @Inject constructor (
|
|||||||
is SettingsEvent.Reset -> {
|
is SettingsEvent.Reset -> {
|
||||||
viewModelScope.launch(Dispatchers.IO) {
|
viewModelScope.launch(Dispatchers.IO) {
|
||||||
settingsDataStoreImpl.deleteBoolean(SettingsConstants.DARK_MODE_TYPE)
|
settingsDataStoreImpl.deleteBoolean(SettingsConstants.DARK_MODE_TYPE)
|
||||||
|
settingsDataStoreImpl.deleteBoolean(SettingsConstants.AMOLED_THEME_TYPE)
|
||||||
settingsDataStoreImpl.deleteBoolean(SettingsConstants.DYNAMIC_THEME_TYPE)
|
settingsDataStoreImpl.deleteBoolean(SettingsConstants.DYNAMIC_THEME_TYPE)
|
||||||
settingsDataStoreImpl.deleteBoolean(SettingsConstants.FIRST_LAUNCH)
|
settingsDataStoreImpl.deleteBoolean(SettingsConstants.FIRST_LAUNCH)
|
||||||
settingsDataStoreImpl.deleteString(SettingsConstants.LAST_SET_TIME)
|
settingsDataStoreImpl.deleteString(SettingsConstants.LAST_SET_TIME)
|
||||||
@@ -377,6 +401,7 @@ class SettingsViewModel @Inject constructor (
|
|||||||
_state.update {
|
_state.update {
|
||||||
it.copy(
|
it.copy(
|
||||||
darkMode = null,
|
darkMode = null,
|
||||||
|
amoledTheme = false,
|
||||||
dynamicTheming = false,
|
dynamicTheming = false,
|
||||||
firstLaunch = true,
|
firstLaunch = true,
|
||||||
lastSetTime = null,
|
lastSetTime = null,
|
||||||
|
|||||||
+61
@@ -0,0 +1,61 @@
|
|||||||
|
package com.anthonyla.paperize.feature.wallpaper.presentation.settings_screen.components
|
||||||
|
|
||||||
|
import androidx.compose.foundation.clickable
|
||||||
|
import androidx.compose.foundation.layout.Row
|
||||||
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
|
import androidx.compose.material.icons.Icons
|
||||||
|
import androidx.compose.material.icons.filled.DarkMode
|
||||||
|
import androidx.compose.material3.Icon
|
||||||
|
import androidx.compose.material3.ListItem
|
||||||
|
import androidx.compose.material3.MaterialTheme
|
||||||
|
import androidx.compose.material3.Switch
|
||||||
|
import androidx.compose.material3.Text
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.draw.clip
|
||||||
|
import androidx.compose.ui.platform.LocalContext
|
||||||
|
import androidx.compose.ui.res.stringResource
|
||||||
|
import androidx.compose.ui.semantics.contentDescription
|
||||||
|
import androidx.compose.ui.semantics.semantics
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
|
import com.anthonyla.paperize.R
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AMOLED list item to enable AMOLED mode
|
||||||
|
*/
|
||||||
|
@Composable
|
||||||
|
fun AmoledListItem(amoledMode: Boolean, onAmoledClick: (Boolean) -> Unit) {
|
||||||
|
val context = LocalContext.current
|
||||||
|
Row {
|
||||||
|
ListItem(
|
||||||
|
modifier = Modifier
|
||||||
|
.clip(RoundedCornerShape(16.dp))
|
||||||
|
.clickable { onAmoledClick(!amoledMode) },
|
||||||
|
headlineContent = {
|
||||||
|
Text(
|
||||||
|
text = stringResource(R.string.amoled_mode),
|
||||||
|
style = MaterialTheme.typography.titleMedium
|
||||||
|
|
||||||
|
) },
|
||||||
|
supportingContent = {
|
||||||
|
Text(
|
||||||
|
text = stringResource(R.string.full_dark_mode),
|
||||||
|
style = MaterialTheme.typography.bodySmall
|
||||||
|
) },
|
||||||
|
trailingContent = {
|
||||||
|
Switch(
|
||||||
|
modifier = Modifier.semantics { contentDescription = context.getString(R.string.amoled_mode) },
|
||||||
|
checked = amoledMode,
|
||||||
|
onCheckedChange = onAmoledClick,
|
||||||
|
enabled = true
|
||||||
|
) },
|
||||||
|
leadingContent = {
|
||||||
|
Icon(
|
||||||
|
Icons.Filled.DarkMode,
|
||||||
|
contentDescription = stringResource(R.string.amoled_mode),
|
||||||
|
tint = MaterialTheme.colorScheme.primary
|
||||||
|
) },
|
||||||
|
tonalElevation = 5.dp
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
-3
@@ -15,7 +15,6 @@ import androidx.compose.material.icons.outlined.Brightness6
|
|||||||
import androidx.compose.material.icons.outlined.BrightnessAuto
|
import androidx.compose.material.icons.outlined.BrightnessAuto
|
||||||
import androidx.compose.material.icons.outlined.DarkMode
|
import androidx.compose.material.icons.outlined.DarkMode
|
||||||
import androidx.compose.material.icons.outlined.LightMode
|
import androidx.compose.material.icons.outlined.LightMode
|
||||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
|
||||||
import androidx.compose.material3.Icon
|
import androidx.compose.material3.Icon
|
||||||
import androidx.compose.material3.ListItem
|
import androidx.compose.material3.ListItem
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
@@ -38,7 +37,6 @@ import com.anthonyla.paperize.R
|
|||||||
/**
|
/**
|
||||||
* Three-state selector for dark mode in settings
|
* Three-state selector for dark mode in settings
|
||||||
*/
|
*/
|
||||||
@OptIn(ExperimentalMaterial3Api::class)
|
|
||||||
@Composable
|
@Composable
|
||||||
fun DarkModeListItem(darkMode: Boolean?, onDarkModeClick: (Boolean?) -> Unit) {
|
fun DarkModeListItem(darkMode: Boolean?, onDarkModeClick: (Boolean?) -> Unit) {
|
||||||
val options = listOf(
|
val options = listOf(
|
||||||
@@ -77,7 +75,7 @@ fun DarkModeListItem(darkMode: Boolean?, onDarkModeClick: (Boolean?) -> Unit) {
|
|||||||
},
|
},
|
||||||
headlineContent = {
|
headlineContent = {
|
||||||
Text(
|
Text(
|
||||||
text = stringResource(R.string.dark_mode),
|
text = stringResource(R.string.theme),
|
||||||
style = MaterialTheme.typography.titleMedium
|
style = MaterialTheme.typography.titleMedium
|
||||||
|
|
||||||
) },
|
) },
|
||||||
|
|||||||
+12
-3
@@ -1,5 +1,6 @@
|
|||||||
package com.anthonyla.paperize.feature.wallpaper.presentation.settings_screen.components
|
package com.anthonyla.paperize.feature.wallpaper.presentation.settings_screen.components
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import androidx.compose.foundation.ScrollState
|
import androidx.compose.foundation.ScrollState
|
||||||
@@ -47,6 +48,7 @@ import kotlinx.coroutines.launch
|
|||||||
/**
|
/**
|
||||||
* Scrollable settings screen to wrap all settings components
|
* Scrollable settings screen to wrap all settings components
|
||||||
*/
|
*/
|
||||||
|
@SuppressLint("UnusedMaterial3ScaffoldPaddingParameter")
|
||||||
@OptIn(ExperimentalMaterial3Api::class)
|
@OptIn(ExperimentalMaterial3Api::class)
|
||||||
@Composable
|
@Composable
|
||||||
fun SettingsScrollableSettings(
|
fun SettingsScrollableSettings(
|
||||||
@@ -55,11 +57,12 @@ fun SettingsScrollableSettings(
|
|||||||
scroll: ScrollState,
|
scroll: ScrollState,
|
||||||
onDynamicThemingClick: (Boolean) -> Unit,
|
onDynamicThemingClick: (Boolean) -> Unit,
|
||||||
onDarkModeClick: (Boolean?) -> Unit,
|
onDarkModeClick: (Boolean?) -> Unit,
|
||||||
|
onAmoledClick: (Boolean) -> Unit,
|
||||||
onAnimateClick: (Boolean) -> Unit,
|
onAnimateClick: (Boolean) -> Unit,
|
||||||
onPrivacyClick: () -> Unit,
|
onPrivacyClick: () -> Unit,
|
||||||
onLicenseClick: () -> Unit,
|
onLicenseClick: () -> Unit,
|
||||||
onResetClick: () -> Unit,
|
onResetClick: () -> Unit,
|
||||||
onBackClick: () -> Unit
|
onBackClick: () -> Unit,
|
||||||
) {
|
) {
|
||||||
val state = settingsState.collectAsStateWithLifecycle()
|
val state = settingsState.collectAsStateWithLifecycle()
|
||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
@@ -108,7 +111,7 @@ fun SettingsScrollableSettings(
|
|||||||
)
|
)
|
||||||
},
|
},
|
||||||
modifier = Modifier.fillMaxSize(),
|
modifier = Modifier.fillMaxSize(),
|
||||||
content = { it
|
content = {
|
||||||
Column(
|
Column(
|
||||||
horizontalAlignment = Alignment.Start,
|
horizontalAlignment = Alignment.Start,
|
||||||
verticalArrangement = Arrangement.Top,
|
verticalArrangement = Arrangement.Top,
|
||||||
@@ -127,11 +130,17 @@ fun SettingsScrollableSettings(
|
|||||||
onDarkModeClick = { onDarkModeClick(it) }
|
onDarkModeClick = { onDarkModeClick(it) }
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.height(16.dp))
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
|
if (state.value.darkMode == null || state.value.darkMode == true) {
|
||||||
|
AmoledListItem(
|
||||||
|
amoledMode = state.value.amoledTheme,
|
||||||
|
onAmoledClick = { onAmoledClick(it) }
|
||||||
|
)
|
||||||
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
|
}
|
||||||
DynamicThemingListItem(
|
DynamicThemingListItem(
|
||||||
dynamicTheming = state.value.dynamicTheming,
|
dynamicTheming = state.value.dynamicTheming,
|
||||||
onDynamicThemingClick = { onDynamicThemingClick(it) }
|
onDynamicThemingClick = { onDynamicThemingClick(it) }
|
||||||
)
|
)
|
||||||
|
|
||||||
Spacer(modifier = Modifier.height(16.dp))
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
AnimationListItem(
|
AnimationListItem(
|
||||||
animate = state.value.animate,
|
animate = state.value.animate,
|
||||||
|
|||||||
+36
-1
@@ -10,6 +10,7 @@ import androidx.compose.material3.dynamicLightColorScheme
|
|||||||
import androidx.compose.material3.lightColorScheme
|
import androidx.compose.material3.lightColorScheme
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.SideEffect
|
import androidx.compose.runtime.SideEffect
|
||||||
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.platform.LocalView
|
import androidx.compose.ui.platform.LocalView
|
||||||
import androidx.core.view.WindowCompat
|
import androidx.core.view.WindowCompat
|
||||||
@@ -80,6 +81,38 @@ private val DarkColors = darkColorScheme(
|
|||||||
scrim = md_theme_dark_scrim,
|
scrim = md_theme_dark_scrim,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
private val AmoledDarkColors = darkColorScheme(
|
||||||
|
primary = md_theme_light_primary,
|
||||||
|
onPrimary = md_theme_light_onPrimary,
|
||||||
|
primaryContainer = md_theme_light_primaryContainer,
|
||||||
|
onPrimaryContainer = md_theme_light_onPrimaryContainer,
|
||||||
|
secondary = Color.Black,
|
||||||
|
onSecondary = Color.White,
|
||||||
|
secondaryContainer = Color.Black,
|
||||||
|
onSecondaryContainer = Color.White,
|
||||||
|
tertiary = md_theme_light_tertiary,
|
||||||
|
onTertiary = md_theme_light_onTertiary,
|
||||||
|
tertiaryContainer = Color.Black,
|
||||||
|
onTertiaryContainer = Color.White,
|
||||||
|
error = Color.Red,
|
||||||
|
errorContainer = Color.Black,
|
||||||
|
onError = Color.White,
|
||||||
|
onErrorContainer = Color.Black,
|
||||||
|
background = Color.Black,
|
||||||
|
onBackground = Color.White,
|
||||||
|
surface = Color.Black,
|
||||||
|
onSurface = Color.White,
|
||||||
|
surfaceVariant = Color.Black,
|
||||||
|
onSurfaceVariant = Color.White,
|
||||||
|
outline = Color.White,
|
||||||
|
inverseOnSurface = Color.Black,
|
||||||
|
inverseSurface = Color.White,
|
||||||
|
inversePrimary = Color.White,
|
||||||
|
surfaceTint = Color.Black,
|
||||||
|
outlineVariant = md_theme_dark_outlineVariant,
|
||||||
|
scrim = md_theme_dark_scrim,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* App theming for dynamic theming when supported and dark mode.
|
* App theming for dynamic theming when supported and dark mode.
|
||||||
@@ -87,6 +120,7 @@ private val DarkColors = darkColorScheme(
|
|||||||
@Composable
|
@Composable
|
||||||
fun PaperizeTheme(
|
fun PaperizeTheme(
|
||||||
darkMode: Boolean?,
|
darkMode: Boolean?,
|
||||||
|
amoledMode: Boolean,
|
||||||
dynamicTheming: Boolean,
|
dynamicTheming: Boolean,
|
||||||
content: @Composable () -> Unit
|
content: @Composable () -> Unit
|
||||||
) {
|
) {
|
||||||
@@ -97,7 +131,8 @@ fun PaperizeTheme(
|
|||||||
val colors = when {
|
val colors = when {
|
||||||
isDynamicTheming && dynamicThemingSupported && isDarkMode -> dynamicDarkColorScheme(context)
|
isDynamicTheming && dynamicThemingSupported && isDarkMode -> dynamicDarkColorScheme(context)
|
||||||
isDynamicTheming && dynamicThemingSupported && !isDarkMode -> dynamicLightColorScheme(context)
|
isDynamicTheming && dynamicThemingSupported && !isDarkMode -> dynamicLightColorScheme(context)
|
||||||
isDarkMode -> DarkColors
|
isDarkMode && amoledMode -> AmoledDarkColors
|
||||||
|
isDarkMode && !amoledMode -> DarkColors
|
||||||
else -> LightColors
|
else -> LightColors
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+193
-203
@@ -9,11 +9,13 @@ import android.provider.Settings
|
|||||||
import androidx.compose.animation.AnimatedVisibility
|
import androidx.compose.animation.AnimatedVisibility
|
||||||
import androidx.compose.animation.fadeOut
|
import androidx.compose.animation.fadeOut
|
||||||
import androidx.compose.animation.slideInVertically
|
import androidx.compose.animation.slideInVertically
|
||||||
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.PaddingValues
|
import androidx.compose.foundation.layout.PaddingValues
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.lazy.LazyColumn
|
import androidx.compose.foundation.rememberScrollState
|
||||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
|
import androidx.compose.foundation.verticalScroll
|
||||||
import androidx.compose.material3.Scaffold
|
import androidx.compose.material3.Scaffold
|
||||||
import androidx.compose.material3.Snackbar
|
import androidx.compose.material3.Snackbar
|
||||||
import androidx.compose.material3.SnackbarDuration
|
import androidx.compose.material3.SnackbarDuration
|
||||||
@@ -80,6 +82,7 @@ fun WallpaperScreen(
|
|||||||
onBlurChange: (Boolean) -> Unit,
|
onBlurChange: (Boolean) -> Unit,
|
||||||
blurPercentage: Int
|
blurPercentage: Int
|
||||||
) {
|
) {
|
||||||
|
val scrollState = rememberScrollState()
|
||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
var openBottomSheet by rememberSaveable { mutableStateOf(false) }
|
var openBottomSheet by rememberSaveable { mutableStateOf(false) }
|
||||||
val scope = rememberCoroutineScope()
|
val scope = rememberCoroutineScope()
|
||||||
@@ -107,124 +110,100 @@ fun WallpaperScreen(
|
|||||||
) },
|
) },
|
||||||
modifier = Modifier.fillMaxSize(),
|
modifier = Modifier.fillMaxSize(),
|
||||||
content = { padding ->
|
content = { padding ->
|
||||||
LazyColumn(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
|
.verticalScroll(scrollState)
|
||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
.padding(8.dp),
|
.padding(8.dp),
|
||||||
horizontalAlignment = Alignment.CenterHorizontally
|
horizontalAlignment = Alignment.CenterHorizontally
|
||||||
) {
|
) {
|
||||||
item {
|
ChangerSelectionRow(
|
||||||
ChangerSelectionRow(
|
homeEnabled = homeEnabled,
|
||||||
homeEnabled = homeEnabled,
|
lockEnabled = lockEnabled,
|
||||||
lockEnabled = lockEnabled,
|
onHomeCheckedChange = onHomeCheckedChange,
|
||||||
onHomeCheckedChange = onHomeCheckedChange,
|
onLockCheckedChange = onLockCheckedChange
|
||||||
onLockCheckedChange = onLockCheckedChange
|
)
|
||||||
|
if (homeEnabled || lockEnabled) {
|
||||||
|
CurrentSelectedAlbum(
|
||||||
|
selectedAlbum = selectedAlbum,
|
||||||
|
onOpenBottomSheet = {
|
||||||
|
if (albums.firstOrNull() != null) {
|
||||||
|
if (isLiveWallpaperSet(context)) {
|
||||||
|
openLiveDialog.value = true
|
||||||
|
} else {
|
||||||
|
openBottomSheet = true
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
scope.launch {
|
||||||
|
snackbarHostState.currentSnackbarData?.dismiss()
|
||||||
|
snackbarHostState.showSnackbar(
|
||||||
|
message = context.getString(R.string.no_albums_found),
|
||||||
|
actionLabel = context.getString(R.string.dismiss),
|
||||||
|
duration = SnackbarDuration.Short
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onStop = {
|
||||||
|
if (selectedAlbum != null) {
|
||||||
|
scope.launch {
|
||||||
|
snackbarHostState.currentSnackbarData?.dismiss()
|
||||||
|
snackbarHostState.showSnackbar(
|
||||||
|
message = context.getString(
|
||||||
|
R.string.has_been_unselected,
|
||||||
|
selectedAlbum.album.displayedAlbumName
|
||||||
|
),
|
||||||
|
actionLabel = context.getString(R.string.dismiss),
|
||||||
|
duration = SnackbarDuration.Short
|
||||||
|
)
|
||||||
|
}
|
||||||
|
onStop()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
animate = animate,
|
||||||
|
enableChanger = enableChanger,
|
||||||
|
onToggleChanger = {
|
||||||
|
if (!it) {
|
||||||
|
scope.launch {
|
||||||
|
snackbarHostState.currentSnackbarData?.dismiss()
|
||||||
|
snackbarHostState.showSnackbar(
|
||||||
|
message = context.getString(R.string.wallpaper_changer_has_been_disabled),
|
||||||
|
actionLabel = context.getString(R.string.dismiss),
|
||||||
|
duration = SnackbarDuration.Short
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onToggleChanger(it)
|
||||||
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
item {
|
if (animate) {
|
||||||
if (homeEnabled || lockEnabled) {
|
AnimatedVisibility(
|
||||||
CurrentSelectedAlbum(
|
visible = ((homeEnabled || lockEnabled)) && selectedAlbum != null,
|
||||||
selectedAlbum = selectedAlbum,
|
enter = slideInVertically(initialOffsetY = { -it }),
|
||||||
onOpenBottomSheet = {
|
exit = fadeOut()
|
||||||
if (albums.firstOrNull() != null) {
|
) {
|
||||||
if (isLiveWallpaperSet(context)) {
|
|
||||||
openLiveDialog.value = true
|
|
||||||
} else {
|
|
||||||
openBottomSheet = true
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
scope.launch {
|
|
||||||
snackbarHostState.currentSnackbarData?.dismiss()
|
|
||||||
snackbarHostState.showSnackbar(
|
|
||||||
message = context.getString(R.string.no_albums_found),
|
|
||||||
actionLabel = context.getString(R.string.dismiss),
|
|
||||||
duration = SnackbarDuration.Short
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onStop = {
|
|
||||||
if (selectedAlbum != null) {
|
|
||||||
scope.launch {
|
|
||||||
snackbarHostState.currentSnackbarData?.dismiss()
|
|
||||||
snackbarHostState.showSnackbar(
|
|
||||||
message = context.getString(
|
|
||||||
R.string.has_been_unselected,
|
|
||||||
selectedAlbum.album.displayedAlbumName
|
|
||||||
),
|
|
||||||
actionLabel = context.getString(R.string.dismiss),
|
|
||||||
duration = SnackbarDuration.Short
|
|
||||||
)
|
|
||||||
}
|
|
||||||
onStop()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
animate = animate,
|
|
||||||
enableChanger = enableChanger,
|
|
||||||
onToggleChanger = {
|
|
||||||
if (!it) {
|
|
||||||
scope.launch {
|
|
||||||
snackbarHostState.currentSnackbarData?.dismiss()
|
|
||||||
snackbarHostState.showSnackbar(
|
|
||||||
message = context.getString(R.string.wallpaper_changer_has_been_disabled),
|
|
||||||
actionLabel = context.getString(R.string.dismiss),
|
|
||||||
duration = SnackbarDuration.Short
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onToggleChanger(it)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
item {
|
|
||||||
if (animate) {
|
|
||||||
AnimatedVisibility(
|
|
||||||
visible = ((homeEnabled || lockEnabled)) && selectedAlbum != null,
|
|
||||||
enter = slideInVertically(initialOffsetY = { -it }),
|
|
||||||
exit = fadeOut()
|
|
||||||
) {
|
|
||||||
if (((homeEnabled || lockEnabled)) && selectedAlbum != null) {
|
|
||||||
CurrentAndNextChange(lastSetTime, nextSetTime)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (((homeEnabled || lockEnabled)) && selectedAlbum != null) {
|
if (((homeEnabled || lockEnabled)) && selectedAlbum != null) {
|
||||||
CurrentAndNextChange(lastSetTime, nextSetTime)
|
CurrentAndNextChange(lastSetTime, nextSetTime)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
item {
|
else {
|
||||||
if (animate) {
|
if (((homeEnabled || lockEnabled)) && selectedAlbum != null) {
|
||||||
AnimatedVisibility(
|
CurrentAndNextChange(lastSetTime, nextSetTime)
|
||||||
visible = ((homeEnabled || lockEnabled)) && selectedAlbum != null,
|
|
||||||
enter = slideInVertically(initialOffsetY = { -it }),
|
|
||||||
exit = fadeOut()
|
|
||||||
) {
|
|
||||||
if (((homeEnabled || lockEnabled)) && selectedAlbum != null) {
|
|
||||||
WallpaperPreviewAndScale(
|
|
||||||
currentHomeWallpaper = selectedAlbum.album.currentHomeWallpaper,
|
|
||||||
currentLockWallpaper = selectedAlbum.album.currentLockWallpaper,
|
|
||||||
animate = true,
|
|
||||||
darken = darken,
|
|
||||||
darkenPercentage = darkenPercentage,
|
|
||||||
scaling = scaling,
|
|
||||||
onScalingChange = onScalingChange,
|
|
||||||
homeEnabled = homeEnabled,
|
|
||||||
lockEnabled = lockEnabled,
|
|
||||||
blur = blur,
|
|
||||||
blurPercentage = blurPercentage
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
}
|
||||||
|
if (animate) {
|
||||||
|
AnimatedVisibility(
|
||||||
|
visible = ((homeEnabled || lockEnabled)) && selectedAlbum != null,
|
||||||
|
enter = slideInVertically(initialOffsetY = { -it }),
|
||||||
|
exit = fadeOut()
|
||||||
|
) {
|
||||||
if (((homeEnabled || lockEnabled)) && selectedAlbum != null) {
|
if (((homeEnabled || lockEnabled)) && selectedAlbum != null) {
|
||||||
WallpaperPreviewAndScale(
|
WallpaperPreviewAndScale(
|
||||||
currentHomeWallpaper = selectedAlbum.album.currentHomeWallpaper,
|
currentHomeWallpaper = selectedAlbum.album.currentHomeWallpaper,
|
||||||
currentLockWallpaper = selectedAlbum.album.currentLockWallpaper,
|
currentLockWallpaper = selectedAlbum.album.currentLockWallpaper,
|
||||||
animate = false,
|
animate = true,
|
||||||
darken = darken,
|
darken = darken,
|
||||||
darkenPercentage = darkenPercentage,
|
darkenPercentage = darkenPercentage,
|
||||||
scaling = scaling,
|
scaling = scaling,
|
||||||
@@ -237,112 +216,123 @@ fun WallpaperScreen(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
item {
|
else {
|
||||||
if (animate) {
|
if (((homeEnabled || lockEnabled)) && selectedAlbum != null) {
|
||||||
AnimatedVisibility(
|
WallpaperPreviewAndScale(
|
||||||
visible = ((homeEnabled || lockEnabled)) && selectedAlbum != null,
|
currentHomeWallpaper = selectedAlbum.album.currentHomeWallpaper,
|
||||||
enter = slideInVertically(initialOffsetY = { -it }),
|
currentLockWallpaper = selectedAlbum.album.currentLockWallpaper,
|
||||||
exit = fadeOut()
|
animate = false,
|
||||||
) {
|
darken = darken,
|
||||||
TimeSliders(
|
darkenPercentage = darkenPercentage,
|
||||||
timeInMinutes1 = interval1,
|
scaling = scaling,
|
||||||
timeInMinutes2 = interval2,
|
onScalingChange = onScalingChange,
|
||||||
onTimeChange1 = { days, hours, minutes ->
|
homeEnabled = homeEnabled,
|
||||||
val totalMinutes = 24 * days * 60 + hours * 60 + minutes
|
lockEnabled = lockEnabled,
|
||||||
onTimeChange1(totalMinutes)
|
blur = blur,
|
||||||
},
|
blurPercentage = blurPercentage
|
||||||
onTimeChange2 = { days, hours, minutes ->
|
)
|
||||||
val totalMinutes = 24 * days * 60 + hours * 60 + minutes
|
|
||||||
onTimeChange2(totalMinutes)
|
|
||||||
},
|
|
||||||
showInterval = showInterval.value,
|
|
||||||
animate = true,
|
|
||||||
onShowIntervalChange = { showInterval.value = it },
|
|
||||||
scheduleSeparately = scheduleSeparately,
|
|
||||||
onScheduleSeparatelyChange = onScheduleSeparatelyChange,
|
|
||||||
lockEnabled = lockEnabled,
|
|
||||||
homeEnabled = homeEnabled
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (((homeEnabled || lockEnabled)) && selectedAlbum != null) {
|
|
||||||
TimeSliders(
|
|
||||||
timeInMinutes1 = interval1,
|
|
||||||
timeInMinutes2 = interval2,
|
|
||||||
onTimeChange1 = { days, hours, minutes ->
|
|
||||||
val totalMinutes = 24 * days * 60 + hours * 60 + minutes
|
|
||||||
onScheduleWallpaperChanger1(totalMinutes)
|
|
||||||
},
|
|
||||||
onTimeChange2 = { days, hours, minutes ->
|
|
||||||
val totalMinutes = 24 * days * 60 + hours * 60 + minutes
|
|
||||||
onScheduleWallpaperChanger2(totalMinutes)
|
|
||||||
},
|
|
||||||
showInterval = showInterval.value,
|
|
||||||
animate = false,
|
|
||||||
onShowIntervalChange = { showInterval.value = it },
|
|
||||||
scheduleSeparately = scheduleSeparately,
|
|
||||||
onScheduleSeparatelyChange = onScheduleSeparatelyChange,
|
|
||||||
lockEnabled = lockEnabled,
|
|
||||||
homeEnabled = homeEnabled,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
item {
|
if (animate) {
|
||||||
if (animate) {
|
AnimatedVisibility(
|
||||||
AnimatedVisibility(
|
visible = ((homeEnabled || lockEnabled)) && selectedAlbum != null,
|
||||||
visible = ((homeEnabled || lockEnabled)) && selectedAlbum != null,
|
enter = slideInVertically(initialOffsetY = { -it }),
|
||||||
enter = slideInVertically(initialOffsetY = { -it }),
|
exit = fadeOut()
|
||||||
exit = fadeOut()
|
) {
|
||||||
) {
|
TimeSliders(
|
||||||
DarkenSwitchAndSlider(
|
timeInMinutes1 = interval1,
|
||||||
onDarkCheck = onDarkCheck,
|
timeInMinutes2 = interval2,
|
||||||
darken = darken,
|
onTimeChange1 = { days, hours, minutes ->
|
||||||
onDarkenChange = onDarkenPercentage,
|
val totalMinutes = 24 * days * 60 + hours * 60 + minutes
|
||||||
darkenPercentage = darkenPercentage,
|
onTimeChange1(totalMinutes)
|
||||||
animate = true
|
},
|
||||||
)
|
onTimeChange2 = { days, hours, minutes ->
|
||||||
}
|
val totalMinutes = 24 * days * 60 + hours * 60 + minutes
|
||||||
}
|
onTimeChange2(totalMinutes)
|
||||||
else {
|
},
|
||||||
if (((homeEnabled || lockEnabled)) && selectedAlbum != null) {
|
showInterval = showInterval.value,
|
||||||
DarkenSwitchAndSlider(
|
animate = true,
|
||||||
onDarkCheck = onDarkCheck,
|
onShowIntervalChange = { showInterval.value = it },
|
||||||
darken = darken,
|
scheduleSeparately = scheduleSeparately,
|
||||||
onDarkenChange = onDarkenPercentage,
|
onScheduleSeparatelyChange = onScheduleSeparatelyChange,
|
||||||
darkenPercentage = darkenPercentage,
|
lockEnabled = lockEnabled,
|
||||||
animate = false
|
homeEnabled = homeEnabled
|
||||||
)
|
)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
item {
|
else {
|
||||||
if (animate) {
|
if (((homeEnabled || lockEnabled)) && selectedAlbum != null) {
|
||||||
AnimatedVisibility(
|
TimeSliders(
|
||||||
visible = ((homeEnabled || lockEnabled)) && selectedAlbum != null,
|
timeInMinutes1 = interval1,
|
||||||
enter = slideInVertically(initialOffsetY = { -it }),
|
timeInMinutes2 = interval2,
|
||||||
exit = fadeOut()
|
onTimeChange1 = { days, hours, minutes ->
|
||||||
) {
|
val totalMinutes = 24 * days * 60 + hours * 60 + minutes
|
||||||
BlurSwitchAndSlider(
|
onScheduleWallpaperChanger1(totalMinutes)
|
||||||
onBlurPercentageChange = onBlurPercentageChange,
|
},
|
||||||
onBlurChange = onBlurChange,
|
onTimeChange2 = { days, hours, minutes ->
|
||||||
blur = blur,
|
val totalMinutes = 24 * days * 60 + hours * 60 + minutes
|
||||||
blurPercentage = blurPercentage,
|
onScheduleWallpaperChanger2(totalMinutes)
|
||||||
animate = true
|
},
|
||||||
)
|
showInterval = showInterval.value,
|
||||||
}
|
animate = false,
|
||||||
|
onShowIntervalChange = { showInterval.value = it },
|
||||||
|
scheduleSeparately = scheduleSeparately,
|
||||||
|
onScheduleSeparatelyChange = onScheduleSeparatelyChange,
|
||||||
|
lockEnabled = lockEnabled,
|
||||||
|
homeEnabled = homeEnabled,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
else {
|
}
|
||||||
if (((homeEnabled || lockEnabled)) && selectedAlbum != null) {
|
if (animate) {
|
||||||
BlurSwitchAndSlider(
|
AnimatedVisibility(
|
||||||
onBlurPercentageChange = onBlurPercentageChange,
|
visible = ((homeEnabled || lockEnabled)) && selectedAlbum != null,
|
||||||
onBlurChange = onBlurChange,
|
enter = slideInVertically(initialOffsetY = { -it }),
|
||||||
blur = blur,
|
exit = fadeOut()
|
||||||
blurPercentage = blurPercentage,
|
) {
|
||||||
animate = false
|
DarkenSwitchAndSlider(
|
||||||
)
|
onDarkCheck = onDarkCheck,
|
||||||
}
|
darken = darken,
|
||||||
|
onDarkenChange = onDarkenPercentage,
|
||||||
|
darkenPercentage = darkenPercentage,
|
||||||
|
animate = true
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (((homeEnabled || lockEnabled)) && selectedAlbum != null) {
|
||||||
|
DarkenSwitchAndSlider(
|
||||||
|
onDarkCheck = onDarkCheck,
|
||||||
|
darken = darken,
|
||||||
|
onDarkenChange = onDarkenPercentage,
|
||||||
|
darkenPercentage = darkenPercentage,
|
||||||
|
animate = false
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (animate) {
|
||||||
|
AnimatedVisibility(
|
||||||
|
visible = ((homeEnabled || lockEnabled)) && selectedAlbum != null,
|
||||||
|
enter = slideInVertically(initialOffsetY = { -it }),
|
||||||
|
exit = fadeOut()
|
||||||
|
) {
|
||||||
|
BlurSwitchAndSlider(
|
||||||
|
onBlurPercentageChange = onBlurPercentageChange,
|
||||||
|
onBlurChange = onBlurChange,
|
||||||
|
blur = blur,
|
||||||
|
blurPercentage = blurPercentage,
|
||||||
|
animate = true
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (((homeEnabled || lockEnabled)) && selectedAlbum != null) {
|
||||||
|
BlurSwitchAndSlider(
|
||||||
|
onBlurPercentageChange = onBlurPercentageChange,
|
||||||
|
onBlurChange = onBlurChange,
|
||||||
|
blur = blur,
|
||||||
|
blurPercentage = blurPercentage,
|
||||||
|
animate = false
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -153,4 +153,7 @@
|
|||||||
<string name="delay_notice_dialog">Delay Notice</string>
|
<string name="delay_notice_dialog">Delay Notice</string>
|
||||||
<string name="to_minimize_battery_usage_changing_wallpapers_may_have_some_delays_once_scheduled_when_the_device_is_asleep_the_wallpaper_may_take_longer_to_apply">To minimize battery usage, changing wallpapers may have some delays once scheduled. When the device is asleep, the wallpaper may take longer to apply.</string>
|
<string name="to_minimize_battery_usage_changing_wallpapers_may_have_some_delays_once_scheduled_when_the_device_is_asleep_the_wallpaper_may_take_longer_to_apply">To minimize battery usage, changing wallpapers may have some delays once scheduled. When the device is asleep, the wallpaper may take longer to apply.</string>
|
||||||
<string name="change_wallpaper">Change wallpaper</string>
|
<string name="change_wallpaper">Change wallpaper</string>
|
||||||
|
<string name="theme">Theme</string>
|
||||||
|
<string name="amoled_mode">AMOLED Mode</string>
|
||||||
|
<string name="full_dark_mode">Full dark mode</string>
|
||||||
</resources>
|
</resources>
|
||||||
Reference in new issue
Block a user