mirror of
https://github.com/gedoor/legado.git
synced 2024-07-06 23:47:49 +08:00
优化
This commit is contained in:
parent
7a09a8fb66
commit
77291fb8ab
@ -230,5 +230,5 @@ dependencies {
|
||||
//epubLib集成到应用内
|
||||
|
||||
// LeakCanary
|
||||
//debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.7'
|
||||
//debugImplementation('com.squareup.leakcanary:leakcanary-android:2.7')
|
||||
}
|
||||
|
@ -10,6 +10,8 @@ import android.view.View.VISIBLE
|
||||
import android.widget.TextView
|
||||
import androidx.activity.viewModels
|
||||
import androidx.appcompat.widget.SearchView
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.lifecycle.whenStarted
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.google.android.flexbox.FlexboxLayoutManager
|
||||
@ -196,10 +198,12 @@ class SearchActivity : VMBaseActivity<ActivityBookSearchBinding, SearchViewModel
|
||||
}
|
||||
|
||||
private fun initData() {
|
||||
launch {
|
||||
viewModel.searchDataFlow.conflate().collect {
|
||||
adapter.setItems(it)
|
||||
delay(1000)
|
||||
lifecycleScope.launch {
|
||||
whenStarted {
|
||||
viewModel.searchDataFlow.conflate().collect {
|
||||
adapter.setItems(it)
|
||||
delay(1000)
|
||||
}
|
||||
}
|
||||
}
|
||||
launch {
|
||||
|
Loading…
Reference in New Issue
Block a user