Add disclaimer fragment

This commit is contained in:
Kirill Kamakin
2021-11-20 18:43:33 +03:00
parent 071ce453e2
commit 4b817ba404
10 changed files with 331 additions and 3 deletions

View File

@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="ui.disclaimer.DisclaimerFragment">
<TextView
android:id="@+id/header"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="@dimen/margin_small"
android:gravity="center"
android:text="@string/fragment_disclaimer_header"
android:textAppearance="?textAppearanceHeadline3"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/main_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="@dimen/margin_small"
android:text="@string/fragment_disclaimer_main_text"
android:textAppearance="?textAppearanceHeadline6"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/header" />
<Button
android:id="@+id/okay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/margin_small"
android:clickable="false"
android:text="@string/fragment_disclaimer_button_okay_timer"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/main_text" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -3,12 +3,13 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/nav_graph"
app:startDestination="@id/authenticationFragment">
app:startDestination="@id/disclaimerFragment">
<fragment
android:id="@+id/authenticationFragment"
android:name="gq.kirmanak.mealient.ui.auth.AuthenticationFragment"
android:label="AuthenticationFragment">
android:label="AuthenticationFragment"
tools:layout="@layout/fragment_authentication">
<action
android:id="@+id/action_authenticationFragment_to_recipesFragment"
app:destination="@id/recipesFragment"
@@ -32,7 +33,8 @@
<fragment
android:id="@+id/recipeInfoFragment"
android:name="gq.kirmanak.mealient.ui.recipes.info.RecipeInfoFragment"
android:label="RecipeInfoFragment">
android:label="RecipeInfoFragment"
tools:layout="@layout/fragment_recipe_info">
<action
android:id="@+id/action_recipeInfoFragment_to_authenticationFragment"
app:destination="@id/authenticationFragment"
@@ -45,4 +47,15 @@
android:name="recipe_id"
app:argType="long" />
</fragment>
<fragment
android:id="@+id/disclaimerFragment"
android:name="gq.kirmanak.mealient.ui.disclaimer.DisclaimerFragment"
android:label="DisclaimerFragment"
tools:layout="@layout/fragment_disclaimer">
<action
android:id="@+id/action_disclaimerFragment_to_authenticationFragment"
app:destination="@id/authenticationFragment"
app:popUpTo="@id/nav_graph"
app:popUpToInclusive="true" />
</fragment>
</navigation>

View File

@@ -11,4 +11,8 @@
<string name="content_description_fragment_recipe_info_image">@string/content_description_view_holder_recipe_image</string>
<string name="fragment_recipe_info_ingredients_header">Ingredients</string>
<string name="fragment_recipe_info_instructions_header">Instructions</string>
<string name="fragment_disclaimer_button_okay_timer">OKAY (%d seconds)</string>
<string name="fragment_disclaimer_main_text">This project is NOT associated with the core Mealie developers. If you face any issues when using the application or have a feature request DO NOT send them to the Mealie developers. Instead, report a new issue in the Mealient repository. THAT IS NOT AN OFFICIAL CLIENT.</string>
<string name="fragment_disclaimer_header">DISCLAIMER</string>
<string name="fragment_disclaimer_button_okay">OKAY</string>
</resources>