edited Aboutpage, added strings and translation, edited Settingspage, added drawables

This commit is contained in:
JG-Cody 2023-10-01 17:54:19 +02:00
parent f66de7fd78
commit d4162b3d32
24 changed files with 302 additions and 94 deletions

View File

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetDropDown">
<targetSelectedWithDropDown>
<Target>
<type value="QUICK_BOOT_TARGET" />
<deviceKey>
<Key>
<type value="VIRTUAL_DEVICE_PATH" />
<value value="C:\Users\Cody\.android\avd\for_Website.avd" />
</Key>
</deviceKey>
</Target>
</targetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown value="2023-09-26T16:23:33.212298700Z" />
</component>
</project>

View File

@ -2,8 +2,8 @@ package com.cringe_studios.cringe_authenticator.crypto;
public class CryptoResult {
private byte[] encrypted;
private byte[] iv;
private final byte[] encrypted;
private final byte[] iv;
public CryptoResult(byte[] encrypted, byte[] iv) {
this.encrypted = encrypted;

View File

@ -51,13 +51,13 @@ public class EditOTPFragment extends NamedFragment {
private FragmentEditOtpBinding binding;
private OTPData data;
private final OTPData data;
private String imageData;
private boolean view;
private final boolean view;
private Consumer<OTPData> callback;
private final Consumer<OTPData> callback;
public EditOTPFragment(OTPData data, boolean view, Consumer<OTPData> callback) {
this.data = data;

View File

@ -21,7 +21,7 @@ public class PickIconDrawerFragment extends BottomSheetDialogFragment {
private FragmentPickIconBinding binding;
private Consumer<Icon> selected;
private final Consumer<Icon> selected;
public PickIconDrawerFragment(Consumer<Icon> selected) {
this.selected = selected;

View File

@ -20,21 +20,21 @@ import java.util.List;
public class GroupListAdapter extends RecyclerView.Adapter<GroupListItem> {
private Context context;
private final Context context;
private RecyclerView recyclerView;
private final RecyclerView recyclerView;
private LayoutInflater inflater;
private final LayoutInflater inflater;
private List<String> items;
private final List<String> items;
private Handler handler;
private final Handler handler;
private Consumer<String> navigateToGroup;
private final Consumer<String> navigateToGroup;
private Runnable saveGroups;
private final Runnable saveGroups;
private Runnable updateToolbarOptions;
private final Runnable updateToolbarOptions;
private boolean editing;

View File

@ -12,7 +12,7 @@ import com.cringe_studios.cringe_authenticator.databinding.MenuItemBinding;
public class GroupListItem extends RecyclerView.ViewHolder {
private MenuItemBinding binding;
private final MenuItemBinding binding;
private String groupId;

View File

@ -2,8 +2,8 @@ package com.cringe_studios.cringe_authenticator.icon;
public class Icon {
private IconMetadata metadata;
private byte[] bytes;
private final IconMetadata metadata;
private final byte[] bytes;
public Icon(IconMetadata metadata, byte[] bytes) {
this.metadata = metadata;

View File

@ -22,14 +22,14 @@ import java.util.TreeMap;
public class IconListAdapter extends BaseExpandableListAdapter implements ExpandableListView.OnChildClickListener {
private Context context;
private final Context context;
private Map<String, List<Icon>> icons;
private List<String> categories;
private final Map<String, List<Icon>> icons;
private final List<String> categories;
private Map<String, List<Icon>> filteredIcons;
private Consumer<Icon> selected;
private final Consumer<Icon> selected;
public IconListAdapter(Context context, Map<String, List<Icon>> icons, Consumer<Icon> selected) {
this.context = context;

View File

@ -2,8 +2,8 @@ package com.cringe_studios.cringe_authenticator.icon;
public class IconPack {
private IconPackMetadata metadata;
private Icon[] icons;
private final IconPackMetadata metadata;
private final Icon[] icons;
public IconPack(IconPackMetadata metadata, Icon[] icons) {
this.metadata = metadata;

View File

@ -69,7 +69,7 @@ public class IconUtil {
// Color.parseColor("#ffffff") // White
));
private static Map<String, IconPack> loadedPacks = new HashMap<>();
private static final Map<String, IconPack> loadedPacks = new HashMap<>();
private static File getIconPacksDir(Context context) {
File iconPacksDir = new File(context.getFilesDir(), "iconpacks");

View File

@ -11,15 +11,15 @@ public class OTPData implements Serializable {
public static final String IMAGE_DATA_NONE = "none";
private String name;
private String issuer;
private OTPType type;
private String secret;
private OTPAlgorithm algorithm;
private int digits;
private int period;
private final String name;
private final String issuer;
private final OTPType type;
private final String secret;
private final OTPAlgorithm algorithm;
private final int digits;
private final int period;
private long counter;
private boolean checksum;
private final boolean checksum;
private String imageData;
// Cached

View File

@ -2,9 +2,9 @@ package com.cringe_studios.cringe_authenticator.model;
public class OTPMigrationPart {
private OTPData[] otps;
private int batchIndex;
private int batchSize;
private final OTPData[] otps;
private final int batchIndex;
private final int batchSize;
public OTPMigrationPart(OTPData[] otps, int batchIndex, int batchSize) {
this.otps = otps;

View File

@ -28,17 +28,17 @@ import java.util.List;
public class OTPListAdapter extends RecyclerView.Adapter<OTPListItem> {
private Context context;
private final Context context;
private RecyclerView recyclerView;
private final RecyclerView recyclerView;
private LayoutInflater inflater;
private final LayoutInflater inflater;
private List<OTPData> items;
private final List<OTPData> items;
private Handler handler;
private final Handler handler;
private Runnable saveOTPs;
private final Runnable saveOTPs;
private boolean editing;

View File

@ -16,7 +16,7 @@ import com.cringe_studios.cringe_authenticator_library.OTPType;
public class OTPListItem extends RecyclerView.ViewHolder {
private OtpCodeBinding binding;
private final OtpCodeBinding binding;
private OTPData otpData;

View File

@ -14,7 +14,7 @@ import com.google.mlkit.vision.common.InputImage;
public class QRScanner {
private BarcodeScanner scanner;
private final BarcodeScanner scanner;
public QRScanner() {
scanner = BarcodeScanning.getClient();

View File

@ -13,10 +13,10 @@ public enum Appearance {
;
@StringRes
private int name;
private final int name;
@AppCompatDelegate.NightMode
private int value;
private final int value;
Appearance(@StringRes int name, @AppCompatDelegate.NightMode int value) {
this.name = name;

View File

@ -2,6 +2,6 @@ package com.cringe_studios.cringe_authenticator.util;
public interface DialogCallback {
public boolean callback();
boolean callback();
}

View File

@ -86,7 +86,7 @@ public class DialogUtil {
}
public static void showErrorDialog(Context context, String errorMessage, Exception exception) {
showErrorDialog(context, errorMessage, stackTraceToString(exception), (Runnable) null);
showErrorDialog(context, errorMessage, stackTraceToString(exception), null);
}
private static String stackTraceToString(Throwable t) {

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<stroke
android:width="0dp"
android:color="#FFFFFF" />
<gradient
android:angle="180"
android:startColor="?attr/colorTheme1"
android:endColor="?attr/colorTheme2" />
</shape>
<corners
android:bottomLeftRadius="0dp"
android:bottomRightRadius="0dp"
android:topLeftRadius="0dp"
android:topRightRadius="0dp" />
</item>
</layer-list>

View File

@ -4,6 +4,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="?android:attr/colorBackground"
tools:context=".fragment.HomeFragment">
<LinearLayout
@ -13,7 +14,7 @@
android:orientation="vertical">
<TextView
android:id="@+id/about_title"
android:id="@+id/app_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
@ -23,6 +24,184 @@
android:textAlignment="center"
android:textStyle="bold" />
<TextView
android:id="@+id/app_version"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:textAlignment="center"
tools:text="APPVERSION" />
<View
android:id="@+id/divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="10dp"
android:background="@drawable/theme_gradient" />
<TextView
android:id="@+id/license"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:textAlignment="center"
android:textStyle="bold"
android:text="@string/license" />
<TextView
android:id="@+id/app_license"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:textAlignment="center"
android:text="@string/app_license" />
<View
android:id="@+id/divider2"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="10dp"
android:background="@drawable/theme_gradient" />
<TextView
android:id="@+id/contact"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:textAlignment="center"
android:textStyle="bold"
android:text="@string/contact" />
<TextView
android:id="@+id/mailto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:textAlignment="center"
android:text="@string/mail_to" />
<View
android:id="@+id/divider3"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="10dp"
android:background="@drawable/theme_gradient" />
<TextView
android:id="@+id/appcode"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:textAlignment="center"
android:textStyle="bold"
android:text="@string/quellcode" />
<TextView
android:id="@+id/github"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:textAlignment="center"
android:text="@string/github" />
<View
android:id="@+id/divider4"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="10dp"
android:background="@drawable/theme_gradient" />
<TextView
android:id="@+id/changelog"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:textAlignment="center"
android:textStyle="bold"
android:text="@string/changelog" />
<TextView
android:id="@+id/changelog_link"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:textAlignment="center"
android:text="@string/changelog_link" />
<View
android:id="@+id/divider5"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="10dp"
android:background="@drawable/theme_gradient" />
<TextView
android:id="@+id/documentation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:textAlignment="center"
android:textStyle="bold"
android:text="@string/documentation" />
<TextView
android:id="@+id/documentation_link"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:textAlignment="center"
android:text="@string/documentation_link" />
<View
android:id="@+id/divider6"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="10dp"
android:background="@drawable/theme_gradient" />
<TextView
android:id="@+id/team"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:textAlignment="center"
android:textStyle="bold"
android:text="@string/development" />
<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
android:id="@+id/linearLayout"
android:layout_width="match_parent"
@ -34,32 +213,48 @@
<ImageView
android:id="@+id/about_jg_cody"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="20dp"
android:layout_height="match_parent"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:src="@drawable/ic_hamburger"
app:tint="?android:attr/textColorPrimary" />
android:src="@drawable/jgcody"/>
<ImageView
android:id="@+id/about_cringe_studios"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="20dp"
android:layout_height="70dp"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:src="@drawable/ic_hamburger"
app:tint="?android:attr/textColorPrimary" />
android:src="@drawable/cringestudios" />
</LinearLayout>
<View
android:id="@+id/divider7"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="10dp"
android:background="@drawable/theme_gradient" />
<TextView
android:id="@+id/about_text"
android:id="@+id/support"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginStart="16dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:text="Developed by Cringe Studios and JG-Cody"
android:textAlignment="center" />
android:textAlignment="center"
android:textStyle="bold"
android:text="@string/support" />
<TextView
android:id="@+id/patreon_link"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:textAlignment="center"
android:text="@string/patreon_link" />
<Space
android:layout_width="match_parent"

View File

@ -1,17 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView 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"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="?android:attr/colorBackground"
tools:context=".fragment.HomeFragment"
android:background="?android:attr/colorBackground">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp"
android:orientation="vertical">
android:orientation="vertical"
android:padding="16dp">
<TextView
android:layout_width="match_parent"
@ -27,9 +28,9 @@
<View
android:layout_width="match_parent"
android:background="@color/background_light_grey"
android:layout_height="1dp"
android:layout_marginVertical="10dp" />
android:layout_marginVertical="10dp"
android:background="@drawable/theme_gradient" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/settings_enable_encryption"
@ -63,9 +64,9 @@
<View
android:layout_width="match_parent"
android:background="@color/background_light_grey"
android:layout_height="1dp"
android:layout_marginVertical="10dp" />
android:layout_marginVertical="10dp"
android:background="@drawable/theme_gradient" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/settings_enable_intro_video"
@ -111,9 +112,9 @@
<View
android:layout_width="match_parent"
android:background="@color/background_light_grey"
android:layout_height="1dp"
android:layout_marginVertical="10dp" />
android:layout_marginVertical="10dp"
android:background="@drawable/theme_gradient" />
<TextView
android:layout_width="match_parent"
@ -124,25 +125,25 @@
android:id="@+id/settings_create_backup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:background="?attr/buttonBackground"
android:text="@string/create_backup"
android:layout_marginTop="10dp"
android:textAllCaps="false" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/settings_load_backup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:background="?attr/buttonBackground"
android:text="@string/load_backup"
android:layout_marginTop="10dp"
android:textAllCaps="false" />
<View
android:layout_width="match_parent"
android:background="@color/background_light_grey"
android:layout_height="1dp"
android:layout_marginVertical="10dp" />
android:layout_marginVertical="10dp"
android:background="@drawable/theme_gradient" />
<TextView
android:layout_width="match_parent"
@ -153,18 +154,18 @@
android:id="@+id/settings_load_icon_pack"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:background="?attr/buttonBackground"
android:text="Import icon pack"
android:layout_marginTop="10dp"
android:textAllCaps="false" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/settings_manage_icon_packs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:background="?attr/buttonBackground"
android:text="Manage icon packs"
android:layout_marginTop="10dp"
android:textAllCaps="false" />
<Space

View File

@ -1,7 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Cringe Authenticator</string>
<string name="action_settings">Einstellungen</string>
<string name="license">Lizenz</string>
<string name="contact">Kontakt</string>
<string name="website">Webseite</string>
<string name="development">Development</string>
<string name="action_about">Über</string>
<string name="edit">Bearbeiten</string>
<string name="choose_language">Sprachauswahl</string>
@ -99,4 +102,11 @@
<string name="disable_encryption_message">Willst du wirklich die Verschlüsselung deaktivieren?</string>
<string name="load_backup_title">Backup laden</string>
<string name="backup_load_message">Willst du dieses Backup laden?\n\nDadurch werden ALLE Daten der App gelöscht und mit denen aus dem Backup ersetzt!</string>
<string name="otp_add_type">Typ</string>
<string name="otp_add_algorithm">Algorithmus</string>
<string name="otp_add_digits">Ziffern</string>
<string name="quellcode">Quellcode</string>
<string name="support">Support</string>
<string name="changelog">Änderungsprotokoll</string>
<string name="documentation">Dokumentation</string>
</resources>