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:cardCornerRadius="8dp"
|
||||
app:cardUseCompatPadding="true"
|
||||
app:layout_collapseMode="pin">
|
||||
app:layout_scrollFlags="scroll|enterAlways">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
package code.name.monkey.appthemehelper.common.views
|
||||
|
||||
import android.content.Context
|
||||
import android.content.res.ColorStateList
|
||||
import android.util.AttributeSet
|
||||
import android.view.View
|
||||
import androidx.appcompat.widget.SwitchCompat
|
||||
import code.name.monkey.appthemehelper.R
|
||||
import code.name.monkey.appthemehelper.ATH
|
||||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
|
||||
|
||||
|
@ -27,15 +26,7 @@ class ATESwitch : SwitchCompat {
|
|||
}
|
||||
|
||||
private fun init(context: Context) {
|
||||
setThumbResource(R.drawable.toggle_switch)
|
||||
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
|
||||
ATH.setTint(this, ThemeStore.accentColor(context))
|
||||
}
|
||||
|
||||
override fun isShown(): Boolean {
|
||||
|
|
Loading…
Reference in a new issue