Added an options menu for events; moved delete option to the new options menu

This commit is contained in:
denizk0461
2023-05-21 22:16:20 +02:00
parent e99a58de54
commit 75724ace18
15 changed files with 519 additions and 51 deletions
+5
View File
@@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#000000"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M22,5.18L10.59,16.6l-4.24,-4.24l1.41,-1.41l2.83,2.83l10,-10L22,5.18zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8c1.57,0 3.04,0.46 4.28,1.25l1.45,-1.45C16.1,2.67 14.13,2 12,2C6.48,2 2,6.48 2,12s4.48,10 10,10c1.73,0 3.36,-0.44 4.78,-1.22l-1.5,-1.5C14.28,19.74 13.17,20 12,20zM19,15h-3v2h3v3h2v-3h3v-2h-3v-3h-2V15z"/>
</vector>
+5
View File
@@ -0,0 +1,5 @@
<vector android:autoMirrored="true" android:height="24dp"
android:tint="#000000" android:viewportHeight="24"
android:viewportWidth="24" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
</vector>
+5
View File
@@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#000000"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M3,17.25V21h3.75L17.81,9.94l-3.75,-3.75L3,17.25zM20.71,7.04c0.39,-0.39 0.39,-1.02 0,-1.41l-2.34,-2.34c-0.39,-0.39 -1.02,-0.39 -1.41,0l-1.83,1.83 3.75,3.75 1.83,-1.83z"/>
</vector>
@@ -0,0 +1,206 @@
<?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:layout_width="match_parent"
android:layout_height="wrap_content"
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_dismiss"
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>
<TextView
android:id="@+id/event_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="22sp"
android:paddingHorizontal="24dp"
android:layout_marginBottom="8dp"
android:fontFamily="@font/lato_bolditalic"
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">
<!-- Edit event -->
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/button_edit_event"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/selectable_item_background"
android:clickable="true"
android:focusable="true"
android:orientation="horizontal"
android:paddingHorizontal="20dp"
android:paddingVertical="16dp">
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginHorizontal="8dp"
android:scaleType="centerInside"
android:tint="?attr/colorText"
android:src="@drawable/edit"
android:importantForAccessibility="no"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/sheet_event_action_edit_event_title"
android:textSize="16sp"/>
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- Add task -->
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/button_add_task"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/selectable_item_background"
android:clickable="true"
android:focusable="true"
android:orientation="horizontal"
android:paddingHorizontal="20dp"
android:paddingVertical="16dp">
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginHorizontal="8dp"
android:scaleType="centerInside"
android:tint="?attr/colorText"
android:src="@drawable/add_task"
android:importantForAccessibility="no"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/sheet_event_action_add_task_title"
android:textSize="16sp"/>
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- View tasks -->
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/button_view_tasks"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/selectable_item_background"
android:clickable="true"
android:focusable="true"
android:orientation="horizontal"
android:paddingHorizontal="20dp"
android:paddingVertical="16dp">
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginHorizontal="8dp"
android:scaleType="centerInside"
android:tint="?attr/colorText"
android:src="@drawable/task"
android:importantForAccessibility="no"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/sheet_event_action_view_tasks_title"
android:textSize="16sp"/>
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- Find room -->
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/button_find_room"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/selectable_item_background"
android:clickable="true"
android:focusable="true"
android:orientation="horizontal"
android:paddingHorizontal="20dp"
android:paddingVertical="16dp">
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginHorizontal="8dp"
android:scaleType="centerInside"
android:tint="?attr/colorText"
android:src="@drawable/location"
android:importantForAccessibility="no"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/sheet_event_action_find_room_title"
android:textSize="16sp"/>
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- Delete event -->
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/button_delete_event"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/selectable_item_background"
android:clickable="true"
android:focusable="true"
android:orientation="horizontal"
android:paddingHorizontal="20dp"
android:paddingVertical="16dp">
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginHorizontal="8dp"
android:scaleType="centerInside"
android:tint="?attr/colorError"
android:src="@drawable/delete"
android:importantForAccessibility="no"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/sheet_event_action_delete_event_title"
android:textSize="16sp"
android:textColor="?attr/colorError"/>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.core.widget.NestedScrollView>
</androidx.appcompat.widget.LinearLayoutCompat>
@@ -0,0 +1,96 @@
<?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_dismiss"
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>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="22sp"
android:paddingHorizontal="24dp"
android:layout_marginBottom="8dp"
android:fontFamily="@font/lato_blackitalic"
android:text="@string/sheet_event_confirm_deletion_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">
<TextView
android:id="@+id/text_confirm_deletion_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="24dp"/>
<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_marginBottom="8dp"
android:animateLayoutChanges="true">
<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_cancel"
style="@style/Widget.Material3.Button.TonalButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/cancel"
app:icon="@drawable/arrow_back"/>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.core.widget.NestedScrollView>
</androidx.appcompat.widget.LinearLayoutCompat>
@@ -187,15 +187,6 @@
android:layout_marginBottom="8dp"
android:animateLayoutChanges="true">
<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"
+10
View File
@@ -51,6 +51,16 @@
<string name="schedule_fab_add_text">Neue Veranstaltung</string>
<string name="schedule_no_events">%ss hast du keine Veranstaltungen.</string>
<string name="sheet_event_action_edit_event_title">Veranstaltung bearbeiten</string>
<string name="sheet_event_action_add_task_title">Aufgabe oder Prüfung hinzufügen</string>
<string name="sheet_event_action_view_tasks_title">Siehe Aufgaben und Prüfungen für diese Veranstaltung</string>
<string name="sheet_event_action_find_room_title">Raum für diese Veranstaltung finden</string>
<string name="sheet_event_action_delete_event_title">Veranstaltung löschen</string>
<string name="sheet_event_confirm_deletion_header">Bestätige Löschvorgang</string>
<string name="sheet_event_confirm_deletion_content">Bist du dir sicher, dass du diese Veranstaltung \'%s\' löschen möchtest?</string>
<string name="sheet_event_confirm_deletion_snack">Die Veranstaltung wurde gelöscht.</string>
<string name="save">Speichern</string>
<string name="delete">Löschen</string>
<string name="sheet_schedule_update_delete_confirm">Sicher?</string>
+10
View File
@@ -52,6 +52,16 @@
<string name="schedule_fab_add_text">New event</string>
<string name="schedule_no_events">You don\'t have any events for %s.</string>
<string name="sheet_event_action_edit_event_title">Edit this event</string>
<string name="sheet_event_action_add_task_title">Add a task or exam</string>
<string name="sheet_event_action_view_tasks_title">View tasks and exams for this event</string>
<string name="sheet_event_action_find_room_title">Find this event\'s room</string>
<string name="sheet_event_action_delete_event_title">Delete this event</string>
<string name="sheet_event_confirm_deletion_header">Confirm delete action</string>
<string name="sheet_event_confirm_deletion_content">Are you sure that you want to delete the event \'%s\'?</string>
<string name="sheet_event_confirm_deletion_snack">The event has been deleted.</string>
<string name="save">Save</string>
<string name="delete">Delete</string>
<string name="sheet_schedule_update_delete_confirm">Sure?</string>