Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 29b2bc7d authored by Josh's avatar Josh
Browse files

Fixed non-resetting scroll state

Made scroll state reset for end side panel  whenever another category is
selected.

Fix: 362737826
Flag: com.android.systemui.keyboard_shortcut_helper_rewrite
Test: Manual - navigate through shortcut helper, scroll through
shortcuts, navigate to another category, ensure that shortcut panel is scrolled to
the top.

Change-Id: I19b1713c0973b1422feb2c205d77af3e9b526e44
parent 1e40d911
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
@@ -434,11 +435,13 @@ private fun ShortcutHelperTwoPane(

@Composable
private fun EndSidePanel(searchQuery: String, modifier: Modifier, category: ShortcutCategory?) {
    val listState = rememberLazyListState()
    LaunchedEffect(key1 = category) { if (category != null) listState.animateScrollToItem(0) }
    if (category == null) {
        NoSearchResultsText(horizontalPadding = 24.dp, fillHeight = false)
        return
    }
    LazyColumn(modifier = modifier) {
    LazyColumn(modifier = modifier, state = listState) {
        items(category.subCategories) { subcategory ->
            SubCategoryContainerDualPane(searchQuery = searchQuery, subCategory = subcategory)
            Spacer(modifier = Modifier.height(8.dp))