Add settings labels, Add placeholder AboutFragment

This commit is contained in:
MrLetsplay 2023-07-04 21:19:56 +02:00
parent cfbb969c5c
commit 4e030eba38
Signed by: mr
SSH Key Fingerprint: SHA256:92jBH80vpXyaZHjaIl47pjRq+Yt7XGTArqQg1V7hSqg
8 changed files with 122 additions and 2 deletions

View File

@ -24,6 +24,7 @@ import androidx.fragment.app.Fragment;
import com.cringe_studios.cringe_authenticator.databinding.ActivityMainBinding;
import com.cringe_studios.cringe_authenticator.databinding.DialogInputCodeChoiceBinding;
import com.cringe_studios.cringe_authenticator.fragment.AboutFragment;
import com.cringe_studios.cringe_authenticator.fragment.GroupFragment;
import com.cringe_studios.cringe_authenticator.fragment.HomeFragment;
import com.cringe_studios.cringe_authenticator.fragment.MenuFragment;
@ -182,6 +183,10 @@ public class MainActivity extends AppCompatActivity {
NavigationUtil.navigate(this, SettingsFragment.class, null);
}
public void openAbout(MenuItem item) {
NavigationUtil.navigate(this, AboutFragment.class, null);
}
public void scanCode() {
startQRCodeScan.launch(null);
}

View File

@ -0,0 +1,28 @@
package com.cringe_studios.cringe_authenticator.fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.cringe_studios.cringe_authenticator.databinding.FragmentAboutBinding;
public class AboutFragment extends NamedFragment {
private FragmentAboutBinding binding;
@Override
public String getName() {
return "About";
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
binding = FragmentAboutBinding.inflate(inflater);
return binding.getRoot();
}
}

View File

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragment.HomeFragment">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp"
android:orientation="vertical">
<TextView
android:id="@+id/about_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:text="@string/app_name"
android:textAlignment="center"
android:textStyle="bold" />
<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:orientation="horizontal">
<ImageView
android:id="@+id/about_jg_cody"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:src="@drawable/ic_hamburger" />
<ImageView
android:id="@+id/about_cringe_studios"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:src="@drawable/ic_hamburger" />
</LinearLayout>
<TextView
android:id="@+id/about_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:text="Developed by Cringe Studios and JG-Cody"
android:textAlignment="center" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>

View File

@ -11,6 +11,11 @@
android:padding="16dp"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/language" />
<Spinner
android:id="@+id/settings_language"
android:layout_width="match_parent"
@ -30,6 +35,11 @@
android:layout_height="wrap_content"
android:text="@string/settings_biometric_lock" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/theme" />
<Spinner
android:id="@+id/settings_theme"
android:layout_width="match_parent"

View File

@ -14,4 +14,10 @@
android:title="@string/action_settings"
app:showAsAction="never"
android:onClick="openSettings" />
<item
android:id="@+id/action_about"
android:orderInCategory="100"
android:title="@string/action_about"
app:showAsAction="never"
android:onClick="openAbout" />
</menu>

View File

@ -8,4 +8,10 @@
android:title="@string/action_settings"
app:showAsAction="never"
android:onClick="openSettings" />
<item
android:id="@+id/action_about"
android:orderInCategory="100"
android:title="@string/action_about"
app:showAsAction="never"
android:onClick="openAbout" />
</menu>

View File

@ -2,6 +2,7 @@
<resources>
<string name="app_name">Cringe Authenticator</string>
<string name="action_settings">Einstellungen</string>
<string name="action_about">Über</string>
<string name="next">Weiter</string>
<string name="previous">Zurück</string>
<string name="edit">Bearbeiten</string>
@ -11,7 +12,6 @@
<string name="no">Nein</string>
<string name="yes">Ja</string>
<string name="invalid_input">Ungültige Eingabe</string>
<string name="about">Über</string>
<string name="haptic_feedback">Vibration</string>
<string name="reset_app">App zurücksetzen</string>
<string name="import_export">Importieren / Exportieren</string>
@ -36,6 +36,9 @@
<string name="edit_group_title">Gruppe bearbeiten</string>
<string name="settings_enable_intro_video">Intro-Video zeigen</string>
<string name="settings_biometric_lock">Biometrische Authentifizierung aktivieren</string>
<string name="uri_handler_code_added">Code hinzugefügt</string>
<string name="uri_handler_add_code_title">Code hinzufügen</string>
<string name="theme">Theme</string>
<string-array name="view_edit_delete">
<item>Anzeigen</item>
<item>Bearbeiten</item>

View File

@ -1,6 +1,7 @@
<resources>
<string name="app_name">Cringe Authenticator</string>
<string name="action_settings">Settings</string>
<string name="action_about">About</string>
<!-- Strings used for fragments for navigation -->
<string name="first_fragment_label" translatable="false">First Fragment</string>
<string name="second_fragment_label" translatable="false">Second Fragment</string>
@ -51,7 +52,6 @@
<string name="no">No</string>
<string name="yes">Yes</string>
<string name="invalid_input">Invalid Input</string>
<string name="about">About</string>
<string name="haptic_feedback">Haptic Feedback</string>
<string name="reset_app">Reset App</string>
<string name="import_export">Import / Export</string>
@ -78,6 +78,7 @@
<string name="settings_biometric_lock">Require biometric unlock</string>
<string name="uri_handler_code_added">Code added</string>
<string name="uri_handler_add_code_title">Add Code</string>
<string name="theme">Theme</string>
<string-array name="view_edit_delete">
<item>View</item>
<item>Edit</item>