pull/1654/merge
kunfei 3 years ago
parent 7097f4c0ec
commit ecfd199905
  1. 4
      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()

Loading…
Cancel
Save