更新界面

This commit is contained in:
HapeLee committed 2025-09-22 01:15:00 +08:00
1 parent 58e0f51c3e
commit ab7ba98c3f
3 files changed
+20 -20

No files matched your search

@@ -398,7 +398,7 @@ class CacheActivity : VMBaseActivity<ActivityCacheBookBinding, CacheViewModel>()
tvSelectExport.setOnClickListener { tvSelectExport.setOnClickListener {
cbSelectExport.callOnClick() cbSelectExport.callOnClick()
} }
cbSelectExport.onCheckedChangeListener = { _, isChecked -> cbSelectExport.setOnCheckedChangeListener{ _, isChecked ->
if (isChecked) { if (isChecked) {
etEpubSize.isEnabled = true etEpubSize.isEnabled = true
etInputScope.isEnabled = true etInputScope.isEnabled = true
@@ -407,7 +407,7 @@ class CacheActivity : VMBaseActivity<ActivityCacheBookBinding, CacheViewModel>()
cbAllExport.isChecked = false cbAllExport.isChecked = false
} }
} }
cbAllExport.onCheckedChangeListener = { _, isChecked -> cbAllExport.setOnCheckedChangeListener{ _, isChecked ->
if (isChecked) { if (isChecked) {
etEpubSize.isEnabled = false etEpubSize.isEnabled = false
etInputScope.isEnabled = false etInputScope.isEnabled = false
@@ -223,7 +223,7 @@ class BooksFragment() : BaseFragment(R.layout.fragment_books),
).catch { ).catch {
AppLog.put("书架更新出错", it) AppLog.put("书架更新出错", it)
}.conflate().flowOn(Dispatchers.Default).collect { list -> }.conflate().flowOn(Dispatchers.Default).collect { list ->
binding.tvEmptyMsg.isGone = list.isNotEmpty() binding.emptyView.isGone = list.isNotEmpty()
binding.refreshLayout.isEnabled = enableRefresh && list.isNotEmpty() binding.refreshLayout.isEnabled = enableRefresh && list.isNotEmpty()
booksAdapter.setItems(list) booksAdapter.setItems(list)
} }
@@ -13,24 +13,24 @@ import splitties.systemservices.windowManager
fun AlertDialog.applyTint(): AlertDialog { fun AlertDialog.applyTint(): AlertDialog {
//window?.setBackgroundDrawable(context.filletBackground) //window?.setBackgroundDrawable(context.filletBackground)
val colorStateList = Selector.colorBuild() // val colorStateList = Selector.colorBuild()
.setDefaultColor(ThemeStore.accentColor(context)) // .setDefaultColor(ThemeStore.accentColor(context))
.setPressedColor(ColorUtils.darkenColor(ThemeStore.accentColor(context))) // .setPressedColor(ColorUtils.darkenColor(ThemeStore.accentColor(context)))
.create() // .create()
if (getButton(AlertDialog.BUTTON_NEGATIVE) != null) { // if (getButton(AlertDialog.BUTTON_NEGATIVE) != null) {
getButton(AlertDialog.BUTTON_NEGATIVE).setTextColor(colorStateList) // getButton(AlertDialog.BUTTON_NEGATIVE).setTextColor(colorStateList)
} // }
if (getButton(AlertDialog.BUTTON_POSITIVE) != null) { // if (getButton(AlertDialog.BUTTON_POSITIVE) != null) {
getButton(AlertDialog.BUTTON_POSITIVE).setTextColor(colorStateList) // getButton(AlertDialog.BUTTON_POSITIVE).setTextColor(colorStateList)
} // }
if (getButton(AlertDialog.BUTTON_NEUTRAL) != null) { // if (getButton(AlertDialog.BUTTON_NEUTRAL) != null) {
getButton(AlertDialog.BUTTON_NEUTRAL).setTextColor(colorStateList) // getButton(AlertDialog.BUTTON_NEUTRAL).setTextColor(colorStateList)
} // }
window?.decorView?.post { // window?.decorView?.post {
listView?.forEach { // listView?.forEach {
// it.applyTint(context.accentColor) // it.applyTint(context.accentColor)
} // }
} // }
return this return this
} }