Archived
Implemented separate ColorStateLists for the individual chips in CanteenFragment.kt to show their distinct colours when clicked
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:color="?attr/colorContainerBeef" android:state_checked="true"/>
|
||||
<item android:color="?android: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:color="?attr/colorOnContainerBeef" android:state_checked="true"/>
|
||||
<item android:color="?attr/colorText"/>
|
||||
</selector>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:color="?attr/colorContainerFair" android:state_checked="true"/>
|
||||
<item android:color="?android: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:color="?attr/colorOnContainerFair" android:state_checked="true"/>
|
||||
<item android:color="?attr/colorText"/>
|
||||
</selector>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:color="?attr/colorContainerFish" android:state_checked="true"/>
|
||||
<item android:color="?android: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:color="?attr/colorOnContainerFish" android:state_checked="true"/>
|
||||
<item android:color="?attr/colorText"/>
|
||||
</selector>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:color="?attr/colorContainerGame" android:state_checked="true"/>
|
||||
<item android:color="?android: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:color="?attr/colorOnContainerGame" android:state_checked="true"/>
|
||||
<item android:color="?attr/colorText"/>
|
||||
</selector>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:color="?attr/colorContainerLamb" android:state_checked="true"/>
|
||||
<item android:color="?android: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:color="?attr/colorOnContainerLamb" android:state_checked="true"/>
|
||||
<item android:color="?attr/colorText"/>
|
||||
</selector>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:color="?attr/colorContainerPork" android:state_checked="true"/>
|
||||
<item android:color="?android: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:color="?attr/colorOnContainerPork" android:state_checked="true"/>
|
||||
<item android:color="?attr/colorText"/>
|
||||
</selector>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:color="?attr/colorContainerPoultry" android:state_checked="true"/>
|
||||
<item android:color="?android: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:color="?attr/colorOnContainerPoultry" android:state_checked="true"/>
|
||||
<item android:color="?attr/colorText"/>
|
||||
</selector>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:color="?attr/colorContainerVegan" android:state_checked="true"/>
|
||||
<item android:color="?android: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:color="?attr/colorOnContainerVegan" android:state_checked="true"/>
|
||||
<item android:color="?attr/colorText"/>
|
||||
</selector>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:color="?attr/colorContainerVegetarian" android:state_checked="true"/>
|
||||
<item android:color="?android: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:color="?attr/colorOnContainerVegetarian" android:state_checked="true"/>
|
||||
<item android:color="?attr/colorText"/>
|
||||
</selector>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:color="?attr/colorContainerVital" android:state_checked="true"/>
|
||||
<item android:color="?android: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:color="?attr/colorOnContainerVital" android:state_checked="true"/>
|
||||
<item android:color="?attr/colorText"/>
|
||||
</selector>
|
||||
@@ -1,12 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context=".activity.MainActivity">
|
||||
|
||||
<include layout="@layout/content_main"
|
||||
android:id="@+id/content_main"/>
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/nav_host_fragment_content_main"
|
||||
android:name="androidx.navigation.fragment.NavHostFragment"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:defaultNavHost="true"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@+id/nav_view"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
<com.google.android.material.bottomnavigation.BottomNavigationView
|
||||
android:id="@+id/nav_view"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:menu="@menu/nav_view_items"
|
||||
app:labelVisibilityMode="selected"
|
||||
app:itemTextColor="?attr/colorOnSurfaceVariant"
|
||||
android:layout_gravity="bottom"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,30 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/nav_host_fragment_content_main"
|
||||
android:name="androidx.navigation.fragment.NavHostFragment"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:defaultNavHost="true"
|
||||
app:layout_constraintBottom_toTopOf="@+id/nav_view"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<com.google.android.material.bottomnavigation.BottomNavigationView
|
||||
android:id="@+id/nav_view"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:menu="@menu/nav_view_items"
|
||||
app:labelVisibilityMode="selected"
|
||||
app:itemTextColor="?attr/colorOnSurfaceVariant"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -13,6 +13,14 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button_canteen_picker"
|
||||
style="@style/Widget.Material3.Button.TextButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="18sp"
|
||||
android:fontFamily="@font/lato_bolditalic"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/app_title_bar"
|
||||
android:layout_width="match_parent"
|
||||
@@ -20,8 +28,7 @@
|
||||
android:text="@string/title_food"
|
||||
android:textSize="32sp"
|
||||
android:fontFamily="@font/lato_bolditalic"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginTop="16dp"/>
|
||||
android:layout_marginHorizontal="16dp"/>
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/day_tab_layout"
|
||||
@@ -31,16 +38,6 @@
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button_canteen_picker"
|
||||
style="@style/Widget.Material3.Button.TextButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="18sp"
|
||||
android:fontFamily="@font/lato_bolditalic"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
style="@style/Widget.Material3.Button.TextButton"
|
||||
android:id="@+id/button_info"
|
||||
@@ -97,106 +94,127 @@
|
||||
android:id="@+id/chips_preference"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:animateLayoutChanges="true">
|
||||
android:animateLayoutChanges="true"
|
||||
android:paddingHorizontal="8dp">
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
style="@style/Widget.Material3.Chip.Filter"
|
||||
style="@style/FilterChipNoCheck"
|
||||
android:id="@+id/chip_pref_fair"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:chipIcon="@drawable/handshake"
|
||||
app:chipIconEnabled="true"
|
||||
app:chipIconTint="?attr/colorText"
|
||||
android:textColor="@color/list_chip_fair_text"
|
||||
app:chipIconTint="@color/list_chip_fair_text"
|
||||
app:chipBackgroundColor="@color/list_chip_fair_bg"
|
||||
android:text="@string/pref_fair"/>
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
style="@style/Widget.Material3.Chip.Filter"
|
||||
style="@style/FilterChipNoCheck"
|
||||
android:id="@+id/chip_pref_fish"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:chipIcon="@drawable/fish"
|
||||
app:chipIconEnabled="true"
|
||||
app:chipIconTint="?attr/colorText"
|
||||
android:textColor="@color/list_chip_fish_text"
|
||||
app:chipIconTint="@color/list_chip_fish_text"
|
||||
app:chipBackgroundColor="@color/list_chip_fish_bg"
|
||||
android:text="@string/pref_fish"/>
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
style="@style/Widget.Material3.Chip.Filter"
|
||||
style="@style/FilterChipNoCheck"
|
||||
android:id="@+id/chip_pref_poultry"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:chipIcon="@drawable/chicken"
|
||||
app:chipIconEnabled="true"
|
||||
app:chipIconTint="?attr/colorText"
|
||||
android:textColor="@color/list_chip_poultry_text"
|
||||
app:chipIconTint="@color/list_chip_poultry_text"
|
||||
app:chipBackgroundColor="@color/list_chip_poultry_bg"
|
||||
android:text="@string/pref_poultry"/>
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
style="@style/Widget.Material3.Chip.Filter"
|
||||
style="@style/FilterChipNoCheck"
|
||||
android:id="@+id/chip_pref_lamb"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:chipIcon="@drawable/sheep"
|
||||
app:chipIconEnabled="true"
|
||||
app:chipIconTint="?attr/colorText"
|
||||
android:textColor="@color/list_chip_lamb_text"
|
||||
app:chipIconTint="@color/list_chip_lamb_text"
|
||||
app:chipBackgroundColor="@color/list_chip_lamb_bg"
|
||||
android:text="@string/pref_lamb"/>
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
style="@style/Widget.Material3.Chip.Filter"
|
||||
style="@style/FilterChipNoCheck"
|
||||
android:id="@+id/chip_pref_vital"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:chipIcon="@drawable/yoga"
|
||||
app:chipIconEnabled="true"
|
||||
app:chipIconTint="?attr/colorText"
|
||||
android:textColor="@color/list_chip_vital_text"
|
||||
app:chipIconTint="@color/list_chip_vital_text"
|
||||
app:chipBackgroundColor="@color/list_chip_vital_bg"
|
||||
android:text="@string/pref_vital"/>
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
style="@style/Widget.Material3.Chip.Filter"
|
||||
style="@style/FilterChipNoCheck"
|
||||
android:id="@+id/chip_pref_beef"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:chipIcon="@drawable/cow"
|
||||
app:chipIconEnabled="true"
|
||||
app:chipIconTint="?attr/colorText"
|
||||
android:textColor="@color/list_chip_beef_text"
|
||||
app:chipIconTint="@color/list_chip_beef_text"
|
||||
app:chipBackgroundColor="@color/list_chip_beef_bg"
|
||||
android:text="@string/pref_beef"/>
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
style="@style/Widget.Material3.Chip.Filter"
|
||||
style="@style/FilterChipNoCheck"
|
||||
android:id="@+id/chip_pref_pork"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:chipIcon="@drawable/pig"
|
||||
app:chipIconEnabled="true"
|
||||
app:chipIconTint="?attr/colorText"
|
||||
android:textColor="@color/list_chip_pork_text"
|
||||
app:chipIconTint="@color/list_chip_pork_text"
|
||||
app:chipBackgroundColor="@color/list_chip_pork_bg"
|
||||
android:text="@string/pref_pork"/>
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
style="@style/Widget.Material3.Chip.Filter"
|
||||
style="@style/FilterChipNoCheck"
|
||||
android:id="@+id/chip_pref_vegetarian"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:chipIcon="@drawable/carrot"
|
||||
app:chipIconEnabled="true"
|
||||
app:chipIconTint="?attr/colorText"
|
||||
android:textColor="@color/list_chip_vegetarian_text"
|
||||
app:chipIconTint="@color/list_chip_vegetarian_text"
|
||||
app:chipBackgroundColor="@color/list_chip_vegetarian_bg"
|
||||
android:text="@string/pref_vegetarian"/>
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
style="@style/Widget.Material3.Chip.Filter"
|
||||
style="@style/FilterChipNoCheck"
|
||||
android:id="@+id/chip_pref_vegan"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:chipIcon="@drawable/leaf"
|
||||
app:chipIconEnabled="true"
|
||||
app:chipIconTint="?attr/colorText"
|
||||
android:textColor="@color/list_chip_vegan_text"
|
||||
app:chipIconTint="@color/list_chip_vegan_text"
|
||||
app:chipBackgroundColor="@color/list_chip_vegan_bg"
|
||||
android:text="@string/pref_vegan"/>
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
style="@style/Widget.Material3.Chip.Filter"
|
||||
style="@style/FilterChipNoCheck"
|
||||
android:id="@+id/chip_pref_game"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:chipIcon="@drawable/deer"
|
||||
app:chipIconEnabled="true"
|
||||
app:chipIconTint="?attr/colorText"
|
||||
android:textColor="@color/list_chip_game_text"
|
||||
app:chipIconTint="@color/list_chip_game_text"
|
||||
app:chipBackgroundColor="@color/list_chip_game_bg"
|
||||
android:text="@string/pref_game"/>
|
||||
|
||||
</com.google.android.material.chip.ChipGroup>
|
||||
|
||||
@@ -155,5 +155,9 @@
|
||||
|
||||
<string name="settings_app_version">App-Version</string>
|
||||
|
||||
<string name="with_love">mit ♡️ aus Bremen-Osterholz\von denizk0461 \\__*</string>
|
||||
<string name="settings_app_version_10">oh jaa</string>
|
||||
<string name="settings_app_version_15">klick weiter</string>
|
||||
<string name="settings_app_version_121">Solltest du nicht für deine Klausuren lernen?</string>
|
||||
|
||||
<string name="with_love">mit ♡️ aus Bremen-Osterholz\nvon denizk0461 \\__*</string>
|
||||
</resources>
|
||||
@@ -162,6 +162,15 @@
|
||||
|
||||
<string name="settings_app_version">App Version</string>
|
||||
|
||||
<string name="settings_app_version_10">ahhh yes</string>
|
||||
<string name="settings_app_version_15">keep clicking</string>
|
||||
<string name="settings_app_version_20" translatable="false">^_^</string>
|
||||
<string name="settings_app_version_30" translatable="false">^_____^</string>
|
||||
<string name="settings_app_version_90" translatable="false">(⎌ℕ⎌)</string>
|
||||
<string name="settings_app_version_121">Shouldn\'t you study for your exams?</string>
|
||||
<string name="settings_app_version_165" translatable="false">◢◤</string>
|
||||
<string name="settings_app_version_200" translatable="false">\\__*</string>
|
||||
|
||||
<string name="with_love">with ♡️ from Bremen-Osterholz\nmade by denizk0461 \\__*</string>
|
||||
|
||||
<string name="de4thSpirit" translatable="false">In our hearts, she lives forevermore</string>
|
||||
|
||||
@@ -86,4 +86,9 @@
|
||||
<style name="DividerTheme" parent="Widget.Material3.MaterialDivider">
|
||||
<item name="dividerColor">@color/md_theme_light_outlineVariant</item>
|
||||
</style>
|
||||
|
||||
<style name="FilterChipNoCheck" parent="Widget.Material3.Chip.Filter">
|
||||
<item name="checkedIconEnabled">false</item>
|
||||
<item name="checkedIcon">@null</item>
|
||||
</style>
|
||||
</resources>
|
||||
Reference in New Issue
Block a user