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

Commit 679ba232 authored by Joshua Mokut's avatar Joshua Mokut Committed by Android (Google) Code Review
Browse files

Merge "Fixed non-resetting scroll state" into main

parents 11f0f937 29b2bc7d
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))