Removed unwanted params
This commit is contained in:
parent
a092ad9ac7
commit
ee59be16c4
17 changed files with 32 additions and 71 deletions
|
@ -22,18 +22,18 @@ import code.name.monkey.appthemehelper.ThemeStore
|
|||
|
||||
class ATEAccentTextView : AppCompatTextView {
|
||||
constructor(context: Context) : super(context) {
|
||||
init(context, null)
|
||||
init(context)
|
||||
}
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
|
||||
init(context, attrs)
|
||||
init(context)
|
||||
}
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
|
||||
init(context, attrs)
|
||||
init(context)
|
||||
}
|
||||
|
||||
private fun init(context: Context, attrs: AttributeSet?) {
|
||||
private fun init(context: Context) {
|
||||
setTextColor(ThemeStore.accentColor(context))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,18 +14,18 @@ import code.name.monkey.appthemehelper.ThemeStore
|
|||
class ATECheckBox : AppCompatCheckBox {
|
||||
|
||||
constructor(context: Context) : super(context) {
|
||||
init(context, null)
|
||||
init(context)
|
||||
}
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
|
||||
init(context, attrs)
|
||||
init(context)
|
||||
}
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
|
||||
init(context, attrs)
|
||||
init(context)
|
||||
}
|
||||
|
||||
private fun init(context: Context, attrs: AttributeSet?) {
|
||||
private fun init(context: Context) {
|
||||
ATH.setTint(this, ThemeStore.accentColor(context))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@ package code.name.monkey.appthemehelper.common.views
|
|||
import android.content.Context
|
||||
import androidx.appcompat.widget.AppCompatTextView
|
||||
|
||||
import android.text.Layout
|
||||
import android.util.AttributeSet
|
||||
|
||||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
|
@ -15,18 +14,18 @@ import code.name.monkey.appthemehelper.ThemeStore
|
|||
class ATEPrimaryTextView : AppCompatTextView {
|
||||
|
||||
constructor(context: Context) : super(context) {
|
||||
init(context, null)
|
||||
init(context)
|
||||
}
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
|
||||
init(context, attrs)
|
||||
init(context)
|
||||
}
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
|
||||
init(context, attrs)
|
||||
init(context)
|
||||
}
|
||||
|
||||
private fun init(context: Context, attrs: AttributeSet?) {
|
||||
private fun init(context: Context) {
|
||||
setTextColor(ThemeStore.textColorPrimary(context))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,23 +15,23 @@ import code.name.monkey.appthemehelper.ThemeStore
|
|||
class ATERadioButton : RadioButton {
|
||||
|
||||
constructor(context: Context) : super(context) {
|
||||
init(context, null)
|
||||
init(context)
|
||||
}
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
|
||||
init(context, attrs)
|
||||
init(context)
|
||||
}
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
|
||||
init(context, attrs)
|
||||
init(context)
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes) {
|
||||
init(context, attrs)
|
||||
init(context)
|
||||
}
|
||||
|
||||
private fun init(context: Context, attrs: AttributeSet?) {
|
||||
private fun init(context: Context) {
|
||||
ATH.setTint(this, ThemeStore.accentColor(context))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,23 +16,23 @@ import code.name.monkey.appthemehelper.ThemeStore
|
|||
class ATESeekBar : SeekBar {
|
||||
|
||||
constructor(context: Context) : super(context) {
|
||||
init(context, null)
|
||||
init(context)
|
||||
}
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
|
||||
init(context, attrs)
|
||||
init(context)
|
||||
}
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
|
||||
init(context, attrs)
|
||||
init(context)
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes) {
|
||||
init(context, attrs)
|
||||
init(context)
|
||||
}
|
||||
|
||||
private fun init(context: Context, attrs: AttributeSet?) {
|
||||
private fun init(context: Context) {
|
||||
ATH.setTint(this, ThemeStore.accentColor(context))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,18 +15,18 @@ import code.name.monkey.appthemehelper.ThemeStore
|
|||
class ATESwitch : SwitchCompat {
|
||||
|
||||
constructor(context: Context) : super(context) {
|
||||
init(context, null)
|
||||
init(context)
|
||||
}
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
|
||||
init(context, attrs)
|
||||
init(context)
|
||||
}
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
|
||||
init(context, attrs)
|
||||
init(context)
|
||||
}
|
||||
|
||||
private fun init(context: Context, attrs: AttributeSet?) {
|
||||
private fun init(context: Context) {
|
||||
setThumbResource(R.drawable.toggle_switch)
|
||||
setTrackResource(R.drawable.ate_track)
|
||||
background = null
|
||||
|
|
|
@ -117,15 +117,15 @@ object ColorUtil {
|
|||
|
||||
@ColorInt
|
||||
fun getReadableText(@ColorInt textColor: Int, @ColorInt backgroundColor: Int, difference: Int): Int {
|
||||
var textColor = textColor
|
||||
var textColorFinal = textColor
|
||||
val isLight = isColorLight(backgroundColor)
|
||||
var i = 0
|
||||
while (getDifference(textColor, backgroundColor) < difference && i < 100) {
|
||||
textColor = getMixedColor(textColor, if (isLight) Color.BLACK else Color.WHITE)
|
||||
while (getDifference(textColorFinal, backgroundColor) < difference && i < 100) {
|
||||
textColorFinal = getMixedColor(textColorFinal, if (isLight) Color.BLACK else Color.WHITE)
|
||||
i++
|
||||
}
|
||||
|
||||
return textColor
|
||||
return textColorFinal
|
||||
}
|
||||
|
||||
@ColorInt
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue