From ecfd19990506071bf73274ec569efe9bd97f827f Mon Sep 17 00:00:00 2001 From: kunfei Date: Sun, 27 Feb 2022 10:00:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/ui/main/bookshelf/style1/books/BooksFragment.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/main/bookshelf/style1/books/BooksFragment.kt b/app/src/main/java/io/legado/app/ui/main/bookshelf/style1/books/BooksFragment.kt index bdfa0564f..150585a22 100644 --- a/app/src/main/java/io/legado/app/ui/main/bookshelf/style1/books/BooksFragment.kt +++ b/app/src/main/java/io/legado/app/ui/main/bookshelf/style1/books/BooksFragment.kt @@ -5,7 +5,6 @@ import android.os.Bundle import android.view.View import androidx.core.view.isGone import androidx.fragment.app.activityViewModels -import androidx.lifecycle.lifecycleScope import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView @@ -31,6 +30,7 @@ import kotlinx.coroutines.flow.catch import kotlinx.coroutines.flow.conflate import kotlinx.coroutines.flow.flowOn import kotlinx.coroutines.flow.map +import kotlinx.coroutines.launch import kotlin.math.max /** @@ -105,7 +105,7 @@ class BooksFragment() : BaseFragment(R.layout.fragment_books), private fun upRecyclerData() { booksFlowJob?.cancel() - booksFlowJob = lifecycleScope.launchWhenStarted { + booksFlowJob = launch { when (groupId) { AppConst.bookGroupAllId -> appDb.bookDao.flowAll() AppConst.bookGroupLocalId -> appDb.bookDao.flowLocal()