主题色适配

pull/298/head
gedoor 4 years ago
parent 9c6610bd6e
commit 70c8dac18d
  1. 3
      app/src/main/java/io/legado/app/lib/dialogs/AndroidSelectors.kt
  2. 3
      app/src/main/java/io/legado/app/ui/book/read/config/ChineseConverter.kt
  3. 2
      app/src/main/java/io/legado/app/ui/book/read/config/ReadStyleDialog.kt
  4. 4
      app/src/main/java/io/legado/app/ui/book/read/config/TextFontWeightConverter.kt

@ -21,6 +21,7 @@ package io.legado.app.lib.dialogs
import android.content.Context import android.content.Context
import android.content.DialogInterface import android.content.DialogInterface
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import io.legado.app.utils.applyTint
inline fun Fragment.selector( inline fun Fragment.selector(
title: CharSequence? = null, title: CharSequence? = null,
@ -38,6 +39,6 @@ fun Context.selector(
this.title = title this.title = title
} }
items(items, onClick) items(items, onClick)
show() show().applyTint()
} }
} }

@ -10,6 +10,7 @@ import io.legado.app.help.AppConfig
import io.legado.app.lib.dialogs.alert import io.legado.app.lib.dialogs.alert
import io.legado.app.lib.theme.accentColor import io.legado.app.lib.theme.accentColor
import io.legado.app.ui.widget.text.StrokeTextView import io.legado.app.ui.widget.text.StrokeTextView
import io.legado.app.utils.applyTint
import org.jetbrains.anko.sdk27.listeners.onClick import org.jetbrains.anko.sdk27.listeners.onClick
class ChineseConverter(context: Context, attrs: AttributeSet?) : StrokeTextView(context, attrs) { class ChineseConverter(context: Context, attrs: AttributeSet?) : StrokeTextView(context, attrs) {
@ -44,7 +45,7 @@ class ChineseConverter(context: Context, attrs: AttributeSet?) : StrokeTextView(
upUi(i) upUi(i)
onChanged?.invoke() onChanged?.invoke()
} }
}.show() }.show().applyTint()
} }
fun onChanged(unit: () -> Unit) { fun onChanged(unit: () -> Unit) {

@ -192,7 +192,7 @@ class ReadStyleDialog : DialogFragment(), FontSelectDialog.CallBack {
} }
} }
customView = rootView customView = rootView
}.show() }.show().applyTint()
} }
private fun changeBg(index: Int) { private fun changeBg(index: Int) {

@ -6,11 +6,11 @@ import android.text.SpannableString
import android.text.style.ForegroundColorSpan import android.text.style.ForegroundColorSpan
import android.util.AttributeSet import android.util.AttributeSet
import io.legado.app.R import io.legado.app.R
import io.legado.app.help.AppConfig
import io.legado.app.help.ReadBookConfig import io.legado.app.help.ReadBookConfig
import io.legado.app.lib.dialogs.alert import io.legado.app.lib.dialogs.alert
import io.legado.app.lib.theme.accentColor import io.legado.app.lib.theme.accentColor
import io.legado.app.ui.widget.text.StrokeTextView import io.legado.app.ui.widget.text.StrokeTextView
import io.legado.app.utils.applyTint
import org.jetbrains.anko.sdk27.listeners.onClick import org.jetbrains.anko.sdk27.listeners.onClick
class TextFontWeightConverter(context: Context, attrs: AttributeSet?) : StrokeTextView(context, attrs) { class TextFontWeightConverter(context: Context, attrs: AttributeSet?) : StrokeTextView(context, attrs) {
@ -46,7 +46,7 @@ class TextFontWeightConverter(context: Context, attrs: AttributeSet?) : StrokeTe
upUi(i) upUi(i)
onChanged?.invoke() onChanged?.invoke()
} }
}.show() }.show().applyTint()
} }
fun onChanged(unit: () -> Unit) { fun onChanged(unit: () -> Unit) {

Loading…
Cancel
Save