Migrate Accompanist SwipeRefresh to Compose PullRefresh (#8106)
This commit is contained in:
@@ -18,7 +18,7 @@ import eu.kanade.core.prefs.PreferenceMutableState
|
||||
import eu.kanade.domain.category.model.Category
|
||||
import eu.kanade.domain.library.model.LibraryDisplayMode
|
||||
import eu.kanade.domain.library.model.LibraryManga
|
||||
import eu.kanade.presentation.components.SwipeRefresh
|
||||
import eu.kanade.presentation.components.PullRefresh
|
||||
import eu.kanade.presentation.components.rememberPagerState
|
||||
import eu.kanade.tachiyomi.ui.library.LibraryItem
|
||||
import kotlinx.coroutines.delay
|
||||
@@ -79,11 +79,11 @@ fun LibraryContent(
|
||||
}
|
||||
}
|
||||
|
||||
SwipeRefresh(
|
||||
PullRefresh(
|
||||
refreshing = isRefreshing,
|
||||
onRefresh = {
|
||||
val started = onRefresh(categories[currentPage()])
|
||||
if (!started) return@SwipeRefresh
|
||||
if (!started) return@PullRefresh
|
||||
scope.launch {
|
||||
// Fake refresh status but hide it after a second as it's a long running task
|
||||
isRefreshing = true
|
||||
|
||||
Reference in New Issue
Block a user