Roll back to Material Switch
This commit is contained in:
parent
87e4f78a1f
commit
a9287266e8
2 changed files with 3 additions and 12 deletions
|
@ -53,7 +53,7 @@
|
||||||
app:cardBackgroundColor="?colorSurface"
|
app:cardBackgroundColor="?colorSurface"
|
||||||
app:cardCornerRadius="8dp"
|
app:cardCornerRadius="8dp"
|
||||||
app:cardUseCompatPadding="true"
|
app:cardUseCompatPadding="true"
|
||||||
app:layout_collapseMode="pin">
|
app:layout_scrollFlags="scroll|enterAlways">
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
package code.name.monkey.appthemehelper.common.views
|
package code.name.monkey.appthemehelper.common.views
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.res.ColorStateList
|
|
||||||
import android.util.AttributeSet
|
import android.util.AttributeSet
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import androidx.appcompat.widget.SwitchCompat
|
import androidx.appcompat.widget.SwitchCompat
|
||||||
import code.name.monkey.appthemehelper.R
|
import code.name.monkey.appthemehelper.ATH
|
||||||
import code.name.monkey.appthemehelper.ThemeStore
|
import code.name.monkey.appthemehelper.ThemeStore
|
||||||
|
|
||||||
|
|
||||||
|
@ -27,15 +26,7 @@ class ATESwitch : SwitchCompat {
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun init(context: Context) {
|
private fun init(context: Context) {
|
||||||
setThumbResource(R.drawable.toggle_switch)
|
ATH.setTint(this, ThemeStore.accentColor(context))
|
||||||
setTrackResource(R.drawable.ate_track)
|
|
||||||
background = null
|
|
||||||
|
|
||||||
val sl = ColorStateList(arrayOf(intArrayOf(-android.R.attr.state_checked), intArrayOf(android.R.attr.state_checked)),
|
|
||||||
intArrayOf(ThemeStore.textColorSecondary(context), ThemeStore.accentColor(context)))
|
|
||||||
|
|
||||||
thumbTintList = sl
|
|
||||||
trackTintList = sl
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun isShown(): Boolean {
|
override fun isShown(): Boolean {
|
||||||
|
|
Loading…
Reference in a new issue