HapeLee 1 anno fa
parent
commit
ab7ba98c3f

+ 2 - 2
app/src/main/java/io/legato/kazusa/ui/book/cache/CacheActivity.kt

@@ -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

+ 1 - 1
app/src/main/java/io/legato/kazusa/ui/main/bookshelf/books/BooksFragment.kt

@@ -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)
             }
             }

+ 18 - 18
app/src/main/java/io/legato/kazusa/utils/DialogExtensions.kt

@@ -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()
-        .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
     return this
 }
 }