Archived
Added back buttons on all user-facing fragments that show when compact layout is used
This commit is contained in:
@@ -21,8 +21,23 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="8dp">
|
||||
android:layout_marginHorizontal="8dp">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
style="@style/Widget.Material3.Button.IconButton"
|
||||
android:id="@+id/button_navigate_back"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:minWidth="0dp"
|
||||
app:icon="@drawable/arrow_back"
|
||||
app:iconPadding="0dp"
|
||||
app:strokeColor="?attr/colorOutlineVariant"
|
||||
app:layout_constraintTop_toTopOf="@id/app_title_bar"
|
||||
app:layout_constraintBottom_toBottomOf="@id/app_title_bar"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:iconTint="?attr/colorOnSurfaceVariant"
|
||||
tools:ignore="UnusedAttribute"
|
||||
android:tooltipText="@string/fragment_button_back_to_overview_hint"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/app_title_bar"
|
||||
@@ -33,6 +48,7 @@
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
app:layout_goneMarginStart="8dp"
|
||||
app:fontFamily="@font/lato_blackitalic"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="marquee"
|
||||
@@ -42,7 +58,7 @@
|
||||
android:scrollHorizontally="true"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/button_navigate_back"
|
||||
app:layout_constraintEnd_toStartOf="@id/button_opening_hours"/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
|
||||
@@ -1,6 +1,64 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout 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:id="@+id/coordinator_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".fragment.EventFragment">
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
app:layout_scrollFlags="scroll">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/app_title_bar"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/app_name"
|
||||
android:textSize="28sp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
app:fontFamily="@font/lato_blackitalic"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="marquee"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
android:scrollHorizontally="true"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/button_settings"/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
style="@style/Widget.Material3.Button.IconButton.Outlined"
|
||||
android:id="@+id/button_settings"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:minWidth="0dp"
|
||||
app:icon="@drawable/settings"
|
||||
app:iconPadding="0dp"
|
||||
app:strokeColor="?attr/colorOutlineVariant"
|
||||
app:layout_constraintTop_toTopOf="@id/app_title_bar"
|
||||
app:layout_constraintBottom_toBottomOf="@id/app_title_bar"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:iconTint="?attr/colorOnSurfaceVariant"
|
||||
tools:ignore="UnusedAttribute"
|
||||
android:tooltipText="@string/compact_overview_button_settings_hint"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
@@ -16,10 +16,25 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginHorizontal="8dp"
|
||||
app:layout_scrollFlags="scroll">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
style="@style/Widget.Material3.Button.IconButton"
|
||||
android:id="@+id/button_navigate_back"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:minWidth="0dp"
|
||||
app:icon="@drawable/arrow_back"
|
||||
app:iconPadding="0dp"
|
||||
app:strokeColor="?attr/colorOutlineVariant"
|
||||
app:layout_constraintTop_toTopOf="@id/app_title_bar"
|
||||
app:layout_constraintBottom_toBottomOf="@id/app_title_bar"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:iconTint="?attr/colorOnSurfaceVariant"
|
||||
tools:ignore="UnusedAttribute"
|
||||
android:tooltipText="@string/fragment_button_back_to_overview_hint"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/app_title_bar"
|
||||
android:layout_width="0dp"
|
||||
@@ -29,6 +44,7 @@
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
app:layout_goneMarginStart="8dp"
|
||||
app:fontFamily="@font/lato_blackitalic"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="marquee"
|
||||
@@ -38,7 +54,7 @@
|
||||
android:scrollHorizontally="true"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/button_navigate_back"
|
||||
app:layout_constraintEnd_toStartOf="@id/button_view_overview"/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
|
||||
@@ -14,17 +14,45 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/app_title_bar"
|
||||
android:layout_width="wrap_content"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:fontFamily="@font/lato_blackitalic"
|
||||
android:text="@string/title_settings"
|
||||
app:layout_scrollFlags="scroll"
|
||||
android:textSize="28sp"/>
|
||||
android:layout_marginHorizontal="8dp"
|
||||
app:layout_scrollFlags="scroll">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
style="@style/Widget.Material3.Button.IconButton"
|
||||
android:id="@+id/button_navigate_back"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:minWidth="0dp"
|
||||
app:icon="@drawable/arrow_back"
|
||||
app:iconPadding="0dp"
|
||||
app:strokeColor="?attr/colorOutlineVariant"
|
||||
app:layout_constraintTop_toTopOf="@id/app_title_bar"
|
||||
app:layout_constraintBottom_toBottomOf="@id/app_title_bar"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:iconTint="?attr/colorOnSurfaceVariant"
|
||||
tools:ignore="UnusedAttribute"
|
||||
android:tooltipText="@string/fragment_button_back_to_overview_hint"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/app_title_bar"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:fontFamily="@font/lato_blackitalic"
|
||||
android:text="@string/title_settings"
|
||||
android:textSize="28sp"
|
||||
app:layout_scrollFlags="scroll"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:layout_goneMarginStart="8dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/button_navigate_back"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/nav_graph_compact"
|
||||
app:startDestination="@id/schedule">
|
||||
app:startDestination="@id/compact_overview">
|
||||
|
||||
<fragment
|
||||
android:id="@+id/compact_overview"
|
||||
@@ -26,16 +26,28 @@
|
||||
android:id="@+id/schedule"
|
||||
android:name="com.denizk0461.weserplaner.fragment.EventFragment"
|
||||
android:label="EventFragment"
|
||||
tools:layout="@layout/fragment_event"/>
|
||||
tools:layout="@layout/fragment_event">
|
||||
<action
|
||||
android:id="@+id/action_schedule_to_compact_overview"
|
||||
app:destination="@id/compact_overview" />
|
||||
</fragment>
|
||||
<fragment
|
||||
android:id="@+id/canteen"
|
||||
android:name="com.denizk0461.weserplaner.fragment.CanteenFragment"
|
||||
android:label="CanteenFragment"
|
||||
tools:layout="@layout/fragment_canteen"/>
|
||||
tools:layout="@layout/fragment_canteen">
|
||||
<action
|
||||
android:id="@+id/action_canteen_to_compact_overview"
|
||||
app:destination="@id/compact_overview" />
|
||||
</fragment>
|
||||
<fragment
|
||||
android:id="@+id/settings"
|
||||
android:name="com.denizk0461.weserplaner.fragment.SettingsFragment"
|
||||
android:label="SettingsFragment"
|
||||
tools:layout="@layout/fragment_settings"/>
|
||||
tools:layout="@layout/fragment_settings">
|
||||
<action
|
||||
android:id="@+id/action_settings_to_compact_overview"
|
||||
app:destination="@id/compact_overview" />
|
||||
</fragment>
|
||||
|
||||
</navigation>
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
<navigation 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:id="@+id/nav_graph_detailed"
|
||||
android:id="@+id/nav_graph_default"
|
||||
app:startDestination="@id/schedule">
|
||||
|
||||
<fragment
|
||||
@@ -30,6 +30,9 @@
|
||||
<string name="introduction_or">– oder –</string>
|
||||
<string name="introduction_button_continue">Gehe direkt zur App</string>
|
||||
|
||||
<string name="compact_overview_button_settings_hint">App-Einstellungen</string>
|
||||
<string name="fragment_button_back_to_overview_hint">Zurück zur Übersicht</string>
|
||||
|
||||
<string name="fetch_error_snack">Ein Fehler ist aufgetreten!</string>
|
||||
<string name="fetch_error_webpage_snack">Du musst deinen Stundenplan öffnen!</string>
|
||||
<string name="fetch_error_login_snack">Du musst dich zuerst einloggen!</string>
|
||||
|
||||
@@ -31,6 +31,9 @@
|
||||
<string name="introduction_or">– or –</string>
|
||||
<string name="introduction_button_continue">Continue to the app</string>
|
||||
|
||||
<string name="compact_overview_button_settings_hint">App settings</string>
|
||||
<string name="fragment_button_back_to_overview_hint">Back to overview</string>
|
||||
|
||||
<string name="fetch_error_snack">Something went wrong!</string>
|
||||
<string name="fetch_error_webpage_snack">You must navigate to your schedule!</string>
|
||||
<string name="fetch_error_login_snack">You must log in first!</string>
|
||||
|
||||
Reference in New Issue
Block a user