Removed unwanted params

This commit is contained in:
h4h13 2019-05-17 09:51:22 +05:30
parent a092ad9ac7
commit ee59be16c4
17 changed files with 32 additions and 71 deletions

View file

@ -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))
}
}

View file

@ -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))
}
}

View file

@ -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))
}
}

View file

@ -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))
}
}

View file

@ -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))
}
}

View file

@ -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

View file

@ -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

View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<font-family xmlns:android="http://schemas.android.com/apk/res/android">
<font
android:font="@font/circular_std_book"
android:fontStyle="normal"
android:fontWeight="400" />
<font
android:font="@font/circular_std_medium"
android:fontStyle="normal"
android:fontWeight="700" />
<font
android:font="@font/circular_std_black"
android:fontWeight="900" />
</font-family>

Binary file not shown.

Binary file not shown.

Binary file not shown.