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 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:state_checked="true" android:color="#81C784" />
|
||||||
|
<item android:color="#E8E8E8" />
|
||||||
|
</selector>
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<item android:state_checked="true">
|
|
||||||
<shape android:shape="rectangle">
|
|
||||||
<corners android:radius="12dp" />
|
|
||||||
<solid android:color="#81C784" />
|
|
||||||
</shape>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<shape android:shape="rectangle">
|
|
||||||
<corners android:radius="12dp" />
|
|
||||||
<solid android:color="#F5F5F5" />
|
|
||||||
</shape>
|
|
||||||
</item>
|
|
||||||
</selector>
|
|
||||||
@@ -146,6 +146,8 @@
|
|||||||
style="@style/Widget.Material3.Chip.Suggestion.Elevated"
|
style="@style/Widget.Material3.Chip.Suggestion.Elevated"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:minWidth="56dp"
|
||||||
|
app:chipBackgroundColor="@color/chip_duration_bg"
|
||||||
android:text="5s" />
|
android:text="5s" />
|
||||||
|
|
||||||
<com.google.android.material.chip.Chip
|
<com.google.android.material.chip.Chip
|
||||||
@@ -153,7 +155,9 @@
|
|||||||
style="@style/Widget.Material3.Chip.Suggestion.Elevated"
|
style="@style/Widget.Material3.Chip.Suggestion.Elevated"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:minWidth="56dp"
|
||||||
android:checked="true"
|
android:checked="true"
|
||||||
|
app:chipBackgroundColor="@color/chip_duration_bg"
|
||||||
android:text="10s" />
|
android:text="10s" />
|
||||||
|
|
||||||
<com.google.android.material.chip.Chip
|
<com.google.android.material.chip.Chip
|
||||||
@@ -161,6 +165,8 @@
|
|||||||
style="@style/Widget.Material3.Chip.Suggestion.Elevated"
|
style="@style/Widget.Material3.Chip.Suggestion.Elevated"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:minWidth="56dp"
|
||||||
|
app:chipBackgroundColor="@color/chip_duration_bg"
|
||||||
android:text="15s" />
|
android:text="15s" />
|
||||||
|
|
||||||
<com.google.android.material.chip.Chip
|
<com.google.android.material.chip.Chip
|
||||||
@@ -168,6 +174,8 @@
|
|||||||
style="@style/Widget.Material3.Chip.Suggestion.Elevated"
|
style="@style/Widget.Material3.Chip.Suggestion.Elevated"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:minWidth="56dp"
|
||||||
|
app:chipBackgroundColor="@color/chip_duration_bg"
|
||||||
android:text="30s" />
|
android:text="30s" />
|
||||||
</com.google.android.material.chip.ChipGroup>
|
</com.google.android.material.chip.ChipGroup>
|
||||||
</HorizontalScrollView>
|
</HorizontalScrollView>
|
||||||
|
|||||||
@@ -5,11 +5,6 @@
|
|||||||
<item name="colorSecondary">@color/md_theme_light_secondary</item>
|
<item name="colorSecondary">@color/md_theme_light_secondary</item>
|
||||||
<item name="android:statusBarColor">@color/color_gradient_start</item>
|
<item name="android:statusBarColor">@color/color_gradient_start</item>
|
||||||
<item name="android:windowLightStatusBar">true</item>
|
<item name="android:windowLightStatusBar">true</item>
|
||||||
<item name="chipStyle">@style/ChipDuration</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="ChipDuration" parent="Widget.Material3.Chip.Suggestion.Elevated">
|
|
||||||
<item name="chipBackground">@drawable/chip_duration_bg</item>
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<color name="md_theme_light_primary">#2E7D32</color>
|
<color name="md_theme_light_primary">#2E7D32</color>
|
||||||
|
|||||||
Reference in New Issue
Block a user