|
|
|
@ -9,6 +9,7 @@ import androidx.appcompat.widget.Toolbar |
|
|
|
|
import androidx.core.os.bundleOf |
|
|
|
|
import androidx.core.view.isVisible |
|
|
|
|
import androidx.fragment.app.viewModels |
|
|
|
|
import androidx.lifecycle.whenStarted |
|
|
|
|
import androidx.recyclerview.widget.RecyclerView |
|
|
|
|
import io.legado.app.R |
|
|
|
|
import io.legado.app.base.BaseDialogFragment |
|
|
|
@ -30,6 +31,7 @@ import io.legado.app.ui.book.source.manage.BookSourceActivity |
|
|
|
|
import io.legado.app.ui.widget.recycler.VerticalDivider |
|
|
|
|
import io.legado.app.utils.* |
|
|
|
|
import io.legado.app.utils.viewbindingdelegate.viewBinding |
|
|
|
|
import kotlinx.coroutines.Dispatchers |
|
|
|
|
import kotlinx.coroutines.delay |
|
|
|
|
import kotlinx.coroutines.flow.conflate |
|
|
|
|
import kotlinx.coroutines.launch |
|
|
|
@ -176,12 +178,14 @@ class ChangeChapterSourceDialog() : BaseDialogFragment(R.layout.dialog_chapter_c |
|
|
|
|
} |
|
|
|
|
binding.toolBar.menu.applyTint(requireContext()) |
|
|
|
|
} |
|
|
|
|
launch { |
|
|
|
|
launch(Dispatchers.Default) { |
|
|
|
|
whenStarted { |
|
|
|
|
viewModel.searchDataFlow.conflate().collect { |
|
|
|
|
searchBookAdapter.setItems(it) |
|
|
|
|
delay(1000) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
launch { |
|
|
|
|
appDb.bookSourceDao.flowGroupEnabled().conflate().collect { |
|
|
|
|
groups.clear() |
|
|
|
|