Changed filter chip colour, but when pressed, the primary colour needs to be changed to a more desaturated tint

This commit is contained in:
denizk0461
2023-04-20 12:19:44 +02:00
parent de1b5f8005
commit b5f5e06b7f
7 changed files with 46 additions and 100 deletions
@@ -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="?attr/colorPrimary" />
<item android:color="?attr/colorBackground" />
</selector>
@@ -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="@android:color/transparent" />
<item android:color="?attr/colorTextHintLighter" />
</selector>
+10 -10
View File
@@ -50,70 +50,70 @@
android:animateLayoutChanges="true">
<com.google.android.material.chip.Chip
style="@style/Widget.Material3.Chip.Filter"
style="@style/ChipStyle"
android:id="@+id/chip_pref_fair"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/pref_fair"/>
<com.google.android.material.chip.Chip
style="@style/Widget.Material3.Chip.Filter"
style="@style/ChipStyle"
android:id="@+id/chip_pref_fish"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/pref_fish"/>
<com.google.android.material.chip.Chip
style="@style/Widget.Material3.Chip.Filter"
style="@style/ChipStyle"
android:id="@+id/chip_pref_poultry"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/pref_poultry"/>
<com.google.android.material.chip.Chip
style="@style/Widget.Material3.Chip.Filter"
style="@style/ChipStyle"
android:id="@+id/chip_pref_lamb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/pref_lamb"/>
<com.google.android.material.chip.Chip
style="@style/Widget.Material3.Chip.Filter"
style="@style/ChipStyle"
android:id="@+id/chip_pref_vital"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/pref_vital"/>
<com.google.android.material.chip.Chip
style="@style/Widget.Material3.Chip.Filter"
style="@style/ChipStyle"
android:id="@+id/chip_pref_beef"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/pref_beef"/>
<com.google.android.material.chip.Chip
style="@style/Widget.Material3.Chip.Filter"
style="@style/ChipStyle"
android:id="@+id/chip_pref_pork"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/pref_pork"/>
<com.google.android.material.chip.Chip
style="@style/Widget.Material3.Chip.Filter"
style="@style/ChipStyle"
android:id="@+id/chip_pref_vegetarian"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/pref_vegetarian"/>
<com.google.android.material.chip.Chip
style="@style/Widget.Material3.Chip.Filter"
style="@style/ChipStyle"
android:id="@+id/chip_pref_vegan"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/pref_vegan"/>
<com.google.android.material.chip.Chip
style="@style/Widget.Material3.Chip.Filter"
style="@style/ChipStyle"
android:id="@+id/chip_pref_game"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+8
View File
@@ -41,4 +41,12 @@
<style name="DividerTheme" parent="Widget.Material3.MaterialDivider">
<item name="dividerColor">@color/colorTextHintLighterDay</item>
</style>
<style name="ChipStyle" parent="Widget.Material3.Chip.Filter">
<item name="chipStrokeColor">@color/item_chip_outline</item>
<item name="android:textColor">?attr/colorText</item>
<item name="rippleColor">?attr/colorPrimary</item>
<item name="chipBackgroundColor">@color/item_chip_background</item>
<item name="chipIconTint">?attr/colorText</item>
</style>
</resources>