diff --git a/app/src/main/java/nl/eddydevink/buschauffeurswekker/MainActivity.kt b/app/src/main/java/nl/eddydevink/buschauffeurswekker/MainActivity.kt index f95ec48..89cbb99 100644 --- a/app/src/main/java/nl/eddydevink/buschauffeurswekker/MainActivity.kt +++ b/app/src/main/java/nl/eddydevink/buschauffeurswekker/MainActivity.kt @@ -9,13 +9,13 @@ import android.view.LayoutInflater import android.view.View import android.widget.LinearLayout import android.widget.PopupMenu -import android.widget.Switch import android.widget.TextView import android.widget.Toast import androidx.appcompat.app.AppCompatActivity import androidx.core.content.ContextCompat import androidx.lifecycle.lifecycleScope 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,18 +129,14 @@ 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 - // Helder onderscheid: blauw = aan, grijs = uit (zoals de systeemwekker). + // Heldere statetoestand: blauw = aan, grijs = uit. val cardView = card as MaterialCardView - if (disabled) { - cardView.setCardBackgroundColor(ContextCompat.getColor(this, R.color.card_idle)) - timeView.setTextColor(ContextCompat.getColor(this, R.color.text_muted)) - } else { - cardView.setCardBackgroundColor(ContextCompat.getColor(this, R.color.card_active)) - timeView.setTextColor(ContextCompat.getColor(this, R.color.text_bright)) - } + cardView.setCardBackgroundColor( + ContextCompat.getColor(this, if (disabled) R.color.card_idle else R.color.card_active), + ) switch.setOnCheckedChangeListener { _, checked -> toggleAlarm(spec, checked) renderStatus() diff --git a/app/src/main/res/color/switch_thumb.xml b/app/src/main/res/color/switch_thumb.xml deleted file mode 100644 index 7c645d2..0000000 --- a/app/src/main/res/color/switch_thumb.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/color/switch_track.xml b/app/src/main/res/color/switch_track.xml deleted file mode 100644 index 87408a1..0000000 --- a/app/src/main/res/color/switch_track.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ 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 c688f5e..1081a7f 100644 --- a/app/src/main/res/layout/item_alarm_card.xml +++ b/app/src/main/res/layout/item_alarm_card.xml @@ -55,12 +55,10 @@ android:textStyle="bold" /> - + android:contentDescription="Wekker aan of uit" /> \ No newline at end of file