From ba40cfd76b765990a5ffd5e2a264d1cf3026e89b Mon Sep 17 00:00:00 2001 From: eddy Date: Wed, 14 Oct 2026 20:49:18 +0200 Subject: [PATCH] Schakelaarknop wit via SwitchCompat+thumbTint (werkt in donker thema) --- .../java/nl/eddydevink/buschauffeurswekker/MainActivity.kt | 4 ++-- app/src/main/res/color/switch_thumb_wit.xml | 4 ++++ app/src/main/res/layout/item_alarm_card.xml | 4 ++-- app/src/main/res/values/themes.xml | 6 ------ 4 files changed, 8 insertions(+), 10 deletions(-) create mode 100644 app/src/main/res/color/switch_thumb_wit.xml diff --git a/app/src/main/java/nl/eddydevink/buschauffeurswekker/MainActivity.kt b/app/src/main/java/nl/eddydevink/buschauffeurswekker/MainActivity.kt index 89cbb99..549f150 100644 --- a/app/src/main/java/nl/eddydevink/buschauffeurswekker/MainActivity.kt +++ b/app/src/main/java/nl/eddydevink/buschauffeurswekker/MainActivity.kt @@ -14,8 +14,8 @@ import android.widget.Toast import androidx.appcompat.app.AppCompatActivity import androidx.core.content.ContextCompat import androidx.lifecycle.lifecycleScope +import androidx.appcompat.widget.SwitchCompat import com.google.android.material.card.MaterialCardView -import com.google.android.material.materialswitch.MaterialSwitch import kotlinx.coroutines.launch import nl.eddydevink.buschauffeurswekker.core.AlarmScheduler import nl.eddydevink.buschauffeurswekker.core.AlarmSpec @@ -129,7 +129,7 @@ class MainActivity : AppCompatActivity() { card.findViewById(R.id.tv_name).text = spec.name val timeView = card.findViewById(R.id.tv_time) timeView.text = TIME.format(spec.time) - val switch = card.findViewById(R.id.switch_alarm) + val switch = card.findViewById(R.id.switch_alarm) switch.setOnCheckedChangeListener(null) switch.isChecked = !disabled // Heldere statetoestand: blauw = aan, grijs = uit. diff --git a/app/src/main/res/color/switch_thumb_wit.xml b/app/src/main/res/color/switch_thumb_wit.xml new file mode 100644 index 0000000..9dbbc06 --- /dev/null +++ b/app/src/main/res/color/switch_thumb_wit.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_alarm_card.xml b/app/src/main/res/layout/item_alarm_card.xml index c17208d..e32b22e 100644 --- a/app/src/main/res/layout/item_alarm_card.xml +++ b/app/src/main/res/layout/item_alarm_card.xml @@ -55,11 +55,11 @@ android:textStyle="bold" /> - + android:thumbTint="@color/switch_thumb_wit" /> \ No newline at end of file diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index a60dd29..3b93daa 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -14,10 +14,4 @@ @android:color/black @android:color/black - - - \ No newline at end of file