mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-04-20 06:09:09 +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
|
||||
|
||||
// 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
|
||||
|
|
|
@ -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 },
|
||||
|
|
Loading…
Add table
Reference in a new issue