diff --git a/app/src/main/java/helium314/keyboard/settings/SettingsActivity.kt b/app/src/main/java/helium314/keyboard/settings/SettingsActivity.kt index 25e3dcbe..68da01fe 100644 --- a/app/src/main/java/helium314/keyboard/settings/SettingsActivity.kt +++ b/app/src/main/java/helium314/keyboard/settings/SettingsActivity.kt @@ -14,7 +14,6 @@ import helium314.keyboard.latin.utils.prefs import kotlinx.coroutines.flow.MutableStateFlow // todo (roughly in order) -// check dark and light theme (don't have dynamic) // any way to get rid of the "old" background on starting settings? probably comes from app theme, can we avoid it? // try making old fragment back stuff work better, and try the different themes (with and without top bar, it should only appear for old fragments) // calling KeyboardSwitcher.getInstance().forceUpdateKeyboardTheme(requireContext()) while keyboard is showing shows just full screen background diff --git a/app/src/main/java/helium314/keyboard/settings/dialogs/CustomizeIconsDialog.kt b/app/src/main/java/helium314/keyboard/settings/dialogs/CustomizeIconsDialog.kt index ccdfa23a..c0241022 100644 --- a/app/src/main/java/helium314/keyboard/settings/dialogs/CustomizeIconsDialog.kt +++ b/app/src/main/java/helium314/keyboard/settings/dialogs/CustomizeIconsDialog.kt @@ -100,12 +100,13 @@ fun CustomizeIconsDialog( iconsSet.addAll(iconsForName) KeyboardIconsSet.getAllIcons(ctx).forEach { iconsSet.addAll(it.value) } val icons = iconsSet.toList() - var selectedIcon by rememberSaveable { mutableStateOf(KeyboardIconsSet.instance.iconIds[iconName]) } + val initialIcon = KeyboardIconsSet.instance.iconIds[iconName] + var selectedIcon by rememberSaveable { mutableStateOf(initialIcon) } val gridState = rememberLazyGridState() - LaunchedEffect(selectedIcon) { - val index = icons.indexOf(selectedIcon) - if (index != -1) gridState.scrollToItem(index, -state.layoutInfo.viewportSize.height / 3) + LaunchedEffect(initialIcon) { + val index = icons.indexOf(initialIcon) + if (index != -1) gridState.animateScrollToItem(index, -state.layoutInfo.viewportSize.height / 3) } ThreeButtonAlertDialog( onDismissRequest = { showIconDialog = null },