pull/34/head
kunfei 5 years ago
parent 28156f66bb
commit da8a354ccc
  1. 12
      app/src/main/java/io/legado/app/lib/theme/view/ATEAccentStrokeTextView.kt
  2. 13
      app/src/main/java/io/legado/app/lib/theme/view/ATEAutoCompleteTextView.kt
  3. 12
      app/src/main/java/io/legado/app/lib/theme/view/ATECheckBox.kt
  4. 12
      app/src/main/java/io/legado/app/lib/theme/view/ATEEditText.kt
  5. 13
      app/src/main/java/io/legado/app/lib/theme/view/ATEPrimaryTextView.kt
  6. 22
      app/src/main/java/io/legado/app/lib/theme/view/ATEProgressBar.kt
  7. 12
      app/src/main/java/io/legado/app/lib/theme/view/ATERadioButton.kt
  8. 13
      app/src/main/java/io/legado/app/lib/theme/view/ATERadioNoButton.kt
  9. 13
      app/src/main/java/io/legado/app/lib/theme/view/ATESecondaryTextView.kt
  10. 12
      app/src/main/java/io/legado/app/lib/theme/view/ATESeekBar.kt
  11. 11
      app/src/main/java/io/legado/app/lib/theme/view/ATEStrokeTextView.kt
  12. 12
      app/src/main/java/io/legado/app/lib/theme/view/ATESwitch.kt
  13. 11
      app/src/main/java/io/legado/app/lib/theme/view/ATETextInputLayout.kt

