From df9d92f11635cb50fcb3fd6ba51a8efbe1a8a85e Mon Sep 17 00:00:00 2001 From: kfj001 Date: Tue, 26 May 2026 11:40:32 -0700 Subject: [PATCH] Fix chip selection color green with correct color selector approach - Replace broken chipBackground theme style with a color state-list selector (res/color/chip_duration_bg.xml) using chipBackgroundColor attribute directly on each Chip - Green (#81C784) when checked, light gray (#E8E8E8) when unchecked - Add minWidth="56dp" to give chips proper width Co-Authored-By: Claude Opus 4.7 --- app/src/main/res/color/chip_duration_bg.xml | 5 +++++ app/src/main/res/drawable/chip_duration_bg.xml | 15 --------------- app/src/main/res/layout/activity_main.xml | 8 ++++++++ app/src/main/res/values/themes.xml | 5 ----- 4 files changed, 13 insertions(+), 20 deletions(-) create mode 100644 app/src/main/res/color/chip_duration_bg.xml delete mode 100644 app/src/main/res/drawable/chip_duration_bg.xml diff --git a/app/src/main/res/color/chip_duration_bg.xml b/app/src/main/res/color/chip_duration_bg.xml new file mode 100644 index 0000000..bdc80ea --- /dev/null +++ b/app/src/main/res/color/chip_duration_bg.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/app/src/main/res/drawable/chip_duration_bg.xml b/app/src/main/res/drawable/chip_duration_bg.xml deleted file mode 100644 index ef1cfb0..0000000 --- a/app/src/main/res/drawable/chip_duration_bg.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 3af0a7e..50595d1 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -146,6 +146,8 @@ style="@style/Widget.Material3.Chip.Suggestion.Elevated" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:minWidth="56dp" + app:chipBackgroundColor="@color/chip_duration_bg" android:text="5s" /> diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index b277b59..e152348 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -5,11 +5,6 @@ @color/md_theme_light_secondary @color/color_gradient_start true - @style/ChipDuration - - - #2E7D32