|
|
@ -9,6 +9,7 @@ import androidx.appcompat.widget.Toolbar |
|
|
|
import androidx.core.os.bundleOf |
|
|
|
import androidx.core.os.bundleOf |
|
|
|
import androidx.core.view.isVisible |
|
|
|
import androidx.core.view.isVisible |
|
|
|
import androidx.fragment.app.viewModels |
|
|
|
import androidx.fragment.app.viewModels |
|
|
|
|
|
|
|
import androidx.lifecycle.whenStarted |
|
|
|
import androidx.recyclerview.widget.RecyclerView |
|
|
|
import androidx.recyclerview.widget.RecyclerView |
|
|
|
import io.legado.app.R |
|
|
|
import io.legado.app.R |
|
|
|
import io.legado.app.base.BaseDialogFragment |
|
|
|
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.ui.widget.recycler.VerticalDivider |
|
|
|
import io.legado.app.utils.* |
|
|
|
import io.legado.app.utils.* |
|
|
|
import io.legado.app.utils.viewbindingdelegate.viewBinding |
|
|
|
import io.legado.app.utils.viewbindingdelegate.viewBinding |
|
|
|
|
|
|
|
import kotlinx.coroutines.Dispatchers |
|
|
|
import kotlinx.coroutines.delay |
|
|
|
import kotlinx.coroutines.delay |
|
|
|
import kotlinx.coroutines.flow.conflate |
|
|
|
import kotlinx.coroutines.flow.conflate |
|
|
|
import kotlinx.coroutines.launch |
|
|
|
import kotlinx.coroutines.launch |
|
|
@ -176,10 +178,12 @@ class ChangeChapterSourceDialog() : BaseDialogFragment(R.layout.dialog_chapter_c |
|
|
|
} |
|
|
|
} |
|
|
|
binding.toolBar.menu.applyTint(requireContext()) |
|
|
|
binding.toolBar.menu.applyTint(requireContext()) |
|
|
|
} |
|
|
|
} |
|
|
|
launch { |
|
|
|
launch(Dispatchers.Default) { |
|
|
|
viewModel.searchDataFlow.conflate().collect { |
|
|
|
whenStarted { |
|
|
|
searchBookAdapter.setItems(it) |
|
|
|
viewModel.searchDataFlow.conflate().collect { |
|
|
|
delay(1000) |
|
|
|
searchBookAdapter.setItems(it) |
|
|
|
|
|
|
|
delay(1000) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
launch { |
|
|
|
launch { |
|
|
|