Added app language support (I think); fragments rely on Bundles instead of constructor parameters to get data, mitigating a source of crashes

This commit is contained in:
denizk0461
2023-04-30 22:47:59 +02:00
parent 7243df0f06
commit 079e66ad50
23 changed files with 619 additions and 472 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 420 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 414 KiB

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/image_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:scaleType="fitCenter"/>
</androidx.constraintlayout.widget.ConstraintLayout>
@@ -104,6 +104,9 @@
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:text="@string/pref_fair"/>
<com.google.android.material.chip.Chip
@@ -111,6 +114,9 @@
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:text="@string/pref_fish"/>
<com.google.android.material.chip.Chip
@@ -118,6 +124,9 @@
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:text="@string/pref_poultry"/>
<com.google.android.material.chip.Chip
@@ -125,6 +134,9 @@
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:text="@string/pref_lamb"/>
<com.google.android.material.chip.Chip
@@ -132,6 +144,9 @@
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:text="@string/pref_vital"/>
<com.google.android.material.chip.Chip
@@ -139,6 +154,9 @@
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:text="@string/pref_beef"/>
<com.google.android.material.chip.Chip
@@ -146,6 +164,9 @@
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:text="@string/pref_pork"/>
<com.google.android.material.chip.Chip
@@ -153,6 +174,9 @@
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:text="@string/pref_vegetarian"/>
<com.google.android.material.chip.Chip
@@ -160,6 +184,9 @@
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:text="@string/pref_vegan"/>
<com.google.android.material.chip.Chip
@@ -167,6 +194,9 @@
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:text="@string/pref_game"/>
</com.google.android.material.chip.ChipGroup>
+360 -351
View File
@@ -1,471 +1,480 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.appcompat.widget.LinearLayoutCompat 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"
tools:context=".fragment.SettingsFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".fragment.SettingsFragment">
android:orientation="vertical">
<androidx.appcompat.widget.LinearLayoutCompat
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true">
android:layout_height="wrap_content"
android:fitsSystemWindows="true">
<TextView
android:id="@+id/app_title_bar"
android:layout_width="match_parent"
android:layout_height="48dp"
android:text="@string/title_settings"
android:textSize="32sp"
android:fontFamily="@font/lato_bolditalic"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="16dp"/>
android:layout_marginTop="16dp"
android:fontFamily="@font/lato_bolditalic"
android:text="@string/title_settings"
android:textSize="32sp" />
</com.google.android.material.appbar.AppBarLayout>
</com.google.android.material.appbar.AppBarLayout>
<!-- Stud.IP schedule settings -->
<com.google.android.material.card.MaterialCardView
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="8dp"
android:layout_marginVertical="4dp"
style="@style/Widget.Material3.CardView.Outlined">
android:orientation="vertical">
<androidx.appcompat.widget.LinearLayoutCompat
<!-- Stud.IP schedule settings -->
<com.google.android.material.card.MaterialCardView
style="@style/Widget.Material3.CardView.Outlined"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="8dp">
android:layout_marginHorizontal="8dp"
android:layout_marginVertical="4dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:textSize="22sp"
android:fontFamily="@font/lato_bolditalic"
android:text="@string/settings_schedule"
android:layout_marginTop="16dp"
android:layout_marginHorizontal="16dp"/>
<com.google.android.material.divider.MaterialDivider
style="@style/DividerTheme"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"/>
<!-- Refresh schedule -->
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/button_refresh_schedule"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:clickable="true"
android:focusable="true"
android:paddingHorizontal="16dp"
android:paddingVertical="8dp"
android:background="?android:attr/selectableItemBackground">
android:paddingBottom="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="16dp"
android:layout_marginBottom="8dp"
android:fontFamily="@font/lato_bolditalic"
android:text="@string/refresh_schedule_title"/>
android:text="@string/settings_schedule"
android:textSize="22sp" />
<TextView
android:layout_width="wrap_content"
<com.google.android.material.divider.MaterialDivider
style="@style/DividerTheme"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="16sp"
android:text="@string/refresh_schedule_subtitle"/>
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- Highlight course -->
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layout_highlight"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="16dp"
android:paddingVertical="8dp">
android:layout_marginHorizontal="16dp" />
<!-- Refresh schedule -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:id="@+id/button_refresh_schedule"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:orientation="vertical"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/switch_highlight"
android:layout_marginEnd="8dp">
android:paddingHorizontal="16dp"
android:paddingVertical="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:fontFamily="@font/lato_bolditalic"
android:text="@string/settings_highlight_title"/>
android:text="@string/refresh_schedule_title"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:text="@string/settings_highlight_subtitle"/>
android:text="@string/refresh_schedule_subtitle"
android:textSize="16sp" />
</androidx.appcompat.widget.LinearLayoutCompat>
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/switch_highlight"
android:layout_width="wrap_content"
<!-- Highlight course -->
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layout_highlight"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
android:paddingHorizontal="16dp"
android:paddingVertical="8dp">
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/switch_highlight"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
</androidx.appcompat.widget.LinearLayoutCompat>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/lato_bolditalic"
android:text="@string/settings_highlight_title"
android:textSize="16sp" />
</com.google.android.material.card.MaterialCardView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/settings_highlight_subtitle"
android:textSize="16sp" />
<!-- canteen settings -->
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="8dp"
android:layout_marginVertical="4dp"
style="@style/Widget.Material3.CardView.Outlined">
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/switch_highlight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.appcompat.widget.LinearLayoutCompat>
</com.google.android.material.card.MaterialCardView>
<!-- canteen settings -->
<com.google.android.material.card.MaterialCardView
style="@style/Widget.Material3.CardView.Outlined"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="8dp">
android:layout_marginHorizontal="8dp"
android:layout_marginVertical="4dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:textSize="22sp"
android:fontFamily="@font/lato_bolditalic"
android:text="@string/settings_canteen"
android:layout_marginTop="16dp"
android:layout_marginHorizontal="16dp"/>
<com.google.android.material.divider.MaterialDivider
style="@style/DividerTheme"
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"/>
android:orientation="vertical"
android:paddingBottom="8dp">
<!-- Allergens -->
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layout_allergens"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="16dp"
android:paddingVertical="8dp">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/switch_allergens"
android:layout_marginEnd="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:fontFamily="@font/lato_bolditalic"
android:text="@string/settings_allergens_title"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:text="@string/settings_allergens_subtitle"/>
</androidx.appcompat.widget.LinearLayoutCompat>
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/switch_allergens"
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
android:layout_marginHorizontal="16dp"
android:layout_marginTop="16dp"
android:layout_marginBottom="8dp"
android:fontFamily="@font/lato_bolditalic"
android:text="@string/settings_canteen"
android:textSize="22sp" />
</androidx.constraintlayout.widget.ConstraintLayout>
<!-- Preference colouring -->
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layout_pref_colour"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="16dp"
android:paddingVertical="8dp">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
<com.google.android.material.divider.MaterialDivider
style="@style/DividerTheme"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/switch_pref_colour"
android:layout_marginEnd="8dp">
android:layout_marginHorizontal="16dp" />
<TextView
<!-- Allergens -->
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layout_allergens"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="16dp"
android:paddingVertical="8dp">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/switch_allergens"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/lato_bolditalic"
android:text="@string/settings_allergens_title"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/settings_allergens_subtitle"
android:textSize="16sp" />
</androidx.appcompat.widget.LinearLayoutCompat>
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/switch_allergens"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:fontFamily="@font/lato_bolditalic"
android:text="@string/settings_pref_colour_title"/>
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
</androidx.constraintlayout.widget.ConstraintLayout>
<!-- Preference colouring -->
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layout_pref_colour"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="16dp"
android:paddingVertical="8dp">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/switch_pref_colour"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/lato_bolditalic"
android:text="@string/settings_pref_colour_title"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/settings_pref_colour_subtitle"
android:textSize="16sp" />
</androidx.appcompat.widget.LinearLayoutCompat>
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/switch_pref_colour"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:text="@string/settings_pref_colour_subtitle"/>
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.constraintlayout.widget.ConstraintLayout>
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/switch_pref_colour"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
</androidx.appcompat.widget.LinearLayoutCompat>
</com.google.android.material.card.MaterialCardView>
<!-- miscellaneous settings -->
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="8dp"
android:layout_marginVertical="4dp"
style="@style/Widget.Material3.CardView.Outlined">
<androidx.appcompat.widget.LinearLayoutCompat
<!-- miscellaneous settings -->
<com.google.android.material.card.MaterialCardView
style="@style/Widget.Material3.CardView.Outlined"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="8dp">
android:layout_marginHorizontal="8dp"
android:layout_marginVertical="4dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:textSize="22sp"
android:fontFamily="@font/lato_bolditalic"
android:text="@string/settings_misc"
android:layout_marginTop="16dp"
android:layout_marginHorizontal="16dp"/>
<com.google.android.material.divider.MaterialDivider
style="@style/DividerTheme"
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"/>
android:orientation="vertical"
android:paddingBottom="8dp">
<!-- show canteen plan on app launch -->
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layout_launch_canteen"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="16dp"
android:paddingVertical="8dp">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="16dp"
android:layout_marginBottom="8dp"
android:fontFamily="@font/lato_bolditalic"
android:text="@string/settings_misc"
android:textSize="22sp" />
<com.google.android.material.divider.MaterialDivider
style="@style/DividerTheme"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp" />
<!-- show canteen plan on app launch -->
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layout_launch_canteen"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="16dp"
android:paddingVertical="8dp">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/switch_launch_canteen"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/lato_bolditalic"
android:text="@string/settings_launch_canteen_title"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/settings_launch_canteen_subtitle"
android:textSize="16sp" />
</androidx.appcompat.widget.LinearLayoutCompat>
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/switch_launch_canteen"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<!-- crashlytics opt-in -->
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layout_crashlytics"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="16dp"
android:paddingVertical="8dp">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/switch_crashlytics"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/lato_bolditalic"
android:text="@string/settings_crashlytics_title"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/settings_crashlytics_subtitle"
android:textSize="16sp" />
</androidx.appcompat.widget.LinearLayoutCompat>
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/switch_crashlytics"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<!-- Data handling -->
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/button_data_handling"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:orientation="vertical"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/switch_launch_canteen"
android:layout_marginEnd="8dp">
android:paddingHorizontal="16dp"
android:paddingVertical="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:fontFamily="@font/lato_bolditalic"
android:text="@string/settings_launch_canteen_title"/>
android:text="@string/settings_data_title"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:text="@string/settings_launch_canteen_subtitle"/>
android:text="@string/settings_data_subtitle"
android:textSize="16sp" />
</androidx.appcompat.widget.LinearLayoutCompat>
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/switch_launch_canteen"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
<!-- crashlytics opt-in -->
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layout_crashlytics"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="16dp"
android:paddingVertical="8dp">
<!-- Licences -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:id="@+id/button_licences"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:orientation="vertical"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/switch_crashlytics"
android:layout_marginEnd="8dp">
android:paddingHorizontal="16dp"
android:paddingVertical="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:fontFamily="@font/lato_bolditalic"
android:text="@string/settings_crashlytics_title"/>
android:text="@string/settings_licences_title"
android:textSize="16sp" />
<TextView
android:id="@+id/licences_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:text="@string/settings_crashlytics_subtitle"/>
android:text="@string/settings_licences_subtitle"
android:textSize="16sp" />
</androidx.appcompat.widget.LinearLayoutCompat>
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/switch_crashlytics"
android:layout_width="wrap_content"
<!-- App version -->
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/button_app_version"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
android:background="?android:attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:orientation="vertical"
android:paddingHorizontal="16dp"
android:paddingVertical="8dp">
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/lato_bolditalic"
android:text="@string/settings_app_version"
android:textSize="16sp" />
<!-- Data handling -->
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/button_data_handling"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:clickable="true"
android:focusable="true"
android:paddingHorizontal="16dp"
android:paddingVertical="8dp"
android:background="?android:attr/selectableItemBackground">
<TextView
android:id="@+id/app_version_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:fontFamily="@font/lato_bolditalic"
android:text="@string/settings_data_title"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:text="@string/settings_data_subtitle"/>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- Licences -->
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/button_licences"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:clickable="true"
android:focusable="true"
android:paddingHorizontal="16dp"
android:paddingVertical="8dp"
android:background="?android:attr/selectableItemBackground">
</com.google.android.material.card.MaterialCardView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:fontFamily="@font/lato_bolditalic"
android:text="@string/settings_licences_title"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="4dp"
android:layout_marginBottom="8dp"
android:text="@string/with_love"
android:textAlignment="center"
android:textSize="8sp"
tools:ignore="SmallSp" />
<TextView
android:id="@+id/licences_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:text="@string/settings_licences_subtitle"/>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.core.widget.NestedScrollView>
<!-- App version -->
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/button_app_version"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:clickable="true"
android:focusable="true"
android:paddingHorizontal="16dp"
android:paddingVertical="8dp"
android:background="?android:attr/selectableItemBackground">
</androidx.appcompat.widget.LinearLayoutCompat>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:fontFamily="@font/lato_bolditalic"
android:text="@string/settings_app_version"/>
<TextView
android:id="@+id/app_version_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"/>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
</com.google.android.material.card.MaterialCardView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="@string/with_love"
android:textSize="8sp"
android:layout_marginTop="4dp"
android:layout_marginBottom="8dp"
android:textAlignment="center"
tools:ignore="SmallSp"/>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.core.widget.NestedScrollView>
+3 -1
View File
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.appcompat.widget.LinearLayoutCompat
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="8dp"
@@ -50,4 +51,5 @@
</androidx.appcompat.widget.LinearLayoutCompat>
</com.google.android.material.card.MaterialCardView>
</androidx.appcompat.widget.LinearLayoutCompat>
+1 -1
View File
@@ -32,7 +32,7 @@
<item name="android:textColor">@color/md_theme_dark_onSurfaceVariant</item>
<item name="colorText">@color/md_theme_dark_onSurfaceVariant</item>
<item name="android:scrollbarThumbVertical">@color/md_theme_dark_onSurfaceVariant</item>
<item name="android:scrollbarThumbVertical">@color/md_theme_dark_primary</item> <!-- md_theme_dark_onSurfaceVariant -->
<item name="colorOutlineVariant">@color/md_theme_dark_outlineVariant</item>
<!-- is this correct? -->
+1 -1
View File
@@ -30,7 +30,7 @@
<item name="android:textColor">@color/md_theme_light_onSurfaceVariant</item>
<item name="colorText">@color/md_theme_light_onSurfaceVariant</item>
<item name="android:scrollbarThumbVertical">@color/md_theme_light_onSurfaceVariant</item>
<item name="android:scrollbarThumbVertical">@color/md_theme_light_primary</item> <!-- md_theme_light_onSurfaceVariant -->
<item name="colorOutlineVariant">@color/md_theme_light_outlineVariant</item>
<item name="colorErrorText">@color/md_theme_light_error</item>
+5
View File
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<locale-config xmlns:android="http://schemas.android.com/apk/res/android">
<locale android:name="en"/>
<locale android:name="de"/>
</locale-config>