Archived
Timetables can now be edited and deleted via sheet from SettingsFragment.kt
This commit is contained in:
@@ -90,6 +90,7 @@ xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_marginBottom="24dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:strokeColor="?attr/colorOutlineVariant"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -133,7 +133,6 @@
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:paddingVertical="8dp">
|
||||
@@ -145,23 +144,45 @@
|
||||
android:text="@string/settings_selected_timetable_header"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/text_layout_timetable"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/settings_selected_timetable_hint"
|
||||
app:boxStrokeColor="@color/selector_text_input"
|
||||
app:hintTextColor="@color/selector_text_input">
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.textfield.MaterialAutoCompleteTextView
|
||||
android:id="@+id/auto_complete_timetable"
|
||||
android:layout_width="match_parent"
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/text_layout_timetable"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/colorOnSurfaceVariant"
|
||||
android:inputType="none"/>
|
||||
android:layout_weight="1"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:hint="@string/settings_selected_timetable_hint"
|
||||
app:boxStrokeColor="@color/selector_text_input"
|
||||
app:hintTextColor="@color/selector_text_input">
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
<com.google.android.material.textfield.MaterialAutoCompleteTextView
|
||||
android:id="@+id/auto_complete_timetable"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/colorOnSurfaceVariant"
|
||||
android:inputType="none"/>
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
style="@style/Widget.Material3.Button.IconButton.Outlined"
|
||||
android:id="@+id/button_edit_timetable"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:minWidth="0dp"
|
||||
app:icon="@drawable/edit"
|
||||
app:iconPadding="0dp"
|
||||
app:strokeColor="?attr/colorOutlineVariant"
|
||||
app:iconTint="?attr/colorOnSurfaceVariant"
|
||||
tools:ignore="UnusedAttribute"
|
||||
android:tooltipText="@string/settings_selected_timetable_edit_button_hint"/>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/sheet"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.google.android.material.bottomsheet.BottomSheetDragHandleView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
style="@style/SheetCloseButton"
|
||||
android:id="@+id/button_cancel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/sheet_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="22sp"
|
||||
android:paddingHorizontal="24dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:fontFamily="@font/lato_blackitalic"
|
||||
android:text="@string/settings_timetable_sheet_header"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/button_cancel"/>
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:scrollbars="vertical">
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="16dp"
|
||||
android:paddingHorizontal="24dp">
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
||||
android:id="@+id/text_layout_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:hint="@string/settings_selected_timetable_hint"
|
||||
app:boxStrokeColor="@color/selector_text_input"
|
||||
app:hintTextColor="@color/selector_text_input">
|
||||
|
||||
<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"/>
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:id="@+id/button_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="end"
|
||||
android:layout_marginVertical="8dp"
|
||||
android:animateLayoutChanges="true">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button_delete"
|
||||
style="@style/Widget.Material3.Button.OutlinedButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="@string/delete"
|
||||
app:icon="@drawable/delete"
|
||||
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"/>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
@@ -248,6 +248,12 @@
|
||||
|
||||
<string name="settings_selected_timetable_header">Wähle, welchen Stundenplan einzusehen</string>
|
||||
<string name="settings_selected_timetable_hint">Stundenplan</string>
|
||||
<string name="settings_selected_timetable_edit_button_hint">Stundenplan bearbeiten</string>
|
||||
<string name="settings_timetable_sheet_header">Diesen Stundenplan bearbeiten</string>
|
||||
<string name="settings_timetable_edit_fail">Es gibt keinen Stundenplan zum bearbeiten!</string>
|
||||
<string name="settings_timetable_sheet_confirm_save">Stundenplan wurde aktualisiert.</string>
|
||||
<string name="settings_timetable_sheet_confirm_delete">Stundenplan wurde gelöscht.</string>
|
||||
<string name="settings_timetable_sheet_delete_confirm">Sicher?</string>
|
||||
|
||||
<string name="settings_current_day_title">Starte Stundenplan am heutigen Tag</string>
|
||||
<string name="settings_current_day_subtitle">Ansonsten wird Montag beim Start angezeigt</string>
|
||||
|
||||
@@ -253,6 +253,12 @@
|
||||
|
||||
<string name="settings_selected_timetable_header">Select which timetable to display</string>
|
||||
<string name="settings_selected_timetable_hint">Timetable</string>
|
||||
<string name="settings_selected_timetable_edit_button_hint">Edit timetable</string>
|
||||
<string name="settings_timetable_sheet_header">Edit this timetable</string>
|
||||
<string name="settings_timetable_edit_fail">There is no timetable to edit!</string>
|
||||
<string name="settings_timetable_sheet_confirm_save">Timetable has been updated.</string>
|
||||
<string name="settings_timetable_sheet_confirm_delete">Timetable has been deleted.</string>
|
||||
<string name="settings_timetable_sheet_delete_confirm">Sure?</string>
|
||||
|
||||
<string name="settings_current_day_title">Launch timetable on current day</string>
|
||||
<string name="settings_current_day_subtitle">If unselected, Monday will be shown on launch instead</string>
|
||||
|
||||
Reference in New Issue
Block a user