From da8a354ccc3d99dba1963aeb12f028c0d382b4a7 Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 11 Sep 2019 14:42:12 +0800 Subject: [PATCH] up --- .../lib/theme/view/ATEAccentStrokeTextView.kt | 12 ++-------- .../lib/theme/view/ATEAutoCompleteTextView.kt | 13 ++--------- .../legado/app/lib/theme/view/ATECheckBox.kt | 12 +--------- .../legado/app/lib/theme/view/ATEEditText.kt | 12 +--------- .../app/lib/theme/view/ATEPrimaryTextView.kt | 13 ++--------- .../app/lib/theme/view/ATEProgressBar.kt | 22 +------------------ .../app/lib/theme/view/ATERadioButton.kt | 12 +--------- .../app/lib/theme/view/ATERadioNoButton.kt | 13 ++--------- .../lib/theme/view/ATESecondaryTextView.kt | 13 ++--------- .../legado/app/lib/theme/view/ATESeekBar.kt | 12 +--------- .../app/lib/theme/view/ATEStrokeTextView.kt | 11 +--------- .../io/legado/app/lib/theme/view/ATESwitch.kt | 12 +--------- .../app/lib/theme/view/ATETextInputLayout.kt | 11 +--------- 13 files changed, 18 insertions(+), 150 deletions(-) diff --git a/app/src/main/java/io/legado/app/lib/theme/view/ATEAccentStrokeTextView.kt b/app/src/main/java/io/legado/app/lib/theme/view/ATEAccentStrokeTextView.kt index 30ff4da44..355ed65a6 100644 --- a/app/src/main/java/io/legado/app/lib/theme/view/ATEAccentStrokeTextView.kt +++ b/app/src/main/java/io/legado/app/lib/theme/view/ATEAccentStrokeTextView.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() diff --git a/app/src/main/java/io/legado/app/lib/theme/view/ATEAutoCompleteTextView.kt b/app/src/main/java/io/legado/app/lib/theme/view/ATEAutoCompleteTextView.kt index f54f24eb4..4e6d04b2f 100644 --- a/app/src/main/java/io/legado/app/lib/theme/view/ATEAutoCompleteTextView.kt +++ b/app/src/main/java/io/legado/app/lib/theme/view/ATEAutoCompleteTextView.kt @@ -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) { diff --git a/app/src/main/java/io/legado/app/lib/theme/view/ATECheckBox.kt b/app/src/main/java/io/legado/app/lib/theme/view/ATECheckBox.kt index f910115df..fa009b01b 100644 --- a/app/src/main/java/io/legado/app/lib/theme/view/ATECheckBox.kt +++ b/app/src/main/java/io/legado/app/lib/theme/view/ATECheckBox.kt @@ -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) diff --git a/app/src/main/java/io/legado/app/lib/theme/view/ATEEditText.kt b/app/src/main/java/io/legado/app/lib/theme/view/ATEEditText.kt index b38bdd6ab..c6c692634 100644 --- a/app/src/main/java/io/legado/app/lib/theme/view/ATEEditText.kt +++ b/app/src/main/java/io/legado/app/lib/theme/view/ATEEditText.kt @@ -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)) diff --git a/app/src/main/java/io/legado/app/lib/theme/view/ATEPrimaryTextView.kt b/app/src/main/java/io/legado/app/lib/theme/view/ATEPrimaryTextView.kt index 44d1e1acd..b28a97305 100644 --- a/app/src/main/java/io/legado/app/lib/theme/view/ATEPrimaryTextView.kt +++ b/app/src/main/java/io/legado/app/lib/theme/view/ATEPrimaryTextView.kt @@ -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)) diff --git a/app/src/main/java/io/legado/app/lib/theme/view/ATEProgressBar.kt b/app/src/main/java/io/legado/app/lib/theme/view/ATEProgressBar.kt index aae4d914a..20f13e03c 100644 --- a/app/src/main/java/io/legado/app/lib/theme/view/ATEProgressBar.kt +++ b/app/src/main/java/io/legado/app/lib/theme/view/ATEProgressBar.kt @@ -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)) diff --git a/app/src/main/java/io/legado/app/lib/theme/view/ATERadioButton.kt b/app/src/main/java/io/legado/app/lib/theme/view/ATERadioButton.kt index c8715728e..d416d6f8f 100644 --- a/app/src/main/java/io/legado/app/lib/theme/view/ATERadioButton.kt +++ b/app/src/main/java/io/legado/app/lib/theme/view/ATERadioButton.kt @@ -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) diff --git a/app/src/main/java/io/legado/app/lib/theme/view/ATERadioNoButton.kt b/app/src/main/java/io/legado/app/lib/theme/view/ATERadioNoButton.kt index 41ce5dbe5..12e93ec4f 100644 --- a/app/src/main/java/io/legado/app/lib/theme/view/ATERadioNoButton.kt +++ b/app/src/main/java/io/legado/app/lib/theme/view/ATERadioNoButton.kt @@ -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() diff --git a/app/src/main/java/io/legado/app/lib/theme/view/ATESecondaryTextView.kt b/app/src/main/java/io/legado/app/lib/theme/view/ATESecondaryTextView.kt index d7dc8ca3d..8031961d3 100644 --- a/app/src/main/java/io/legado/app/lib/theme/view/ATESecondaryTextView.kt +++ b/app/src/main/java/io/legado/app/lib/theme/view/ATESecondaryTextView.kt @@ -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) diff --git a/app/src/main/java/io/legado/app/lib/theme/view/ATESeekBar.kt b/app/src/main/java/io/legado/app/lib/theme/view/ATESeekBar.kt index e6725c42a..2d793ba82 100644 --- a/app/src/main/java/io/legado/app/lib/theme/view/ATESeekBar.kt +++ b/app/src/main/java/io/legado/app/lib/theme/view/ATESeekBar.kt @@ -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) diff --git a/app/src/main/java/io/legado/app/lib/theme/view/ATEStrokeTextView.kt b/app/src/main/java/io/legado/app/lib/theme/view/ATEStrokeTextView.kt index 04416929c..3efb796f9 100644 --- a/app/src/main/java/io/legado/app/lib/theme/view/ATEStrokeTextView.kt +++ b/app/src/main/java/io/legado/app/lib/theme/view/ATEStrokeTextView.kt @@ -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() diff --git a/app/src/main/java/io/legado/app/lib/theme/view/ATESwitch.kt b/app/src/main/java/io/legado/app/lib/theme/view/ATESwitch.kt index 1a1c331a4..ceaec7f21 100644 --- a/app/src/main/java/io/legado/app/lib/theme/view/ATESwitch.kt +++ b/app/src/main/java/io/legado/app/lib/theme/view/ATESwitch.kt @@ -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) diff --git a/app/src/main/java/io/legado/app/lib/theme/view/ATETextInputLayout.kt b/app/src/main/java/io/legado/app/lib/theme/view/ATETextInputLayout.kt index b420f3e01..5444a309c 100644 --- a/app/src/main/java/io/legado/app/lib/theme/view/ATETextInputLayout.kt +++ b/app/src/main/java/io/legado/app/lib/theme/view/ATETextInputLayout.kt @@ -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()