更新界面

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