Use AccountManager
This commit is contained in:
38
app/src/main/res/layout/authenticator_activity.xml
Normal file
38
app/src/main/res/layout/authenticator_activity.xml
Normal file
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".ui.auth.AuthenticatorActivity">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/toolbar_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:liftOnScroll="true">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
style="@style/Widget.MaterialComponents.Toolbar.Primary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?actionBarSize"
|
||||
app:layout_scrollFlags="scroll|snap" />
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/nav_host"
|
||||
android:name="androidx.navigation.fragment.NavHostFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:defaultNavHost="true"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/toolbar_holder"
|
||||
app:navGraph="@navigation/authenticator_graph" />
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
13
app/src/main/res/navigation/authenticator_graph.xml
Normal file
13
app/src/main/res/navigation/authenticator_graph.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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/authenticator_graph"
|
||||
app:startDestination="@id/authenticationFragment2">
|
||||
|
||||
<fragment
|
||||
android:id="@+id/authenticationFragment2"
|
||||
android:name="gq.kirmanak.mealient.ui.auth.AuthenticationFragment"
|
||||
android:label="fragment_authentication"
|
||||
tools:layout="@layout/fragment_authentication" />
|
||||
</navigation>
|
||||
@@ -12,18 +12,20 @@
|
||||
<string name="fragment_recipe_info_ingredients_header">Ingredients</string>
|
||||
<string name="fragment_recipe_info_instructions_header">Instructions</string>
|
||||
<string name="fragment_disclaimer_main_text">This project is developed independently from the core Mealie project. It is NOT associated with the core Mealie developers. Any issues must be reported to the Mealient repository, NOT the Mealie repository.</string>
|
||||
<string name="fragment_disclaimer_button_okay">Okay</string>
|
||||
<string name="view_holder_recipe_instructions_step">Step: %d</string>
|
||||
<string name="fragment_authentication_email_input_empty">E-mail can\'t be empty</string>
|
||||
<string name="fragment_authentication_password_input_empty">Password can\'t be empty</string>
|
||||
<string name="fragment_baseurl_url_input_empty">URL can\'t be empty</string>
|
||||
<string name="fragment_authentication_credentials_incorrect">E-mail or password is incorrect.</string>
|
||||
<string name="fragment_base_url_no_connection">Can\'t connect, check address.</string>
|
||||
<string name="fragment_base_url_unexpected_response">Unexpected response. Is it Mealie?</string>
|
||||
<string name="fragment_authentication_unknown_error">Something went wrong, please try again.</string>
|
||||
<string name="fragment_base_url_malformed_url">Check URL format: %s</string>
|
||||
<string name="fragment_base_url_save">Proceed</string>
|
||||
<string name="fragment_base_url_unknown_error" translatable="false">@string/fragment_authentication_unknown_error</string>
|
||||
<string name="menu_main_toolbar_content_description_login" translatable="false">@string/menu_main_toolbar_login</string>
|
||||
<string name="menu_main_toolbar_login">Login</string>
|
||||
<string name="fragment_disclaimer_button_okay">Okay</string>
|
||||
<string name="view_holder_recipe_instructions_step">Step: %d</string>
|
||||
<string name="fragment_authentication_email_input_empty">E-mail can\'t be empty</string>
|
||||
<string name="fragment_authentication_password_input_empty">Password can\'t be empty</string>
|
||||
<string name="fragment_authentication_credentials_incorrect">E-mail or password is incorrect.</string>
|
||||
<string name="fragment_authentication_unknown_error">Something went wrong, please try again.</string>
|
||||
<string name="account_type" translatable="false">Mealient</string>
|
||||
<string name="auth_token_type" translatable="false">mealientAuthToken</string>
|
||||
</resources>
|
||||
6
app/src/main/res/xml/account_authenticator.xml
Normal file
6
app/src/main/res/xml/account_authenticator.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<account-authenticator xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:accountType="@string/account_type"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name" />
|
||||
Reference in New Issue
Block a user