From ae8f09c8a21e7998c684c9397661919ded9136f6 Mon Sep 17 00:00:00 2001 From: Michael Totschnig Date: Wed, 27 Sep 2023 18:52:23 +0200 Subject: [PATCH] finetuned prefetchDistance --- .../org/totschnig/myexpenses/viewmodel/MyExpensesViewModel.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/myExpenses/src/main/java/org/totschnig/myexpenses/viewmodel/MyExpensesViewModel.kt b/myExpenses/src/main/java/org/totschnig/myexpenses/viewmodel/MyExpensesViewModel.kt index cbfa4239f2..91cb86f9c1 100644 --- a/myExpenses/src/main/java/org/totschnig/myexpenses/viewmodel/MyExpensesViewModel.kt +++ b/myExpenses/src/main/java/org/totschnig/myexpenses/viewmodel/MyExpensesViewModel.kt @@ -176,14 +176,14 @@ open class MyExpensesViewModel( } } - private val pageSize = if (BuildConfig.DEBUG) 40 else 150 + private val pageSize = 150 val items: Map>> = lazyMap { Pager( PagingConfig( initialLoadSize = pageSize, pageSize = pageSize, - prefetchDistance = pageSize, + prefetchDistance = 40, enablePlaceholders = true ), pagingSourceFactory = pagingSourceFactories.getValue(it)