Added MD3 switch

This commit is contained in:
Prathamesh More 2022-06-06 21:35:58 +05:30
parent 33a0d113b8
commit b28d5678bc
9 changed files with 46 additions and 50 deletions

View file

@ -14,7 +14,7 @@ android {
vectorDrawables.useSupportLibrary = true
applicationId "code.name.monkey.retromusic"
versionCode 10588
versionCode 10590
versionName '6.0.0'
buildConfigField("String", "GOOGLE_PLAY_LICENSING_KEY", "\"${getProperty(getProperties('../public.properties'), 'GOOGLE_PLAY_LICENSE_KEY')}\"")

View file

@ -135,7 +135,9 @@ fun Button.accentTextColor() {
fun MaterialButton.accentBackgroundColor() {
if (materialYou) return
backgroundTintList = ColorStateList.valueOf(context.accentColor())
backgroundTintList = ColorStateList(
arrayOf(intArrayOf(android.R.attr.state_enabled), intArrayOf()),
intArrayOf(context.accentColor(), context.accentColor().addAlpha(0.12f)))
}
fun MaterialButton.accentOutlineColor() {

View file

@ -79,8 +79,7 @@
app:showText="false"
android:clickable="false"
android:focusable="false"
app:track="@drawable/switch_track"
android:thumb="@drawable/switch_thumb"
style="@style/Widget.Material3.CompoundButton.MaterialSwitch"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />

View file

@ -65,8 +65,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:showText="false"
app:track="@drawable/switch_track"
android:thumb="@drawable/switch_thumb"
style="@style/Widget.Material3.CompoundButton.MaterialSwitch"
android:clickable="false"
android:focusable="false"
app:layout_constraintBottom_toBottomOf="parent"