All sheets now have the ability to scroll; a custom selectable item background has been added to clickable views to get a custom coloured ripple effect on click

This commit is contained in:
denizk0461
2023-05-01 22:19:44 +02:00
parent b0631d323e
commit 5a9ab267aa
16 changed files with 236 additions and 160 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 353 KiB

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/selectable_item_ripple" />
</selector>
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/selectable_item_ripple_highlighted" />
</selector>
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple
xmlns:android="http://schemas.android.com/apk/res/android"
android:color="?attr/colorSecondaryContainer"/>
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple
xmlns:android="http://schemas.android.com/apk/res/android"
android:color="?attr/colorSecondary"/>
@@ -70,7 +70,7 @@
android:id="@+id/button_refresh_schedule"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:background="@drawable/selectable_item_background"
android:clickable="true"
android:focusable="true"
android:orientation="vertical"
@@ -174,7 +174,7 @@
android:id="@+id/button_allergens_config"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:background="@drawable/selectable_item_background"
android:clickable="true"
android:focusable="true"
android:orientation="vertical"
@@ -407,7 +407,7 @@
android:id="@+id/button_data_handling"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:background="@drawable/selectable_item_background"
android:clickable="true"
android:focusable="true"
android:orientation="vertical"
@@ -434,7 +434,7 @@
android:id="@+id/button_licences"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:background="@drawable/selectable_item_background"
android:clickable="true"
android:focusable="true"
android:orientation="vertical"
@@ -462,7 +462,7 @@
android:id="@+id/button_app_version"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:background="@drawable/selectable_item_background"
android:clickable="true"
android:focusable="true"
android:orientation="vertical"
@@ -6,7 +6,7 @@
android:orientation="horizontal"
android:clickable="true"
android:focusable="true"
android:background="?android:attr/selectableItemBackground"
android:background="@drawable/selectable_item_background"
android:paddingHorizontal="16dp"
android:paddingVertical="2dp">
+3
View File
@@ -14,9 +14,12 @@
style="@style/Widget.Material3.CardView.Outlined">
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/linear_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:clickable="true"
android:focusable="true"
android:padding="16dp">
<TextView
+35 -26
View File
@@ -5,7 +5,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="16dp"
android:paddingHorizontal="24dp"
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">
<com.google.android.material.bottomsheet.BottomSheetDragHandleView
@@ -19,7 +18,8 @@
android:layout_height="wrap_content"
android:textSize="22sp"
android:fontFamily="@font/lato_blackitalic"
android:layout_marginBottom="2dp"/>
android:layout_marginBottom="2dp"
android:paddingHorizontal="24dp"/>
<TextView
android:id="@+id/text_title"
@@ -27,35 +27,44 @@
android:layout_height="wrap_content"
android:textSize="22sp"
android:fontFamily="@font/lato_bolditalic"
android:layout_marginBottom="8dp"/>
android:layout_marginBottom="8dp"
android:paddingHorizontal="24dp"/>
<!-- <androidx.core.widget.NestedScrollView-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:scrollbars="vertical">-->
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/container_preferences"
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginBottom="8dp"/>
android:scrollbars="vertical">
<TextView
android:id="@+id/text_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"/>
<!-- android:textSize="16sp"-->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingHorizontal="24dp">
<TextView
android:id="@+id/text_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20sp"
android:fontFamily="@font/lato_bolditalic"
android:layout_marginTop="4dp"/>
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/container_preferences"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginBottom="8dp"/>
<!-- </androidx.core.widget.NestedScrollView>-->
<TextView
android:id="@+id/text_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"/>
<!-- android:textSize="16sp"-->
<TextView
android:id="@+id/text_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20sp"
android:fontFamily="@font/lato_bolditalic"
android:layout_marginTop="4dp"/>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.core.widget.NestedScrollView>
</LinearLayout>
+132 -116
View File
@@ -5,8 +5,6 @@
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:paddingBottom="16dp"
android:paddingHorizontal="24dp"
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">
<com.google.android.material.bottomsheet.BottomSheetDragHandleView
@@ -25,7 +23,8 @@
android:textSize="22sp"
android:fontFamily="@font/lato_blackitalic"
android:text="@string/sheet_schedule_update_header"
android:layout_gravity="start|center_vertical"/>
android:layout_gravity="start|center_vertical"
android:paddingHorizontal="24dp"/>
<com.google.android.material.button.MaterialButton
style="@style/Widget.Material3.Button.TextButton"
@@ -36,146 +35,163 @@
app:icon="@drawable/cross"
app:iconPadding="0dp"
android:layout_gravity="end|center_vertical"
app:iconTint="?attr/colorOnSurfaceVariant"/>
app:iconTint="?attr/colorOnSurfaceVariant"
android:paddingHorizontal="24dp"/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:hint="@string/sheet_schedule_update_title_hint"
app:boxStrokeColor="@color/selector_text_input"
app:hintTextColor="@color/selector_text_input">
android:scrollbars="vertical">
<com.google.android.material.textfield.TextInputEditText
style="@style/ThemeOverlay.Material3.TextInputEditText.OutlinedBox"
android:textColor="?attr/colorOnSurfaceVariant"
android:id="@+id/edit_text_title"
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</com.google.android.material.textfield.TextInputLayout>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginBottom="8dp">
<!-- lecturers -->
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginBottom="8dp"
android:layout_marginEnd="4dp"
android:maxLines="1"
android:scrollHorizontally="true"
android:hint="@string/sheet_schedule_update_lecturers_hint"
app:boxStrokeColor="@color/selector_text_input"
app:hintTextColor="@color/selector_text_input">
android:orientation="vertical"
android:paddingBottom="16dp"
android:paddingHorizontal="24dp">
<com.google.android.material.textfield.TextInputEditText
style="@style/ThemeOverlay.Material3.TextInputEditText.OutlinedBox"
android:textColor="?attr/colorOnSurfaceVariant"
android:id="@+id/edit_text_lecturers"
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text"/>
android:layout_marginBottom="8dp"
android:hint="@string/sheet_schedule_update_title_hint"
app:boxStrokeColor="@color/selector_text_input"
app:hintTextColor="@color/selector_text_input">
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputEditText
style="@style/ThemeOverlay.Material3.TextInputEditText.OutlinedBox"
android:textColor="?attr/colorOnSurfaceVariant"
android:id="@+id/edit_text_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<!-- room -->
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginBottom="8dp"
android:maxLines="1"
android:scrollHorizontally="true"
android:hint="@string/sheet_schedule_update_room_hint"
app:boxStrokeColor="@color/selector_text_input"
app:hintTextColor="@color/selector_text_input">
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputEditText
style="@style/ThemeOverlay.Material3.TextInputEditText.OutlinedBox"
android:textColor="?attr/colorOnSurfaceVariant"
android:id="@+id/edit_text_room"
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text"/>
android:orientation="horizontal"
android:layout_marginBottom="8dp">
</com.google.android.material.textfield.TextInputLayout>
<!-- lecturers -->
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginBottom="8dp"
android:layout_marginEnd="4dp"
android:maxLines="1"
android:scrollHorizontally="true"
android:hint="@string/sheet_schedule_update_lecturers_hint"
app:boxStrokeColor="@color/selector_text_input"
app:hintTextColor="@color/selector_text_input">
</androidx.appcompat.widget.LinearLayoutCompat>
<com.google.android.material.textfield.TextInputEditText
style="@style/ThemeOverlay.Material3.TextInputEditText.OutlinedBox"
android:textColor="?attr/colorOnSurfaceVariant"
android:id="@+id/edit_text_lecturers"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text"/>
<com.google.android.material.button.MaterialButton
android:id="@+id/button_academic_quarter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
app:icon="@drawable/lightbulb"
android:text="@string/sheet_schedule_update_hint_quarter"
android:layout_gravity="end"/>
</com.google.android.material.textfield.TextInputLayout>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginBottom="8dp">
<!-- room -->
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginBottom="8dp"
android:maxLines="1"
android:scrollHorizontally="true"
android:hint="@string/sheet_schedule_update_room_hint"
app:boxStrokeColor="@color/selector_text_input"
app:hintTextColor="@color/selector_text_input">
<com.google.android.material.button.MaterialButton
style="@style/Widget.Material3.Button.OutlinedButton"
android:id="@+id/button_time_start"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
app:strokeColor="?attr/colorOutlineVariant"/>
<com.google.android.material.textfield.TextInputEditText
style="@style/ThemeOverlay.Material3.TextInputEditText.OutlinedBox"
android:textColor="?attr/colorOnSurfaceVariant"
android:id="@+id/edit_text_room"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/sheet_schedule_update_timeslot_middle"
android:layout_marginHorizontal="8dp"/>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.button.MaterialButton
style="@style/Widget.Material3.Button.OutlinedButton"
android:id="@+id/button_time_end"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
app:strokeColor="?attr/colorOutlineVariant"/>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
<com.google.android.material.button.MaterialButton
android:id="@+id/button_academic_quarter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
app:icon="@drawable/lightbulb"
android:text="@string/sheet_schedule_update_hint_quarter"
android:layout_gravity="end"/>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="end"
android:layout_marginBottom="8dp">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginBottom="8dp">
<com.google.android.material.button.MaterialButton
android:id="@+id/button_delete"
style="@style/Widget.Material3.Button.TonalButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/delete"
app:icon="@drawable/delete"
android:layout_marginEnd="8dp"/>
<com.google.android.material.button.MaterialButton
style="@style/Widget.Material3.Button.OutlinedButton"
android:id="@+id/button_time_start"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
app:strokeColor="?attr/colorOutlineVariant"/>
<com.google.android.material.button.MaterialButton
android:id="@+id/button_save"
style="@style/Widget.Material3.Button.TonalButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/save"
app:icon="@drawable/save"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/sheet_schedule_update_timeslot_middle"
android:layout_marginHorizontal="8dp"/>
</androidx.appcompat.widget.LinearLayoutCompat>
<com.google.android.material.button.MaterialButton
style="@style/Widget.Material3.Button.OutlinedButton"
android:id="@+id/button_time_end"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
app:strokeColor="?attr/colorOutlineVariant"/>
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="end"
android:layout_marginBottom="8dp">
<com.google.android.material.button.MaterialButton
android:id="@+id/button_delete"
style="@style/Widget.Material3.Button.TonalButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/delete"
app:icon="@drawable/delete"
android:layout_marginEnd="8dp"/>
<com.google.android.material.button.MaterialButton
android:id="@+id/button_save"
style="@style/Widget.Material3.Button.TonalButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/save"
app:icon="@drawable/save"/>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.core.widget.NestedScrollView>
</androidx.appcompat.widget.LinearLayoutCompat>
+4 -3
View File
@@ -130,13 +130,14 @@
<string name="refresh_schedule_title">Aktualisiere Deinen Stud.IP-Stundenplan</string>
<string name="refresh_schedule_subtitle">Dies wird alle Anpassungen löschen!</string>
<string name="settings_highlight_title">Markiere meinen nächsten Kurs</string>
<string name="settings_highlight_subtitle">Funktioniert nur wenn Kurse sich nicht überschneiden!</string>
<string name="settings_highlight_title">Markiere den nächsten Kurs</string>
<string name="settings_highlight_subtitle">Funktioniert nur, wenn Kurse sich nicht überschneiden!</string>
<string name="allergens_config_title">Verstecke Angebote mit bestimmten Allergenen</string>
<string name="allergens_config_subtitle">Angebote mit ausgeschlossenen Allergenen werden Dir nicht angezeigt</string>
<string name="allergens_config_header">Stelle ein, welche Allergene Du vermeiden möchtest</string>
<string name="allergens_config_header">Wähle, welche Allergene Du vermeiden möchtest</string>
<string name="allergens_config_content">Achtung: bitte verlasse Dich nicht vollständig auf diese Funktion. Stelle immer in der Mensa, die Du besuchst, sicher, dass die Stoffe, auf die Du allergisch reagierst, nicht in deren Angeboten vorhanden sind.</string>
<string name="allergens_config_confirmation">Deine Allergene wurden gespeichert.</string>
<string name="settings_allergens_title">Markiere Angebote mit Allergenen mit einem Stern*</string>
<string name="settings_allergens_subtitle">Wird auch für Zusatzstoffe genutzt</string>
+3 -2
View File
@@ -140,14 +140,15 @@
<string name="allergens_config_title">Hide offers containing certain allergens</string>
<string name="allergens_config_subtitle">Offers with excluded allergens won\'t be shown to you</string>
<string name="allergens_config_header">Set which allergens you\'d like to avoid</string>
<string name="allergens_config_header">Select which allergens you\'d like to avoid</string>
<string name="allergens_config_content">Note: please don\'t entirely rely on this. Always check the notices displayed at the canteen you\'re visiting to confirm substances you may be allergic against are not present in their offerings.</string>
<string name="allergens_config_confirmation">Your allergen settings have been saved.</string>
<string name="settings_allergens_title">Mark offers with allergens with a star*</string>
<string name="settings_allergens_subtitle">Also applies to additives</string>
<string name="settings_pref_colour_title">Colour dietary preferences</string>
<string name="settings_pref_colour_subtitle">This colours the icons similar to the website</string> <!-- TODO this text sucks, DE too -->
<string name="settings_pref_colour_subtitle">This colours the icons similar to how they look the website</string> <!-- TODO this text sucks, DE too -->
<string name="settings_launch_canteen_title">Show canteen plan on app launch</string>
<string name="settings_launch_canteen_subtitle">Otherwise your schedule will be shown at launch</string>