mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2024-11-10 09:07:47 +01:00
fix: scrolling in patch selector
This commit is contained in:
parent
c7d183ee8d
commit
16fea59605
1 changed files with 5 additions and 4 deletions
|
@ -9,8 +9,8 @@ import androidx.compose.foundation.layout.fillMaxSize
|
|||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.lazy.LazyListScope
|
||||
import androidx.compose.foundation.lazy.LazyListState
|
||||
import androidx.compose.foundation.lazy.items
|
||||
import androidx.compose.foundation.lazy.rememberLazyListState
|
||||
import androidx.compose.foundation.pager.HorizontalPager
|
||||
import androidx.compose.foundation.pager.rememberPagerState
|
||||
import androidx.compose.material.icons.Icons
|
||||
|
@ -94,6 +94,8 @@ fun PatchesSelectorScreen(
|
|||
derivedStateOf { vm.selectionIsValid(bundles) }
|
||||
}
|
||||
|
||||
val patchLazyListStates = remember(bundles) { List(bundles.size) { LazyListState() } }
|
||||
|
||||
if (showBottomSheet) {
|
||||
ModalBottomSheet(
|
||||
onDismissRequest = {
|
||||
|
@ -255,7 +257,6 @@ fun PatchesSelectorScreen(
|
|||
}
|
||||
}
|
||||
|
||||
val patchLazyListState = rememberLazyListState()
|
||||
Scaffold(
|
||||
topBar = {
|
||||
AppTopBar(
|
||||
|
@ -284,7 +285,7 @@ fun PatchesSelectorScreen(
|
|||
ExtendedFloatingActionButton(
|
||||
text = { Text(stringResource(R.string.save)) },
|
||||
icon = { Icon(Icons.Outlined.Save, null) },
|
||||
expanded = patchLazyListState.isScrollingUp,
|
||||
expanded = patchLazyListStates[pagerState.currentPage].isScrollingUp,
|
||||
onClick = {
|
||||
// TODO: only allow this if all required options have been set.
|
||||
onSave(vm.getCustomSelection(), vm.getOptions())
|
||||
|
@ -328,7 +329,7 @@ fun PatchesSelectorScreen(
|
|||
|
||||
LazyColumnWithScrollbar(
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
state = patchLazyListState
|
||||
state = patchLazyListStates[index]
|
||||
) {
|
||||
patchList(
|
||||
uid = bundle.uid,
|
||||
|
|
Loading…
Reference in a new issue