mirror of
https://github.com/gedoor/legado.git
synced 2024-09-01 09:34:25 +08:00
优化
This commit is contained in:
parent
fed9eec283
commit
e33b702f75
@ -7,6 +7,7 @@ import android.view.MenuItem
|
|||||||
import android.view.View
|
import android.view.View
|
||||||
import androidx.activity.viewModels
|
import androidx.activity.viewModels
|
||||||
import androidx.appcompat.app.AlertDialog
|
import androidx.appcompat.app.AlertDialog
|
||||||
|
import androidx.lifecycle.flowWithLifecycle
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import com.google.android.material.textfield.TextInputLayout
|
import com.google.android.material.textfield.TextInputLayout
|
||||||
@ -220,7 +221,7 @@ class CacheActivity : VMBaseActivity<ActivityCacheBookBinding, CacheViewModel>()
|
|||||||
|
|
||||||
else -> booksDownload.sortedByDescending { it.durChapterTime }
|
else -> booksDownload.sortedByDescending { it.durChapterTime }
|
||||||
}
|
}
|
||||||
}.catch {
|
}.flowWithLifecycle(lifecycle).catch {
|
||||||
AppLog.put("缓存管理界面获取书籍列表失败\n${it.localizedMessage}", it)
|
AppLog.put("缓存管理界面获取书籍列表失败\n${it.localizedMessage}", it)
|
||||||
}.flowOn(IO).conflate().collect { books ->
|
}.flowOn(IO).conflate().collect { books ->
|
||||||
adapter.setItems(books)
|
adapter.setItems(books)
|
||||||
|
@ -18,8 +18,6 @@ import io.legado.app.utils.visible
|
|||||||
class CacheAdapter(context: Context, private val callBack: CallBack) :
|
class CacheAdapter(context: Context, private val callBack: CallBack) :
|
||||||
RecyclerAdapter<Book, ItemDownloadBinding>(context) {
|
RecyclerAdapter<Book, ItemDownloadBinding>(context) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
override fun getViewBinding(parent: ViewGroup): ItemDownloadBinding {
|
override fun getViewBinding(parent: ViewGroup): ItemDownloadBinding {
|
||||||
return ItemDownloadBinding.inflate(inflater, parent, false)
|
return ItemDownloadBinding.inflate(inflater, parent, false)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user