mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-04-20 14:19:08 +00:00
don't scroll icon selector on each icon selection
This commit is contained in:
parent
f5c3fca8c6
commit
6e18c9af8c
2 changed files with 5 additions and 5 deletions
|
@ -14,7 +14,6 @@ import helium314.keyboard.latin.utils.prefs
|
||||||
import kotlinx.coroutines.flow.MutableStateFlow
|
import kotlinx.coroutines.flow.MutableStateFlow
|
||||||
|
|
||||||
// todo (roughly in order)
|
// 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?
|
// 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)
|
// 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
|
// calling KeyboardSwitcher.getInstance().forceUpdateKeyboardTheme(requireContext()) while keyboard is showing shows just full screen background
|
||||||
|
|
|
@ -100,12 +100,13 @@ fun CustomizeIconsDialog(
|
||||||
iconsSet.addAll(iconsForName)
|
iconsSet.addAll(iconsForName)
|
||||||
KeyboardIconsSet.getAllIcons(ctx).forEach { iconsSet.addAll(it.value) }
|
KeyboardIconsSet.getAllIcons(ctx).forEach { iconsSet.addAll(it.value) }
|
||||||
val icons = iconsSet.toList()
|
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()
|
val gridState = rememberLazyGridState()
|
||||||
LaunchedEffect(selectedIcon) {
|
LaunchedEffect(initialIcon) {
|
||||||
val index = icons.indexOf(selectedIcon)
|
val index = icons.indexOf(initialIcon)
|
||||||
if (index != -1) gridState.scrollToItem(index, -state.layoutInfo.viewportSize.height / 3)
|
if (index != -1) gridState.animateScrollToItem(index, -state.layoutInfo.viewportSize.height / 3)
|
||||||
}
|
}
|
||||||
ThreeButtonAlertDialog(
|
ThreeButtonAlertDialog(
|
||||||
onDismissRequest = { showIconDialog = null },
|
onDismissRequest = { showIconDialog = null },
|
||||||
|
|
Loading…
Add table
Reference in a new issue