@ -9,16 +9,8 @@ import io.legado.app.lib.theme.ThemeStore
import io.legado.app.utils.dp import io.legado.app.utils.dp
import io.legado.app.utils.getCompatColor import io.legado.app.utils.getCompatColor
class ATEAccentStrokeTextView : AppCompatTextView { class ATEAccentStrokeTextView(context: Context, attrs: AttributeSet) :
constructor(context: Context) : super(context) AppCompatTextView(context, attrs) {
constructor(context: Context, attrs: AttributeSet) : super(context, attrs)
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(
context,
attrs,
defStyleAttr
)
init { init {
background = Selector.shapeBuild() background = Selector.shapeBuild()

@ -8,17 +8,8 @@ import io.legado.app.lib.theme.Selector
import io.legado.app.lib.theme.ThemeStore import io.legado.app.lib.theme.ThemeStore
class ATEAutoCompleteTextView : AppCompatAutoCompleteTextView { class ATEAutoCompleteTextView(context: Context, attrs: AttributeSet) :
AppCompatAutoCompleteTextView(context, attrs) {
constructor(context: Context) : super(context)
constructor(context: Context, attrs: AttributeSet) : super(context, attrs)
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(
context,
attrs,
defStyleAttr
)
init { init {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {

@ -9,17 +9,7 @@ import io.legado.app.lib.theme.accentColor
/** /**
* @author Aidan Follestad (afollestad) * @author Aidan Follestad (afollestad)
*/ */
class ATECheckBox : AppCompatCheckBox { class ATECheckBox(context: Context, attrs: AttributeSet) : AppCompatCheckBox(context, attrs) {
constructor(context: Context) : super(context)
constructor(context: Context, attrs: AttributeSet) : super(context, attrs)
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(
context,
attrs,
defStyleAttr
)
init { init {
ATH.setTint(this, context.accentColor) ATH.setTint(this, context.accentColor)

@ -9,17 +9,7 @@ import io.legado.app.lib.theme.ThemeStore
/** /**
* @author Aidan Follestad (afollestad) * @author Aidan Follestad (afollestad)
*/ */
class ATEEditText : AppCompatEditText { class ATEEditText(context: Context, attrs: AttributeSet) : AppCompatEditText(context, attrs) {
constructor(context: Context) : super(context)
constructor(context: Context, attrs: AttributeSet) : super(context, attrs)
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(
context,
attrs,
defStyleAttr
)
init { init {
ATH.setTint(this, ThemeStore.accentColor(context)) ATH.setTint(this, ThemeStore.accentColor(context))

@ -8,17 +8,8 @@ import io.legado.app.lib.theme.ThemeStore
/** /**
* @author Aidan Follestad (afollestad) * @author Aidan Follestad (afollestad)
*/ */
class ATEPrimaryTextView : AppCompatTextView { class ATEPrimaryTextView(context: Context, attrs: AttributeSet) :
AppCompatTextView(context, attrs) {
constructor(context: Context) : super(context)
constructor(context: Context, attrs: AttributeSet) : super(context, attrs)
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(
context,
attrs,
defStyleAttr
)
init { init {
setTextColor(ThemeStore.textColorPrimary(context)) setTextColor(ThemeStore.textColorPrimary(context))

@ -1,8 +1,6 @@
package io.legado.app.lib.theme.view package io.legado.app.lib.theme.view
import android.annotation.TargetApi
import android.content.Context import android.content.Context
import android.os.Build
import android.util.AttributeSet import android.util.AttributeSet
import android.widget.ProgressBar import android.widget.ProgressBar
import io.legado.app.lib.theme.ATH import io.legado.app.lib.theme.ATH
@ -11,25 +9,7 @@ import io.legado.app.lib.theme.ThemeStore
/** /**
* @author Aidan Follestad (afollestad) * @author Aidan Follestad (afollestad)
*/ */
class ATEProgressBar : ProgressBar { class ATEProgressBar(context: Context, attrs: AttributeSet) : ProgressBar(context, attrs) {
constructor(context: Context) : super(context)
constructor(context: Context, attrs: AttributeSet) : super(context, attrs)
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(
context,
attrs,
defStyleAttr
)
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(
context,
attrs,
defStyleAttr,
defStyleRes
)
init { init {
ATH.setTint(this, ThemeStore.accentColor(context)) ATH.setTint(this, ThemeStore.accentColor(context))

@ -9,17 +9,7 @@ import io.legado.app.lib.theme.accentColor
/** /**
* @author Aidan Follestad (afollestad) * @author Aidan Follestad (afollestad)
*/ */
class ATERadioButton : AppCompatRadioButton { class ATERadioButton(context: Context, attrs: AttributeSet) : AppCompatRadioButton(context, attrs) {
constructor(context: Context) : super(context)
constructor(context: Context, attrs: AttributeSet) : super(context, attrs)
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(
context,
attrs,
defStyleAttr
)
init { init {
ATH.setTint(this@ATERadioButton, context.accentColor) ATH.setTint(this@ATERadioButton, context.accentColor)

@ -12,17 +12,8 @@ import io.legado.app.utils.getCompatColor
/** /**
* @author Aidan Follestad (afollestad) * @author Aidan Follestad (afollestad)
*/ */
class ATERadioNoButton : AppCompatRadioButton { class ATERadioNoButton(context: Context, attrs: AttributeSet) :
AppCompatRadioButton(context, attrs) {
constructor(context: Context) : super(context)
constructor(context: Context, attrs: AttributeSet) : super(context, attrs)
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(
context,
attrs,
defStyleAttr
)
init { init {
background = Selector.shapeBuild() background = Selector.shapeBuild()

@ -8,17 +8,8 @@ import io.legado.app.lib.theme.secondaryTextColor
/** /**
* @author Aidan Follestad (afollestad) * @author Aidan Follestad (afollestad)
*/ */
class ATESecondaryTextView : AppCompatTextView { class ATESecondaryTextView(context: Context, attrs: AttributeSet) :
AppCompatTextView(context, attrs) {
constructor(context: Context) : super(context)
constructor(context: Context, attrs: AttributeSet) : super(context, attrs)
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(
context,
attrs,
defStyleAttr
)
init { init {
setTextColor(context.secondaryTextColor) setTextColor(context.secondaryTextColor)

@ -9,17 +9,7 @@ import io.legado.app.lib.theme.accentColor
/** /**
* @author Aidan Follestad (afollestad) * @author Aidan Follestad (afollestad)
*/ */
class ATESeekBar : AppCompatSeekBar { class ATESeekBar(context: Context, attrs: AttributeSet) : AppCompatSeekBar(context, attrs) {
constructor(context: Context) : super(context)
constructor(context: Context, attrs: AttributeSet) : super(context, attrs)
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(
context,
attrs,
defStyleAttr
)
init { init {
ATH.setTint(this, context.accentColor) ATH.setTint(this, context.accentColor)

@ -8,16 +8,7 @@ import io.legado.app.lib.theme.Selector
import io.legado.app.lib.theme.ThemeStore import io.legado.app.lib.theme.ThemeStore
import io.legado.app.utils.dp import io.legado.app.utils.dp
class ATEStrokeTextView : AppCompatTextView { class ATEStrokeTextView(context: Context, attrs: AttributeSet) : AppCompatTextView(context, attrs) {
constructor(context: Context) : super(context)
constructor(context: Context, attrs: AttributeSet) : super(context, attrs)
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(
context,
attrs,
defStyleAttr
)
init { init {
background = Selector.shapeBuild() background = Selector.shapeBuild()

@ -9,17 +9,7 @@ import io.legado.app.lib.theme.accentColor
/** /**
* @author Aidan Follestad (afollestad) * @author Aidan Follestad (afollestad)
*/ */
class ATESwitch : SwitchCompat { class ATESwitch(context: Context, attrs: AttributeSet) : SwitchCompat(context, attrs) {
constructor(context: Context) : super(context)
constructor(context: Context, attrs: AttributeSet) : super(context, attrs)
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(
context,
attrs,
defStyleAttr
)
init { init {
ATH.setTint(this, context.accentColor) ATH.setTint(this, context.accentColor)

@ -6,16 +6,7 @@ import com.google.android.material.textfield.TextInputLayout
import io.legado.app.lib.theme.Selector import io.legado.app.lib.theme.Selector
import io.legado.app.lib.theme.ThemeStore import io.legado.app.lib.theme.ThemeStore
class ATETextInputLayout : TextInputLayout { class ATETextInputLayout(context: Context, attrs: AttributeSet?) : TextInputLayout(context, attrs) {
constructor(context: Context) : super(context)
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(
context,
attrs,
defStyleAttr
)
init { init {
defaultHintTextColor = Selector.colorBuild().setDefaultColor(ThemeStore.accentColor(context)).create() defaultHintTextColor = Selector.colorBuild().setDefaultColor(ThemeStore.accentColor(context)).create()

Loading…
Cancel
Save