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.getCompatColor
class ATEAccentStrokeTextView : AppCompatTextView {
constructor(context: Context) : super(context)
constructor(context: Context, attrs: AttributeSet) : super(context, attrs)
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(
context,
attrs,
defStyleAttr
)
class ATEAccentStrokeTextView(context: Context, attrs: AttributeSet) :
AppCompatTextView(context, attrs) {
init {
background = Selector.shapeBuild()

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

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

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

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

@ -1,8 +1,6 @@
package io.legado.app.lib.theme.view
import android.annotation.TargetApi
import android.content.Context
import android.os.Build
import android.util.AttributeSet
import android.widget.ProgressBar
import io.legado.app.lib.theme.ATH
@ -11,25 +9,7 @@ import io.legado.app.lib.theme.ThemeStore
/**
* @author Aidan Follestad (afollestad)
*/
class ATEProgressBar : ProgressBar {
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
)
class ATEProgressBar(context: Context, attrs: AttributeSet) : ProgressBar(context, attrs) {
init {
ATH.setTint(this, ThemeStore.accentColor(context))

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

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

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

@ -9,17 +9,7 @@ import io.legado.app.lib.theme.accentColor
/**
* @author Aidan Follestad (afollestad)
*/
class ATESeekBar : AppCompatSeekBar {
constructor(context: Context) : super(context)
constructor(context: Context, attrs: AttributeSet) : super(context, attrs)
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(
context,
attrs,
defStyleAttr
)
class ATESeekBar(context: Context, attrs: AttributeSet) : AppCompatSeekBar(context, attrs) {
init {
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.utils.dp
class ATEStrokeTextView : AppCompatTextView {
constructor(context: Context) : super(context)
constructor(context: Context, attrs: AttributeSet) : super(context, attrs)
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(
context,
attrs,
defStyleAttr
)
class ATEStrokeTextView(context: Context, attrs: AttributeSet) : AppCompatTextView(context, attrs) {
init {
background = Selector.shapeBuild()

@ -9,17 +9,7 @@ import io.legado.app.lib.theme.accentColor
/**
* @author Aidan Follestad (afollestad)
*/
class ATESwitch : SwitchCompat {
constructor(context: Context) : super(context)
constructor(context: Context, attrs: AttributeSet) : super(context, attrs)
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(
context,
attrs,
defStyleAttr
)
class ATESwitch(context: Context, attrs: AttributeSet) : SwitchCompat(context, attrs) {
init {
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.ThemeStore
class ATETextInputLayout : TextInputLayout {
constructor(context: Context) : super(context)
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(
context,
attrs,
defStyleAttr
)
class ATETextInputLayout(context: Context, attrs: AttributeSet?) : TextInputLayout(context, attrs) {
init {
defaultHintTextColor = Selector.colorBuild().setDefaultColor(ThemeStore.accentColor(context)).create()

Loading…
Cancel
Save