Allow jump in history pager

This commit is contained in:
tarsin committed 2023-05-12 17:50:07 +08:00
1 parent 255de89a43
commit f81d9de2c6
1 file changed
+2 -6
@@ -88,18 +88,14 @@ import moe.tarsin.coroutines.runSuspendCatching
import my.nanihadesuka.compose.InternalLazyColumnScrollbar
class HistoryScene : BaseScene() {
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?,
): View {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
return ComposeView(inflater.context).apply {
setMD3Content {
val dialogState = rememberDialogState()
dialogState.Handler()
val coroutineScope = rememberCoroutineScope()
val scrollBehavior = TopAppBarDefaults.pinnedScrollBehavior()
val historyData = remember { Pager(PagingConfig(20)) { EhDB.historyLazyList }.flow.cachedIn(lifecycleScope) }.collectAsLazyPagingItems()
val historyData = remember { Pager(PagingConfig(20, jumpThreshold = 40)) { EhDB.historyLazyList }.flow.cachedIn(lifecycleScope) }.collectAsLazyPagingItems()
Scaffold(
modifier = Modifier.nestedScroll(scrollBehavior.nestedScrollConnection),
topBar = {