diff --git a/app/build.gradle b/app/build.gradle index 083a007187..b749cbd736 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -139,7 +139,6 @@ dependencies { implementation "androidx.camera:camera-camera2:$cameraxVersion" implementation "androidx.camera:camera-lifecycle:$cameraxVersion" implementation "androidx.camera:camera-view:$cameraxVersion" - implementation 'androidx.cardview:cardview:1.0.0' implementation "androidx.core:core:1.12.0" implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation 'androidx.documentfile:documentfile:1.0.1' diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 36e70d77d0..5746551c4b 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -27,8 +27,6 @@ android:icon="@mipmap/${iconName}" android:label="Aegis" android:supportsRtl="true" - android:theme="@style/Theme.Aegis.Launch" - tools:replace="android:theme" tools:targetApi="tiramisu"> diff --git a/app/src/main/java/com/beemdevelopment/aegis/AegisApplicationBase.java b/app/src/main/java/com/beemdevelopment/aegis/AegisApplicationBase.java index f7ba8ce413..007400dbfa 100644 --- a/app/src/main/java/com/beemdevelopment/aegis/AegisApplicationBase.java +++ b/app/src/main/java/com/beemdevelopment/aegis/AegisApplicationBase.java @@ -22,6 +22,8 @@ import com.beemdevelopment.aegis.ui.MainActivity; import com.beemdevelopment.aegis.util.IOUtils; import com.beemdevelopment.aegis.vault.VaultManager; +import com.google.android.material.color.DynamicColors; +import com.google.android.material.color.DynamicColorsOptions; import com.mikepenz.iconics.Iconics; import com.mikepenz.material_design_iconic_typeface_library.MaterialDesignIconic; import com.topjohnwu.superuser.Shell; diff --git a/app/src/main/java/com/beemdevelopment/aegis/Preferences.java b/app/src/main/java/com/beemdevelopment/aegis/Preferences.java index 29ec07568d..befc352218 100644 --- a/app/src/main/java/com/beemdevelopment/aegis/Preferences.java +++ b/app/src/main/java/com/beemdevelopment/aegis/Preferences.java @@ -145,6 +145,10 @@ public CodeGrouping getCodeGroupSize() { return CodeGrouping.valueOf(value); } + public void setCodeGroupSize(CodeGrouping codeGroupSize) { + _prefs.edit().putString("pref_code_group_size_string", codeGroupSize.name()).apply(); + } + public boolean isIntroDone() { return _prefs.getBoolean("pref_intro", false); } @@ -198,6 +202,10 @@ public void setCurrentTheme(Theme theme) { _prefs.edit().putInt("pref_current_theme", theme.ordinal()).apply(); } + public boolean isDynamicColorsEnabled() { + return _prefs.getBoolean("pref_dynamic_colors", false); + } + public ViewMode getCurrentViewMode() { return ViewMode.fromInteger(_prefs.getInt("pref_current_view_mode", 0)); } @@ -266,8 +274,16 @@ public int getTimeout() { return _prefs.getInt("pref_timeout", -1); } + public String getLanguage() { + return _prefs.getString("pref_lang", "system"); + } + + public void setLanguage(String lang) { + _prefs.edit().putString("pref_lang", lang).apply(); + } + public Locale getLocale() { - String lang = _prefs.getString("pref_lang", "system"); + String lang = getLanguage(); if (lang.equals("system")) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { diff --git a/app/src/main/java/com/beemdevelopment/aegis/ThemeMap.java b/app/src/main/java/com/beemdevelopment/aegis/ThemeMap.java index 65b77625e4..0e8a5ecdb9 100644 --- a/app/src/main/java/com/beemdevelopment/aegis/ThemeMap.java +++ b/app/src/main/java/com/beemdevelopment/aegis/ThemeMap.java @@ -9,7 +9,7 @@ private ThemeMap() { } - public static final Map DEFAULT = ImmutableMap.of( + /*public static final Map DEFAULT = ImmutableMap.of( Theme.LIGHT, R.style.Theme_Aegis_Light_Default, Theme.DARK, R.style.Theme_Aegis_Dark_Default, Theme.AMOLED, R.style.Theme_Aegis_TrueDark_Default @@ -25,5 +25,5 @@ private ThemeMap() { Theme.LIGHT, R.style.Theme_Aegis_Light_Fullscreen, Theme.DARK, R.style.Theme_Aegis_Dark_Fullscreen, Theme.AMOLED, R.style.Theme_Aegis_TrueDark_Fullscreen - ); + );*/ } diff --git a/app/src/main/java/com/beemdevelopment/aegis/importers/AndOtpImporter.java b/app/src/main/java/com/beemdevelopment/aegis/importers/AndOtpImporter.java index aad90a55f2..2be31b0f06 100644 --- a/app/src/main/java/com/beemdevelopment/aegis/importers/AndOtpImporter.java +++ b/app/src/main/java/com/beemdevelopment/aegis/importers/AndOtpImporter.java @@ -21,6 +21,7 @@ import com.beemdevelopment.aegis.ui.tasks.PBKDFTask; import com.beemdevelopment.aegis.util.IOUtils; import com.beemdevelopment.aegis.vault.VaultEntry; +import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.topjohnwu.superuser.io.SuFile; import org.json.JSONArray; @@ -182,7 +183,7 @@ public void decrypt(Context context, DecryptListener listener) { context.getResources().getString(R.string.andotp_old_format) }; - Dialogs.showSecureDialog(new AlertDialog.Builder(context) + Dialogs.showSecureDialog(new MaterialAlertDialogBuilder(context) .setTitle(R.string.choose_andotp_importer) .setSingleChoiceItems(choices, 0, null) .setPositiveButton(android.R.string.ok, (dialog, which) -> { diff --git a/app/src/main/java/com/beemdevelopment/aegis/importers/TotpAuthenticatorImporter.java b/app/src/main/java/com/beemdevelopment/aegis/importers/TotpAuthenticatorImporter.java index b603eb8696..699f39b231 100644 --- a/app/src/main/java/com/beemdevelopment/aegis/importers/TotpAuthenticatorImporter.java +++ b/app/src/main/java/com/beemdevelopment/aegis/importers/TotpAuthenticatorImporter.java @@ -4,8 +4,6 @@ import android.content.pm.PackageManager; import android.util.Xml; -import androidx.appcompat.app.AlertDialog; - import com.beemdevelopment.aegis.R; import com.beemdevelopment.aegis.crypto.CryptoUtils; import com.beemdevelopment.aegis.encoding.Base32; @@ -18,6 +16,7 @@ import com.beemdevelopment.aegis.util.IOUtils; import com.beemdevelopment.aegis.util.PreferenceParser; import com.beemdevelopment.aegis.vault.VaultEntry; +import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.topjohnwu.superuser.io.SuFile; import org.json.JSONArray; @@ -154,7 +153,7 @@ protected DecryptedState decrypt(char[] password) throws DatabaseImporterExcepti @Override public void decrypt(Context context, DecryptListener listener) { - Dialogs.showSecureDialog(new AlertDialog.Builder(context) + Dialogs.showSecureDialog(new MaterialAlertDialogBuilder(context) .setMessage(R.string.choose_totpauth_importer) .setPositiveButton(R.string.yes, (dialog, which) -> { Dialogs.showPasswordInputDialog(context, password -> { diff --git a/app/src/main/java/com/beemdevelopment/aegis/ui/AboutActivity.java b/app/src/main/java/com/beemdevelopment/aegis/ui/AboutActivity.java index 616717a137..2adecbf3eb 100644 --- a/app/src/main/java/com/beemdevelopment/aegis/ui/AboutActivity.java +++ b/app/src/main/java/com/beemdevelopment/aegis/ui/AboutActivity.java @@ -132,11 +132,10 @@ private void openMail(String mailaddress) { private void showThirdPartyLicenseDialog() { String stylesheet = getString(R.string.custom_notices_format_style); - int backgroundColorResource = getConfiguredTheme() == Theme.AMOLED ? R.attr.cardBackgroundFocused : R.attr.cardBackground; - String backgroundColor = getThemeColorAsHex(backgroundColorResource); - String textColor = getThemeColorAsHex(R.attr.primaryText); - String licenseColor = getThemeColorAsHex(R.attr.cardBackgroundFocused); - String linkColor = getThemeColorAsHex(androidx.appcompat.R.attr.colorAccent); + String backgroundColor = getThemeColorAsHex(com.google.android.material.R.attr.colorSurfaceContainerLow); + String textColor = getThemeColorAsHex(com.google.android.material.R.attr.colorOnSurface); + String licenseColor = getThemeColorAsHex(com.google.android.material.R.attr.colorSurfaceContainerLow); + String linkColor = getThemeColorAsHex(com.google.android.material.R.attr.colorAccent); stylesheet = String.format(stylesheet, backgroundColor, textColor, licenseColor, linkColor); diff --git a/app/src/main/java/com/beemdevelopment/aegis/ui/AegisActivity.java b/app/src/main/java/com/beemdevelopment/aegis/ui/AegisActivity.java index 33b6fe859d..5e05b6f5dd 100644 --- a/app/src/main/java/com/beemdevelopment/aegis/ui/AegisActivity.java +++ b/app/src/main/java/com/beemdevelopment/aegis/ui/AegisActivity.java @@ -14,10 +14,10 @@ import com.beemdevelopment.aegis.Preferences; import com.beemdevelopment.aegis.R; import com.beemdevelopment.aegis.Theme; -import com.beemdevelopment.aegis.ThemeMap; import com.beemdevelopment.aegis.icons.IconPackManager; import com.beemdevelopment.aegis.vault.VaultManager; import com.beemdevelopment.aegis.vault.VaultRepositoryException; +import com.google.android.material.color.DynamicColors; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; @@ -96,7 +96,10 @@ public void onLocked(boolean userInitiated) { * Called when the activity is expected to set its theme. */ protected void onSetTheme() { - setTheme(ThemeMap.DEFAULT); + setTheme(R.style.Theme_Aegis); + if (_prefs.isDynamicColorsEnabled()) { + DynamicColors.applyToActivityIfAvailable(this); + } } /** diff --git a/app/src/main/java/com/beemdevelopment/aegis/ui/AuthActivity.java b/app/src/main/java/com/beemdevelopment/aegis/ui/AuthActivity.java index 685aa812bb..29159dd993 100644 --- a/app/src/main/java/com/beemdevelopment/aegis/ui/AuthActivity.java +++ b/app/src/main/java/com/beemdevelopment/aegis/ui/AuthActivity.java @@ -2,7 +2,6 @@ import android.content.Context; import android.content.Intent; -import android.os.Build; import android.os.Bundle; import android.text.InputType; import android.view.KeyEvent; @@ -20,11 +19,9 @@ import androidx.activity.OnBackPressedCallback; import androidx.annotation.NonNull; -import androidx.appcompat.app.AlertDialog; import androidx.biometric.BiometricPrompt; import com.beemdevelopment.aegis.R; -import com.beemdevelopment.aegis.ThemeMap; import com.beemdevelopment.aegis.crypto.KeyStoreHandle; import com.beemdevelopment.aegis.crypto.KeyStoreHandleException; import com.beemdevelopment.aegis.crypto.MasterKey; @@ -43,6 +40,7 @@ import com.beemdevelopment.aegis.vault.slots.SlotException; import com.beemdevelopment.aegis.vault.slots.SlotIntegrityException; import com.beemdevelopment.aegis.vault.slots.SlotList; +import com.google.android.material.dialog.MaterialAlertDialogBuilder; import java.util.List; @@ -163,7 +161,7 @@ protected void onCreate(Bundle savedInstanceState) { biometricsButton.setOnClickListener(v -> { if (_prefs.isPasswordReminderNeeded()) { - Dialogs.showSecureDialog(new AlertDialog.Builder(this) + Dialogs.showSecureDialog(new MaterialAlertDialogBuilder(this) .setTitle(getString(R.string.password_reminder_dialog_title)) .setMessage(getString(R.string.password_reminder_dialog_message)) .setCancelable(false) @@ -183,11 +181,6 @@ protected void onSaveInstanceState(@NonNull Bundle outState) { outState.putBoolean("inhibitBioPrompt", _inhibitBioPrompt); } - @Override - protected void onSetTheme() { - setTheme(ThemeMap.NO_ACTION_BAR); - } - private void selectPassword() { _textPassword.selectAll(); @@ -240,9 +233,6 @@ private void showPasswordReminder() { PopupWindow popup = new PopupWindow(popupLayout, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); popup.setFocusable(false); popup.setOutsideTouchable(true); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP){ - popup.setElevation(5.0f); - } _textPassword.post(() -> { if (isFinishing()) { return; @@ -302,7 +292,7 @@ private void finish(MasterKey key, boolean isSlotRepaired) { } private void onInvalidPassword() { - Dialogs.showSecureDialog(new AlertDialog.Builder(AuthActivity.this) + Dialogs.showSecureDialog(new MaterialAlertDialogBuilder(AuthActivity.this) .setTitle(getString(R.string.unlock_vault_error)) .setMessage(getString(R.string.unlock_vault_error_description)) .setCancelable(false) diff --git a/app/src/main/java/com/beemdevelopment/aegis/ui/EditEntryActivity.java b/app/src/main/java/com/beemdevelopment/aegis/ui/EditEntryActivity.java index bdfc844b10..642c534686 100644 --- a/app/src/main/java/com/beemdevelopment/aegis/ui/EditEntryActivity.java +++ b/app/src/main/java/com/beemdevelopment/aegis/ui/EditEntryActivity.java @@ -66,6 +66,7 @@ import com.bumptech.glide.request.target.CustomTarget; import com.bumptech.glide.request.transition.Transition; import com.google.android.material.bottomsheet.BottomSheetDialog; +import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.android.material.textfield.TextInputEditText; import com.google.android.material.textfield.TextInputLayout; @@ -460,7 +461,7 @@ public boolean onOptionsItemSelected(MenuItem item) { } else if (itemId == R.id.action_edit_icon) { startIconSelection(); } else if (itemId == R.id.action_reset_usage_count) { - Dialogs.showSecureDialog(new AlertDialog.Builder(this) + Dialogs.showSecureDialog(new MaterialAlertDialogBuilder(this) .setTitle(R.string.action_reset_usage_count) .setMessage(R.string.action_reset_usage_count_dialog) .setPositiveButton(android.R.string.yes, (dialog, which) -> resetUsageCount()) @@ -769,7 +770,7 @@ private VaultEntry parseEntry() throws ParseException { } private void onSaveError(String msg) { - Dialogs.showSecureDialog(new AlertDialog.Builder(this) + Dialogs.showSecureDialog(new MaterialAlertDialogBuilder(this) .setTitle(getString(R.string.saving_profile_error)) .setMessage(msg) .setPositiveButton(android.R.string.ok, null) diff --git a/app/src/main/java/com/beemdevelopment/aegis/ui/GroupManagerActivity.java b/app/src/main/java/com/beemdevelopment/aegis/ui/GroupManagerActivity.java index 2333f0cb80..851c7677c8 100644 --- a/app/src/main/java/com/beemdevelopment/aegis/ui/GroupManagerActivity.java +++ b/app/src/main/java/com/beemdevelopment/aegis/ui/GroupManagerActivity.java @@ -7,7 +7,6 @@ import androidx.activity.OnBackPressedCallback; import androidx.annotation.NonNull; -import androidx.appcompat.app.AlertDialog; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; @@ -15,6 +14,7 @@ import com.beemdevelopment.aegis.ui.dialogs.Dialogs; import com.beemdevelopment.aegis.ui.views.GroupAdapter; import com.beemdevelopment.aegis.vault.VaultGroup; +import com.google.android.material.dialog.MaterialAlertDialogBuilder; import java.util.ArrayList; import java.util.HashSet; @@ -84,7 +84,7 @@ protected void onSaveInstanceState(@NonNull Bundle outState) { @Override public void onRemoveGroup(VaultGroup group) { - Dialogs.showSecureDialog(new AlertDialog.Builder(this) + Dialogs.showSecureDialog(new MaterialAlertDialogBuilder(this) .setTitle(R.string.remove_group) .setMessage(R.string.remove_group_description) .setPositiveButton(android.R.string.yes, (dialog, whichButton) -> { @@ -98,7 +98,7 @@ public void onRemoveGroup(VaultGroup group) { } public void onRemoveUnusedGroups() { - Dialogs.showSecureDialog(new AlertDialog.Builder(this) + Dialogs.showSecureDialog(new MaterialAlertDialogBuilder(this) .setTitle(R.string.remove_unused_groups) .setMessage(R.string.remove_unused_groups_description) .setPositiveButton(android.R.string.yes, (dialog, whichButton) -> { diff --git a/app/src/main/java/com/beemdevelopment/aegis/ui/ImportEntriesActivity.java b/app/src/main/java/com/beemdevelopment/aegis/ui/ImportEntriesActivity.java index 93a6fee99b..7571494acc 100644 --- a/app/src/main/java/com/beemdevelopment/aegis/ui/ImportEntriesActivity.java +++ b/app/src/main/java/com/beemdevelopment/aegis/ui/ImportEntriesActivity.java @@ -11,7 +11,6 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.ActionBar; -import androidx.appcompat.app.AlertDialog; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; @@ -28,6 +27,7 @@ import com.beemdevelopment.aegis.vault.VaultEntry; import com.beemdevelopment.aegis.vault.VaultGroup; import com.beemdevelopment.aegis.vault.VaultRepository; +import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.google.android.material.snackbar.Snackbar; @@ -101,7 +101,7 @@ private void startImport(DatabaseImporter.Definition importerDef, @Nullable File if (importer.isInstalledAppVersionSupported()) { startImportApp(importer); } else { - Dialogs.showSecureDialog(new AlertDialog.Builder(this) + Dialogs.showSecureDialog(new MaterialAlertDialogBuilder(this) .setTitle(R.string.warning) .setMessage(getString(R.string.app_version_error, importerDef.getName())) .setCancelable(false) @@ -296,7 +296,7 @@ private void saveAndFinish(boolean wipeEntries) { assignIconIntent.putExtra("entries", assignIconEntriesIds); - Dialogs.showSecureDialog(new AlertDialog.Builder(this) + Dialogs.showSecureDialog(new MaterialAlertDialogBuilder(this) .setTitle(R.string.import_assign_icons_dialog_title) .setMessage(R.string.import_assign_icons_dialog_text) .setPositiveButton(android.R.string.yes, (dialog, which) -> { diff --git a/app/src/main/java/com/beemdevelopment/aegis/ui/IntroActivity.java b/app/src/main/java/com/beemdevelopment/aegis/ui/IntroActivity.java index 8ab26fe8a7..701d37b5c2 100644 --- a/app/src/main/java/com/beemdevelopment/aegis/ui/IntroActivity.java +++ b/app/src/main/java/com/beemdevelopment/aegis/ui/IntroActivity.java @@ -13,7 +13,6 @@ import androidx.annotation.Nullable; import com.beemdevelopment.aegis.R; -import com.beemdevelopment.aegis.ThemeMap; import com.beemdevelopment.aegis.ui.dialogs.Dialogs; import com.beemdevelopment.aegis.ui.intro.IntroBaseActivity; import com.beemdevelopment.aegis.ui.intro.SlideFragment; @@ -40,11 +39,6 @@ protected void onCreate(Bundle savedInstanceState) { addSlide(DoneSlide.class); } - @Override - protected void onSetTheme() { - setTheme(ThemeMap.NO_ACTION_BAR); - } - @Override protected boolean onBeforeSlideChanged(Class oldSlide, @NonNull Class newSlide) { // hide the keyboard before every slide change diff --git a/app/src/main/java/com/beemdevelopment/aegis/ui/MainActivity.java b/app/src/main/java/com/beemdevelopment/aegis/ui/MainActivity.java index 1800ffd49c..d696061135 100644 --- a/app/src/main/java/com/beemdevelopment/aegis/ui/MainActivity.java +++ b/app/src/main/java/com/beemdevelopment/aegis/ui/MainActivity.java @@ -35,8 +35,8 @@ import androidx.appcompat.view.ActionMode; import androidx.appcompat.widget.SearchView; -import com.beemdevelopment.aegis.CopyBehavior; import com.beemdevelopment.aegis.AccountNamePosition; +import com.beemdevelopment.aegis.CopyBehavior; import com.beemdevelopment.aegis.Preferences; import com.beemdevelopment.aegis.R; import com.beemdevelopment.aegis.SortCategory; @@ -54,6 +54,7 @@ import com.beemdevelopment.aegis.util.TimeUtils; import com.beemdevelopment.aegis.vault.VaultEntry; import com.google.android.material.bottomsheet.BottomSheetDialog; +import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.google.common.base.Strings; @@ -78,7 +79,6 @@ public class MainActivity extends AegisActivity implements EntryListView.Listene private static final int CODE_SCAN_IMAGE = 6; private static final int CODE_ASSIGN_ICONS = 7; - // Permission request codes private static final int CODE_PERM_CAMERA = 0; @@ -857,9 +857,10 @@ private void updateErrorBar() { _textErrorBar.setText(R.string.backup_reminder_bar_message); } _btnErrorBar.setOnClickListener(view -> { - Dialogs.showSecureDialog(new AlertDialog.Builder(this) + Dialogs.showSecureDialog(new MaterialAlertDialogBuilder(this, com.google.android.material.R.style.ThemeOverlay_Material3_MaterialAlertDialog_Centered) .setTitle(R.string.backup_reminder_bar_dialog_title) .setMessage(R.string.backup_reminder_bar_dialog_summary) + .setIcon(R.drawable.ic_info_outline_black_24dp) .setPositiveButton(R.string.backup_reminder_bar_dialog_accept, (dialog, whichButton) -> { startPreferencesActivity(BackupsPreferencesFragment.class, "pref_backups"); }) @@ -879,7 +880,7 @@ private void updateErrorBar() { private void showPlaintextExportWarningOptions() { View view = LayoutInflater.from(this).inflate(R.layout.dialog_plaintext_warning, null); - AlertDialog dialog = new AlertDialog.Builder(this) + AlertDialog dialog = new MaterialAlertDialogBuilder(this) .setTitle(R.string.backup_plaintext_export_warning) .setView(view) .setPositiveButton(android.R.string.ok, null) @@ -914,8 +915,6 @@ public void onEntryClick(VaultEntry entry) { setFavoriteMenuItemVisiblity(); setIsMultipleSelected(_selectedEntries.size() > 1); } - - return; } } diff --git a/app/src/main/java/com/beemdevelopment/aegis/ui/PreferencesActivity.java b/app/src/main/java/com/beemdevelopment/aegis/ui/PreferencesActivity.java index cabf338cec..0bcccc2856 100644 --- a/app/src/main/java/com/beemdevelopment/aegis/ui/PreferencesActivity.java +++ b/app/src/main/java/com/beemdevelopment/aegis/ui/PreferencesActivity.java @@ -16,6 +16,7 @@ public class PreferencesActivity extends AegisActivity implements PreferenceFragmentCompat.OnPreferenceStartFragmentCallback { private Fragment _fragment; + private CharSequence _prefTitle; @Override protected void onCreate(Bundle savedInstanceState) { @@ -48,6 +49,10 @@ protected void onCreate(Bundle savedInstanceState) { } } else { _fragment = getSupportFragmentManager().findFragmentById(R.id.content); + _prefTitle = savedInstanceState.getCharSequence("prefTitle"); + if (_prefTitle != null) { + setTitle(_prefTitle); + } } } @@ -69,6 +74,7 @@ protected void onSaveInstanceState(@NonNull final Bundle outState) { // this is done so we don't lose anything if the fragment calls recreate on this activity outState.putParcelable("result", ((PreferencesFragment) _fragment).getResult()); } + outState.putCharSequence("prefTitle", _prefTitle); super.onSaveInstanceState(outState); } @@ -90,7 +96,8 @@ public boolean onPreferenceStartFragment(@NonNull PreferenceFragmentCompat calle _fragment.setTargetFragment(caller, 0); showFragment(_fragment); - setTitle(pref.getTitle()); + _prefTitle = pref.getTitle(); + setTitle(_prefTitle); return true; } diff --git a/app/src/main/java/com/beemdevelopment/aegis/ui/ScannerActivity.java b/app/src/main/java/com/beemdevelopment/aegis/ui/ScannerActivity.java index c5762bbdb8..376ddb0350 100644 --- a/app/src/main/java/com/beemdevelopment/aegis/ui/ScannerActivity.java +++ b/app/src/main/java/com/beemdevelopment/aegis/ui/ScannerActivity.java @@ -18,7 +18,6 @@ import androidx.core.content.ContextCompat; import com.beemdevelopment.aegis.R; -import com.beemdevelopment.aegis.ThemeMap; import com.beemdevelopment.aegis.helpers.QrCodeAnalyzer; import com.beemdevelopment.aegis.otp.GoogleAuthInfo; import com.beemdevelopment.aegis.otp.GoogleAuthInfoException; @@ -95,11 +94,6 @@ protected void onDestroy() { super.onDestroy(); } - @Override - protected void onSetTheme() { - setTheme(ThemeMap.FULLSCREEN); - } - @Override public boolean onCreateOptionsMenu(Menu menu) { _menu = menu; diff --git a/app/src/main/java/com/beemdevelopment/aegis/ui/dialogs/Dialogs.java b/app/src/main/java/com/beemdevelopment/aegis/ui/dialogs/Dialogs.java index 8e0bbb51e9..d6557890c8 100644 --- a/app/src/main/java/com/beemdevelopment/aegis/ui/dialogs/Dialogs.java +++ b/app/src/main/java/com/beemdevelopment/aegis/ui/dialogs/Dialogs.java @@ -40,6 +40,7 @@ import com.beemdevelopment.aegis.vault.slots.PasswordSlot; import com.beemdevelopment.aegis.vault.slots.Slot; import com.beemdevelopment.aegis.vault.slots.SlotException; +import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.android.material.textfield.TextInputEditText; import com.google.android.material.textfield.TextInputLayout; import com.nulabinc.zxcvbn.Strength; @@ -87,7 +88,7 @@ public static void showDeleteEntriesDialog(Context context, List ser } textMessage.setText(message); - showSecureDialog(new AlertDialog.Builder(context) + showSecureDialog(new MaterialAlertDialogBuilder(context) .setTitle(title) .setView(view) .setPositiveButton(android.R.string.yes, onDelete) @@ -108,7 +109,7 @@ private static String getVaultEntryName(Context context, VaultEntry entry) { } public static void showDiscardDialog(Context context, DialogInterface.OnClickListener onSave, DialogInterface.OnClickListener onDiscard) { - showSecureDialog(new AlertDialog.Builder(context) + showSecureDialog(new MaterialAlertDialogBuilder(context) .setTitle(context.getString(R.string.discard_changes)) .setMessage(context.getString(R.string.discard_changes_description)) .setPositiveButton(R.string.save, onSave) @@ -138,7 +139,7 @@ public static void showSetPasswordDialog(ComponentActivity activity, PasswordSlo } }); - AlertDialog dialog = new AlertDialog.Builder(activity) + AlertDialog dialog = new MaterialAlertDialogBuilder(activity) .setTitle(R.string.set_password) .setView(view) .setPositiveButton(android.R.string.ok, null) @@ -209,7 +210,7 @@ private static void showTextInputDialog(Context context, @StringRes int titleId, } inputLayout.setHint(hintId); - AlertDialog.Builder builder = new AlertDialog.Builder(context) + MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(context) .setTitle(titleId) .setView(view) .setPositiveButton(android.R.string.ok, null); @@ -272,7 +273,7 @@ public static void showCheckboxDialog(Context context, @StringRes int titleId, @ CheckBox checkBox = view.findViewById(R.id.checkbox); checkBox.setText(checkboxMessageId); - AlertDialog.Builder builder = new AlertDialog.Builder(context) + MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(context) .setTitle(titleId) .setView(view) .setNegativeButton(R.string.no, (dialog1, which) -> @@ -306,7 +307,7 @@ public static void showTapToRevealTimeoutPickerDialog(Context context, int curre numberPicker.setValue(currentValue); numberPicker.setWrapSelectorWheel(true); - AlertDialog dialog = new AlertDialog.Builder(context) + AlertDialog dialog = new MaterialAlertDialogBuilder(context) .setTitle(R.string.set_number) .setView(view) .setPositiveButton(android.R.string.ok, (dialog1, which) -> @@ -331,7 +332,7 @@ public static void showBackupVersionsPickerDialog(Context context, int currentVe numberPicker.setValue(currentVersionCount / 5 - 1); numberPicker.setWrapSelectorWheel(false); - AlertDialog dialog = new AlertDialog.Builder(context) + AlertDialog dialog = new MaterialAlertDialogBuilder(context) .setTitle(R.string.set_number) .setView(view) .setPositiveButton(android.R.string.ok, (dialog1, which) -> @@ -372,7 +373,7 @@ public static void showErrorDialog(Context context, String message, CharSequence TextView textMessage = view.findViewById(R.id.error_message); textMessage.setText(message); - AlertDialog dialog = new AlertDialog.Builder(context) + AlertDialog dialog = new MaterialAlertDialogBuilder(context) .setTitle(R.string.error_occurred) .setView(view) .setCancelable(false) @@ -414,7 +415,7 @@ public static void showBackupErrorDialog(Context context, Preferences.BackupResu public static void showMultiMessageDialog( Context context, @StringRes int title, String message, List messages, DialogInterface.OnClickListener listener) { - Dialogs.showSecureDialog(new AlertDialog.Builder(context) + Dialogs.showSecureDialog(new MaterialAlertDialogBuilder(context) .setTitle(title) .setMessage(message) .setCancelable(false) @@ -447,7 +448,7 @@ private static void showDetailedMultiMessageDialog( builder.append("\n\n"); } - AlertDialog dialog = new AlertDialog.Builder(context) + AlertDialog dialog = new MaterialAlertDialogBuilder(context) .setTitle(title) .setMessage(builder) .setCancelable(false) @@ -477,7 +478,7 @@ public static void showTimeSyncWarningDialog(Context context, Dialog.OnClickList View view = LayoutInflater.from(context).inflate(R.layout.dialog_time_sync, null); CheckBox checkBox = view.findViewById(R.id.check_warning_disable); - showSecureDialog(new AlertDialog.Builder(context) + showSecureDialog(new MaterialAlertDialogBuilder(context) .setTitle(R.string.time_sync_warning_title) .setView(view) .setCancelable(false) @@ -515,7 +516,7 @@ public static void showImportersDialog(Context context, boolean isDirect, Import setImporterHelpText(helpText, importers.get(position), isDirect); }); - Dialogs.showSecureDialog(new AlertDialog.Builder(context) + Dialogs.showSecureDialog(new MaterialAlertDialogBuilder(context) .setTitle(R.string.choose_application) .setView(view) .setPositiveButton(android.R.string.ok, (dialog1, which) -> { @@ -536,7 +537,7 @@ public static void showPartialGoogleAuthImportWarningDialog(Context context, Lis errorDetails.append("\n\n"); } - AlertDialog.Builder builder = new AlertDialog.Builder(context) + MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(context) .setTitle(R.string.partial_google_auth_import) .setMessage(context.getString(R.string.partial_google_auth_import_warning, missingIndexesAsString)) .setView(view) diff --git a/app/src/main/java/com/beemdevelopment/aegis/ui/dialogs/SimpleWebViewDialog.java b/app/src/main/java/com/beemdevelopment/aegis/ui/dialogs/SimpleWebViewDialog.java index 930da65e0b..cf984aead2 100644 --- a/app/src/main/java/com/beemdevelopment/aegis/ui/dialogs/SimpleWebViewDialog.java +++ b/app/src/main/java/com/beemdevelopment/aegis/ui/dialogs/SimpleWebViewDialog.java @@ -18,6 +18,7 @@ import com.beemdevelopment.aegis.R; import com.beemdevelopment.aegis.Theme; import com.beemdevelopment.aegis.helpers.ThemeHelper; +import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.common.io.CharStreams; import java.io.IOException; @@ -44,14 +45,14 @@ public Dialog onCreateDialog(Bundle savedInstanceState) { view = LayoutInflater.from(requireContext()).inflate(R.layout.dialog_web_view, null); } catch (InflateException e) { e.printStackTrace(); - return new AlertDialog.Builder(requireContext()) + return new MaterialAlertDialogBuilder(requireContext()) .setTitle(android.R.string.dialog_alert_title) .setMessage(getString(R.string.webview_error)) .setPositiveButton(android.R.string.ok, null) .show(); } - AlertDialog dialog = new AlertDialog.Builder(requireContext()) + AlertDialog dialog = new MaterialAlertDialogBuilder(requireContext()) .setTitle(_title) .setView(view) .setPositiveButton(android.R.string.ok, null) @@ -69,12 +70,11 @@ public SimpleWebViewDialog setTheme(Theme theme) { } protected String getBackgroundColor() { - int backgroundColorResource = _theme == Theme.AMOLED ? R.attr.cardBackgroundFocused : R.attr.cardBackground; - return colorToCSS(ThemeHelper.getThemeColor(backgroundColorResource, requireContext().getTheme())); + return colorToCSS(ThemeHelper.getThemeColor(com.google.android.material.R.attr.colorSurfaceContainerHigh, requireContext().getTheme())); } protected String getTextColor() { - return colorToCSS(0xFFFFFF & ThemeHelper.getThemeColor(R.attr.primaryText, requireContext().getTheme())); + return colorToCSS(0xFFFFFF & ThemeHelper.getThemeColor(com.google.android.material.R.attr.colorOnSurface, requireContext().getTheme())); } @SuppressLint("DefaultLocale") diff --git a/app/src/main/java/com/beemdevelopment/aegis/ui/fragments/preferences/AppearancePreferencesFragment.java b/app/src/main/java/com/beemdevelopment/aegis/ui/fragments/preferences/AppearancePreferencesFragment.java index 3c99f55b9a..c8f324c70c 100644 --- a/app/src/main/java/com/beemdevelopment/aegis/ui/fragments/preferences/AppearancePreferencesFragment.java +++ b/app/src/main/java/com/beemdevelopment/aegis/ui/fragments/preferences/AppearancePreferencesFragment.java @@ -8,11 +8,17 @@ import androidx.preference.Preference; import com.beemdevelopment.aegis.AccountNamePosition; +import com.beemdevelopment.aegis.Preferences; import com.beemdevelopment.aegis.R; import com.beemdevelopment.aegis.Theme; import com.beemdevelopment.aegis.ViewMode; import com.beemdevelopment.aegis.ui.GroupManagerActivity; import com.beemdevelopment.aegis.ui.dialogs.Dialogs; +import com.google.android.material.color.DynamicColors; +import com.google.android.material.dialog.MaterialAlertDialogBuilder; + +import java.util.Arrays; +import java.util.List; public class AppearancePreferencesFragment extends PreferencesFragment { private Preference _groupsPreference; @@ -33,7 +39,7 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { _resetUsageCountPreference = requirePreference("pref_reset_usage_count"); _resetUsageCountPreference.setOnPreferenceClickListener(preference -> { - Dialogs.showSecureDialog(new AlertDialog.Builder(requireContext()) + Dialogs.showSecureDialog(new MaterialAlertDialogBuilder(requireContext()) .setTitle(R.string.preference_reset_usage_count) .setMessage(R.string.preference_reset_usage_count_dialog) .setPositiveButton(android.R.string.yes, (dialog, which) -> _prefs.clearUsageCount()) @@ -48,7 +54,7 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { darkModePreference.setOnPreferenceClickListener(preference -> { int currentTheme1 = _prefs.getCurrentTheme().ordinal(); - Dialogs.showSecureDialog(new AlertDialog.Builder(requireContext()) + Dialogs.showSecureDialog(new MaterialAlertDialogBuilder(requireContext()) .setTitle(R.string.choose_theme) .setSingleChoiceItems(R.array.theme_titles, currentTheme1, (dialog, which) -> { int i = ((AlertDialog) dialog).getListView().getCheckedItemPosition(); @@ -65,11 +71,36 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { return true; }); + Preference dynamicColorsPreference = requirePreference("pref_dynamic_colors"); + dynamicColorsPreference.setEnabled(DynamicColors.isDynamicColorAvailable()); + dynamicColorsPreference.setOnPreferenceChangeListener((preference, newValue) -> { + getResult().putExtra("needsRecreate", true); + requireActivity().recreate(); + return true; + }); + Preference langPreference = requirePreference("pref_lang"); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - langPreference.setOnPreferenceChangeListener((preference, newValue) -> { - getResult().putExtra("needsRecreate", true); - requireActivity().recreate(); + String[] langs = getResources().getStringArray(R.array.pref_lang_values); + String[] langNames = getResources().getStringArray(R.array.pref_lang_entries); + List langList = Arrays.asList(langs); + int curLangIndex = langList.contains(_prefs.getLanguage()) ? langList.indexOf(_prefs.getLanguage()) : 0; + langPreference.setSummary(langNames[curLangIndex]); + langPreference.setOnPreferenceClickListener(preference -> { + Dialogs.showSecureDialog(new MaterialAlertDialogBuilder(requireContext()) + .setTitle(R.string.pref_lang_title) + .setSingleChoiceItems(langNames, curLangIndex, (dialog, which) -> { + int newLangIndex = ((AlertDialog) dialog).getListView().getCheckedItemPosition(); + _prefs.setLanguage(langs[newLangIndex]); + langPreference.setSummary(langNames[newLangIndex]); + + dialog.dismiss(); + + getResult().putExtra("needsRecreate", true); + requireActivity().recreate(); + }) + .setNegativeButton(android.R.string.cancel, null) + .create()); return true; }); } else { @@ -83,7 +114,7 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { viewModePreference.setOnPreferenceClickListener(preference -> { int currentViewMode1 = _prefs.getCurrentViewMode().ordinal(); - Dialogs.showSecureDialog(new AlertDialog.Builder(requireContext()) + Dialogs.showSecureDialog(new MaterialAlertDialogBuilder(requireContext()) .setTitle(R.string.choose_view_mode) .setSingleChoiceItems(R.array.view_mode_titles, currentViewMode1, (dialog, which) -> { int i = ((AlertDialog) dialog).getListView().getCheckedItemPosition(); @@ -99,9 +130,22 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { return true; }); + String[] codeGroupings = getResources().getStringArray(R.array.pref_code_groupings_values); + String[] codeGroupingNames = getResources().getStringArray(R.array.pref_code_groupings); + int currentCodeGroupingIndex = Arrays.asList(codeGroupings).indexOf(_prefs.getCodeGroupSize().name()); Preference codeDigitGroupingPreference = requirePreference("pref_code_group_size_string"); - codeDigitGroupingPreference.setOnPreferenceChangeListener((preference, newValue) -> { - getResult().putExtra("needsRefresh", true); + codeDigitGroupingPreference.setOnPreferenceClickListener(preference -> { + Dialogs.showSecureDialog(new MaterialAlertDialogBuilder(requireContext()) + .setTitle(R.string.pref_code_group_size_title) + .setSingleChoiceItems(codeGroupingNames, currentCodeGroupingIndex, (dialog, which) -> { + int newCodeGroupingIndex = ((AlertDialog) dialog).getListView().getCheckedItemPosition(); + _prefs.setCodeGroupSize(Preferences.CodeGrouping.valueOf(codeGroupings[newCodeGroupingIndex])); + + dialog.dismiss(); + getResult().putExtra("needsRefresh", true); + }) + .setNegativeButton(android.R.string.cancel, null) + .create()); return true; }); @@ -117,7 +161,7 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { _currentAccountNamePositionPreference.setOnPreferenceClickListener(preference -> { int currentAccountNamePosition1 = _prefs.getAccountNamePosition().ordinal(); - Dialogs.showSecureDialog(new AlertDialog.Builder(requireContext()) + Dialogs.showSecureDialog(new MaterialAlertDialogBuilder(requireContext()) .setTitle(getString(R.string.choose_account_name_position)) .setSingleChoiceItems(R.array.account_name_position_titles, currentAccountNamePosition1, (dialog, which) -> { int i = ((AlertDialog) dialog).getListView().getCheckedItemPosition(); diff --git a/app/src/main/java/com/beemdevelopment/aegis/ui/fragments/preferences/BackupsPreferencesFragment.java b/app/src/main/java/com/beemdevelopment/aegis/ui/fragments/preferences/BackupsPreferencesFragment.java index 48a4032c22..9711a1c7b6 100644 --- a/app/src/main/java/com/beemdevelopment/aegis/ui/fragments/preferences/BackupsPreferencesFragment.java +++ b/app/src/main/java/com/beemdevelopment/aegis/ui/fragments/preferences/BackupsPreferencesFragment.java @@ -17,6 +17,7 @@ import com.beemdevelopment.aegis.Preferences; import com.beemdevelopment.aegis.R; +import com.beemdevelopment.aegis.helpers.ThemeHelper; import com.beemdevelopment.aegis.ui.dialogs.Dialogs; import com.beemdevelopment.aegis.vault.VaultRepositoryException; @@ -201,21 +202,21 @@ private void updateBackupStatus(Preference pref, Preferences.BackupResult res) { private CharSequence getBackupStatusMessage(@Nullable Preferences.BackupResult res) { String message; - int color = R.color.warning_color; + int color = ThemeHelper.getThemeColor(com.google.android.material.R.attr.colorError, requireContext().getTheme()); if (res == null) { message = getString(R.string.backup_status_none); } else if (res.isSuccessful()) { - color = R.color.success_color; + // TODO: add new color for success message = getString(R.string.backup_status_success, res.getElapsedSince(requireContext())); } else { message = getString(R.string.backup_status_failed, res.getElapsedSince(requireContext())); } Spannable spannable = new SpannableString(message); - spannable.setSpan(new ForegroundColorSpan(getResources().getColor(color)), 0, message.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); - if (color == R.color.warning_color) { + spannable.setSpan(new ForegroundColorSpan(color), 0, message.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + /*if (color == R.color.warning_color) { spannable.setSpan(new StyleSpan(Typeface.BOLD), 0, message.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); - } + }*/ return spannable; } diff --git a/app/src/main/java/com/beemdevelopment/aegis/ui/fragments/preferences/BehaviorPreferencesFragment.java b/app/src/main/java/com/beemdevelopment/aegis/ui/fragments/preferences/BehaviorPreferencesFragment.java index 47646418f1..278f53ddda 100644 --- a/app/src/main/java/com/beemdevelopment/aegis/ui/fragments/preferences/BehaviorPreferencesFragment.java +++ b/app/src/main/java/com/beemdevelopment/aegis/ui/fragments/preferences/BehaviorPreferencesFragment.java @@ -8,6 +8,7 @@ import com.beemdevelopment.aegis.CopyBehavior; import com.beemdevelopment.aegis.R; import com.beemdevelopment.aegis.ui.dialogs.Dialogs; +import com.google.android.material.dialog.MaterialAlertDialogBuilder; public class BehaviorPreferencesFragment extends PreferencesFragment { private Preference _entryPausePreference; @@ -23,7 +24,7 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { copyBehaviorPreference.setOnPreferenceClickListener(preference -> { int currentCopyBehavior1 = _prefs.getCopyBehavior().ordinal(); - Dialogs.showSecureDialog(new AlertDialog.Builder(requireContext()) + Dialogs.showSecureDialog(new MaterialAlertDialogBuilder(requireContext()) .setTitle(getString(R.string.choose_copy_behavior)) .setSingleChoiceItems(R.array.copy_behavior_titles, currentCopyBehavior1, (dialog, which) -> { int i = ((AlertDialog) dialog).getListView().getCheckedItemPosition(); diff --git a/app/src/main/java/com/beemdevelopment/aegis/ui/fragments/preferences/IconPacksManagerFragment.java b/app/src/main/java/com/beemdevelopment/aegis/ui/fragments/preferences/IconPacksManagerFragment.java index bc38e7f9dd..04071b1100 100644 --- a/app/src/main/java/com/beemdevelopment/aegis/ui/fragments/preferences/IconPacksManagerFragment.java +++ b/app/src/main/java/com/beemdevelopment/aegis/ui/fragments/preferences/IconPacksManagerFragment.java @@ -12,7 +12,6 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import androidx.appcompat.app.AlertDialog; import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; @@ -28,6 +27,7 @@ import com.beemdevelopment.aegis.ui.tasks.ImportIconPackTask; import com.beemdevelopment.aegis.ui.views.IconPackAdapter; import com.beemdevelopment.aegis.vault.VaultManager; +import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.android.material.floatingactionbutton.FloatingActionButton; import javax.inject.Inject; @@ -94,7 +94,7 @@ public Animation onCreateAnimation(int transit, boolean enter, int nextAnim) { @Override public void onRemoveIconPack(IconPack pack) { - Dialogs.showSecureDialog(new AlertDialog.Builder(requireContext()) + Dialogs.showSecureDialog(new MaterialAlertDialogBuilder(requireContext()) .setTitle(R.string.remove_icon_pack) .setMessage(R.string.remove_icon_pack_description) .setPositiveButton(android.R.string.yes, (dialog, whichButton) -> { @@ -125,7 +125,7 @@ private void importIconPack(Uri uri) { ImportIconPackTask task = new ImportIconPackTask(requireContext(), result -> { Exception e = result.getException(); if (e instanceof IconPackExistsException) { - Dialogs.showSecureDialog(new AlertDialog.Builder(requireContext()) + Dialogs.showSecureDialog(new MaterialAlertDialogBuilder(requireContext()) .setTitle(R.string.error_occurred) .setMessage(R.string.icon_pack_import_exists_error) .setPositiveButton(R.string.yes, (dialog, which) -> { diff --git a/app/src/main/java/com/beemdevelopment/aegis/ui/fragments/preferences/ImportExportPreferencesFragment.java b/app/src/main/java/com/beemdevelopment/aegis/ui/fragments/preferences/ImportExportPreferencesFragment.java index 43c5da61cb..4cfe78bbdb 100644 --- a/app/src/main/java/com/beemdevelopment/aegis/ui/fragments/preferences/ImportExportPreferencesFragment.java +++ b/app/src/main/java/com/beemdevelopment/aegis/ui/fragments/preferences/ImportExportPreferencesFragment.java @@ -43,6 +43,7 @@ import com.beemdevelopment.aegis.vault.VaultRepositoryException; import com.beemdevelopment.aegis.vault.slots.PasswordSlot; import com.beemdevelopment.aegis.vault.slots.SlotException; +import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.android.material.textfield.TextInputLayout; import java.io.File; @@ -193,7 +194,7 @@ private void startExport() { groupsSelection.addItems(groupsArray, false); } - AlertDialog dialog = new AlertDialog.Builder(requireContext()) + AlertDialog dialog = new MaterialAlertDialogBuilder(requireContext()) .setTitle(R.string.pref_export_summary) .setView(view) .setNeutralButton(R.string.share, null) diff --git a/app/src/main/java/com/beemdevelopment/aegis/ui/fragments/preferences/SecurityPreferencesFragment.java b/app/src/main/java/com/beemdevelopment/aegis/ui/fragments/preferences/SecurityPreferencesFragment.java index f17860173b..9c9e18de26 100644 --- a/app/src/main/java/com/beemdevelopment/aegis/ui/fragments/preferences/SecurityPreferencesFragment.java +++ b/app/src/main/java/com/beemdevelopment/aegis/ui/fragments/preferences/SecurityPreferencesFragment.java @@ -30,6 +30,7 @@ import com.beemdevelopment.aegis.vault.slots.Slot; import com.beemdevelopment.aegis.vault.slots.SlotException; import com.beemdevelopment.aegis.vault.slots.SlotList; +import com.google.android.material.dialog.MaterialAlertDialogBuilder; import java.util.Arrays; import java.util.List; @@ -91,7 +92,7 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { if (!_vaultManager.getVault().isEncryptionEnabled()) { Dialogs.showSetPasswordDialog(requireActivity(), new EnableEncryptionListener()); } else { - Dialogs.showSecureDialog(new AlertDialog.Builder(requireContext()) + Dialogs.showSecureDialog(new MaterialAlertDialogBuilder(requireContext()) .setTitle(R.string.disable_encryption) .setMessage(getText(R.string.disable_encryption_description)) .setPositiveButton(android.R.string.yes, (dialog, which) -> { @@ -169,7 +170,7 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { task.execute(getLifecycle(), params); } else { _pinKeyboardPreference.setChecked(false); - Dialogs.showSecureDialog(new AlertDialog.Builder(requireContext()) + Dialogs.showSecureDialog(new MaterialAlertDialogBuilder(requireContext()) .setTitle(R.string.pin_keyboard_error) .setMessage(R.string.pin_keyboard_error_description) .setCancelable(false) @@ -192,7 +193,7 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { checkedItems[i] = _prefs.isAutoLockTypeEnabled(items[i]); } - AlertDialog.Builder builder = new AlertDialog.Builder(requireContext()) + MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(requireContext()) .setTitle(R.string.pref_auto_lock_prompt) .setMultiChoiceItems(textItems, checkedItems, (dialog, index, isChecked) -> checkedItems[index] = isChecked) .setPositiveButton(android.R.string.ok, (dialog, which) -> { @@ -221,7 +222,7 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { .map(f -> getString(f.getStringRes())) .toArray(String[]::new); - AlertDialog.Builder builder = new AlertDialog.Builder(requireContext()) + MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(requireContext()) .setTitle(R.string.pref_password_reminder_title) .setSingleChoiceItems(textItems, currFreq.ordinal(), (dialog, which) -> { int i = ((AlertDialog) dialog).getListView().getCheckedItemPosition(); @@ -459,7 +460,7 @@ public void onTaskFinished(PasswordSlotDecryptTask.Result result) { if (result != null) { _pinKeyboardPreference.setChecked(true); } else { - Dialogs.showSecureDialog(new AlertDialog.Builder(requireContext()) + Dialogs.showSecureDialog(new MaterialAlertDialogBuilder(requireContext()) .setTitle(R.string.pin_keyboard_error) .setMessage(R.string.invalid_password) .setCancelable(false) diff --git a/app/src/main/java/com/beemdevelopment/aegis/ui/tasks/ProgressDialogTask.java b/app/src/main/java/com/beemdevelopment/aegis/ui/tasks/ProgressDialogTask.java index d7d6cf86bc..ddd9001ffa 100644 --- a/app/src/main/java/com/beemdevelopment/aegis/ui/tasks/ProgressDialogTask.java +++ b/app/src/main/java/com/beemdevelopment/aegis/ui/tasks/ProgressDialogTask.java @@ -1,26 +1,38 @@ package com.beemdevelopment.aegis.ui.tasks; import android.app.Dialog; -import android.app.ProgressDialog; import android.content.Context; import android.os.AsyncTask; import android.os.Process; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.TextView; import androidx.annotation.CallSuper; import androidx.annotation.Nullable; +import androidx.appcompat.app.AlertDialog; import androidx.lifecycle.Lifecycle; import androidx.lifecycle.LifecycleObserver; import androidx.lifecycle.OnLifecycleEvent; +import com.beemdevelopment.aegis.R; import com.beemdevelopment.aegis.ui.dialogs.Dialogs; +import com.google.android.material.dialog.MaterialAlertDialogBuilder; public abstract class ProgressDialogTask extends AsyncTask { - private ProgressDialog _dialog; + private final AlertDialog _dialog; + private final TextView _textProgress; public ProgressDialogTask(Context context, String message) { - _dialog = new ProgressDialog(context); - _dialog.setCancelable(false); - _dialog.setMessage(message); + View view = LayoutInflater.from(context).inflate(R.layout.dialog_progress, null); + _textProgress = view.findViewById(R.id.text_progress); + _textProgress.setText(message); + + _dialog = new MaterialAlertDialogBuilder(context) + .setView(view) + .setCancelable(false) + .create(); + Dialogs.secureDialog(_dialog); } @@ -41,7 +53,7 @@ protected void onPostExecute(Result result) { @Override protected void onProgressUpdate(String... values) { if (values.length == 1) { - _dialog.setMessage(values[0]); + _textProgress.setText(values[0]); } } @@ -49,7 +61,7 @@ protected void setPriority() { Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND + Process.THREAD_PRIORITY_MORE_FAVORABLE); } - protected final ProgressDialog getDialog() { + protected final AlertDialog getDialog() { return _dialog; } diff --git a/app/src/main/java/com/beemdevelopment/aegis/ui/views/EntryHolder.java b/app/src/main/java/com/beemdevelopment/aegis/ui/views/EntryHolder.java index 1ca87ad3bf..3e26b9988d 100644 --- a/app/src/main/java/com/beemdevelopment/aegis/ui/views/EntryHolder.java +++ b/app/src/main/java/com/beemdevelopment/aegis/ui/views/EntryHolder.java @@ -88,9 +88,9 @@ public EntryHolder(final View view) { _animationHandler = new Handler(); _progressBar = view.findViewById(R.id.progressBar); - int primaryColorId = view.getContext().getResources().getColor(R.color.colorPrimary); - _progressBar.getProgressDrawable().setColorFilter(primaryColorId, PorterDuff.Mode.SRC_IN); - _view.setBackground(_view.getContext().getResources().getDrawable(R.color.card_background)); + //int primaryColorId = view.getContext().getResources().getColor(R.color.colorPrimary); + //_progressBar.getProgressDrawable().setColorFilter(primaryColorId, PorterDuff.Mode.SRC_IN); + //_view.setBackground(_view.getContext().getResources().getDrawable(R.color.card_background)); _scaleIn = AnimationsHelper.loadScaledAnimation(view.getContext(), R.anim.item_scale_in); _scaleOut = AnimationsHelper.loadScaledAnimation(view.getContext(), R.anim.item_scale_out); @@ -245,9 +245,9 @@ public void setShowProgress(boolean showProgress) { public void setFocused(boolean focused) { if (focused) { _selected.setVisibility(View.VISIBLE); - _view.setBackgroundColor(ThemeHelper.getThemeColor(R.attr.cardBackgroundFocused, _view.getContext().getTheme())); + _view.setBackgroundColor(ThemeHelper.getThemeColor(com.google.android.material.R.attr.colorSurfaceVariant, _view.getContext().getTheme())); } else { - _view.setBackgroundColor(ThemeHelper.getThemeColor(R.attr.cardBackground, _view.getContext().getTheme())); + _view.setBackgroundColor(ThemeHelper.getThemeColor(com.google.android.material.R.attr.colorSurfaceContainer, _view.getContext().getTheme())); } _view.setSelected(focused); } diff --git a/app/src/main/java/com/beemdevelopment/aegis/ui/views/EntryListView.java b/app/src/main/java/com/beemdevelopment/aegis/ui/views/EntryListView.java index d67448eca6..08a7abbcfc 100644 --- a/app/src/main/java/com/beemdevelopment/aegis/ui/views/EntryListView.java +++ b/app/src/main/java/com/beemdevelopment/aegis/ui/views/EntryListView.java @@ -473,7 +473,7 @@ public void runEntriesAnimation() { } private void addChipTo(ChipGroup chipGroup, VaultGroupModel group) { - Chip chip = (Chip) getLayoutInflater().inflate(R.layout.chip_material, null, false); + Chip chip = (Chip) getLayoutInflater().inflate(R.layout.chip_group_filter, null, false); chip.setText(group.getName()); chip.setCheckable(true); chip.setChecked(_groupFilter != null && _groupFilter.contains(group.getUUID())); diff --git a/app/src/main/java/com/beemdevelopment/aegis/ui/views/IconHolder.java b/app/src/main/java/com/beemdevelopment/aegis/ui/views/IconHolder.java index a583d3fe66..5e4d95e7cd 100644 --- a/app/src/main/java/com/beemdevelopment/aegis/ui/views/IconHolder.java +++ b/app/src/main/java/com/beemdevelopment/aegis/ui/views/IconHolder.java @@ -41,7 +41,7 @@ public void setData(IconPack.Icon icon) { public void loadIcon(Context context) { if (_isCustom) { - int tint = ThemeHelper.getThemeColor(R.attr.iconColorPrimary, context.getTheme()); + int tint = ThemeHelper.getThemeColor(com.google.android.material.R.attr.colorOnSurfaceVariant, context.getTheme()); _imageView.setColorFilter(tint); _imageView.setImageResource(R.drawable.ic_plus_black_24dp); } else { diff --git a/app/src/main/res/color/bg_chip_color.xml b/app/src/main/res/color/bg_chip_color.xml deleted file mode 100644 index 49f207328b..0000000000 --- a/app/src/main/res/color/bg_chip_color.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/color/bg_chip_text_color.xml b/app/src/main/res/color/bg_chip_text_color.xml deleted file mode 100644 index 3ff71a3e45..0000000000 --- a/app/src/main/res/color/bg_chip_text_color.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/color/dialog_button_color.xml b/app/src/main/res/color/dialog_button_color.xml index 90c773d57b..6abb6590fd 100644 --- a/app/src/main/res/color/dialog_button_color.xml +++ b/app/src/main/res/color/dialog_button_color.xml @@ -1,5 +1,5 @@ - - + + diff --git a/app/src/main/res/color/disabled_textview_colors.xml b/app/src/main/res/color/disabled_textview_colors.xml deleted file mode 100644 index adbd5b7eb6..0000000000 --- a/app/src/main/res/color/disabled_textview_colors.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/color/text_input_box_icon_dark.xml b/app/src/main/res/color/text_input_box_icon_dark.xml deleted file mode 100644 index be0cce5900..0000000000 --- a/app/src/main/res/color/text_input_box_icon_dark.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/color/text_input_box_stroke_dark.xml b/app/src/main/res/color/text_input_box_stroke_dark.xml deleted file mode 100644 index 378a738114..0000000000 --- a/app/src/main/res/color/text_input_box_stroke_dark.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/app/src/main/res/drawable-anydpi/ic_set_favorite.xml b/app/src/main/res/drawable-anydpi/ic_set_favorite.xml index 13942be1f6..7c46067713 100644 --- a/app/src/main/res/drawable-anydpi/ic_set_favorite.xml +++ b/app/src/main/res/drawable-anydpi/ic_set_favorite.xml @@ -3,7 +3,7 @@ android:height="24dp" android:viewportWidth="24" android:viewportHeight="24" - android:tint="#FFFFFF"> + android:tint="?attr/colorControlNormal"> + android:tint="?attr/colorControlNormal"> - - - - - diff --git a/app/src/main/res/drawable-xhdpi/ic_action_sort.png b/app/src/main/res/drawable-xhdpi/ic_action_sort.png deleted file mode 100644 index 2184723d0a..0000000000 Binary files a/app/src/main/res/drawable-xhdpi/ic_action_sort.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_sort.png b/app/src/main/res/drawable-xxhdpi/ic_action_sort.png deleted file mode 100644 index ca1da3157f..0000000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_action_sort.png and /dev/null differ diff --git a/app/src/main/res/drawable/drag_handle.xml b/app/src/main/res/drawable/drag_handle.xml deleted file mode 100644 index 2a8df4730b..0000000000 --- a/app/src/main/res/drawable/drag_handle.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - diff --git a/app/src/main/res/drawable/button_rounded_corners.xml b/app/src/main/res/drawable/favorite_indicator.xml similarity index 54% rename from app/src/main/res/drawable/button_rounded_corners.xml rename to app/src/main/res/drawable/favorite_indicator.xml index 20b385ab74..ae283bcdc6 100644 --- a/app/src/main/res/drawable/button_rounded_corners.xml +++ b/app/src/main/res/drawable/favorite_indicator.xml @@ -2,9 +2,8 @@ - - - + + diff --git a/app/src/main/res/drawable-anydpi/ic_action_sort.xml b/app/src/main/res/drawable/ic_action_sort.xml similarity index 75% rename from app/src/main/res/drawable-anydpi/ic_action_sort.xml rename to app/src/main/res/drawable/ic_action_sort.xml index ef66d1c4ca..f5cee24091 100644 --- a/app/src/main/res/drawable-anydpi/ic_action_sort.xml +++ b/app/src/main/res/drawable/ic_action_sort.xml @@ -3,8 +3,8 @@ android:height="24dp" android:viewportWidth="24" android:viewportHeight="24" - android:tint="#FFFFFF"> + android:tint="?attr/colorControlNormal"> diff --git a/app/src/main/res/drawable/ic_baseline_filter_list_24dp.xml b/app/src/main/res/drawable/ic_baseline_filter_list_24dp.xml index 997895c930..c23540e6dd 100644 --- a/app/src/main/res/drawable/ic_baseline_filter_list_24dp.xml +++ b/app/src/main/res/drawable/ic_baseline_filter_list_24dp.xml @@ -4,7 +4,7 @@ android:viewportWidth="24.0" android:viewportHeight="24.0"> diff --git a/app/src/main/res/drawable/ic_close.xml b/app/src/main/res/drawable/ic_close.xml index b5c7319f8f..49be74cef5 100644 --- a/app/src/main/res/drawable/ic_close.xml +++ b/app/src/main/res/drawable/ic_close.xml @@ -3,7 +3,8 @@ android:width="24dp" android:height="24dp" android:viewportWidth="24" - android:viewportHeight="24"> + android:viewportHeight="24" + android:tint="?attr/colorControlNormal"> diff --git a/app/src/main/res/drawable/ic_content_copy_white_24dp.xml b/app/src/main/res/drawable/ic_content_copy_white_24dp.xml index 1e689ac6e5..ac30b89742 100644 --- a/app/src/main/res/drawable/ic_content_copy_white_24dp.xml +++ b/app/src/main/res/drawable/ic_content_copy_white_24dp.xml @@ -4,5 +4,5 @@ android:width="24dp" android:viewportWidth="24" android:viewportHeight="24"> - + diff --git a/app/src/main/res/drawable/ic_delete_white.xml b/app/src/main/res/drawable/ic_delete_white.xml index 8bed121aa6..a018331313 100644 --- a/app/src/main/res/drawable/ic_delete_white.xml +++ b/app/src/main/res/drawable/ic_delete_white.xml @@ -1,4 +1,4 @@ - diff --git a/app/src/main/res/drawable/ic_icon_unselected.xml b/app/src/main/res/drawable/ic_icon_unselected.xml index d60f168018..d0d7c42d56 100644 --- a/app/src/main/res/drawable/ic_icon_unselected.xml +++ b/app/src/main/res/drawable/ic_icon_unselected.xml @@ -1,5 +1,5 @@ - - + diff --git a/app/src/main/res/drawable/ic_lock.xml b/app/src/main/res/drawable/ic_lock.xml index 1987c06249..20cbef933e 100644 --- a/app/src/main/res/drawable/ic_lock.xml +++ b/app/src/main/res/drawable/ic_lock.xml @@ -1,5 +1,5 @@ - diff --git a/app/src/main/res/drawable/ic_mode_edit.xml b/app/src/main/res/drawable/ic_mode_edit.xml index 46462b5726..6f2aed4677 100644 --- a/app/src/main/res/drawable/ic_mode_edit.xml +++ b/app/src/main/res/drawable/ic_mode_edit.xml @@ -1,4 +1,4 @@ - diff --git a/app/src/main/res/drawable/ic_qr_code_full.xml b/app/src/main/res/drawable/ic_qr_code_full.xml index 9b5e128f37..af8a7b2886 100644 --- a/app/src/main/res/drawable/ic_qr_code_full.xml +++ b/app/src/main/res/drawable/ic_qr_code_full.xml @@ -1,6 +1,6 @@ - diff --git a/app/src/main/res/drawable/progress_horizontal.xml b/app/src/main/res/drawable/progress_horizontal.xml index d4abd09d3e..aba49cd058 100644 --- a/app/src/main/res/drawable/progress_horizontal.xml +++ b/app/src/main/res/drawable/progress_horizontal.xml @@ -2,9 +2,8 @@ - + - \ No newline at end of file diff --git a/app/src/main/res/drawable/rounded_background.xml b/app/src/main/res/drawable/rounded_background.xml index e2a884d876..682c748a9f 100644 --- a/app/src/main/res/drawable/rounded_background.xml +++ b/app/src/main/res/drawable/rounded_background.xml @@ -1,6 +1,6 @@ - + diff --git a/app/src/main/res/drawable/rounded_popup.xml b/app/src/main/res/drawable/rounded_popup.xml new file mode 100644 index 0000000000..1a3e3c4e4f --- /dev/null +++ b/app/src/main/res/drawable/rounded_popup.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/app/src/main/res/layout/activity_about.xml b/app/src/main/res/layout/activity_about.xml index 2caa4ad214..8a6c3b5182 100644 --- a/app/src/main/res/layout/activity_about.xml +++ b/app/src/main/res/layout/activity_about.xml @@ -4,17 +4,16 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="?attr/background" + android:fitsSystemWindows="true" tools:context="com.beemdevelopment.aegis.ui.AboutActivity"> - + + android:layout_height="?attr/actionBarSize" /> + android:fitsSystemWindows="true"> + android:layout_height="?attr/actionBarSize" /> + android:textSize="32sp"/> + app:passwordToggleTint="?attr/colorOnSurface"> + android:text="@string/unlock" /> @@ -109,10 +100,11 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|center" - android:textStyle="bold" - android:textAllCaps="true" android:text="@string/app_name_full" - android:paddingVertical="50dp" - android:textColor="@color/divider" /> + android:textSize="15sp" + android:textAllCaps="true" + android:textStyle="bold" + android:textColor="?attr/colorSurfaceDim" + android:paddingVertical="50dp" /> diff --git a/app/src/main/res/layout/activity_edit_entry.xml b/app/src/main/res/layout/activity_edit_entry.xml index 0991bf06e6..c9f0762c90 100644 --- a/app/src/main/res/layout/activity_edit_entry.xml +++ b/app/src/main/res/layout/activity_edit_entry.xml @@ -5,18 +5,17 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="?attr/background" android:orientation="vertical" + android:fitsSystemWindows="true" tools:context="com.beemdevelopment.aegis.ui.EditEntryActivity"> - + + android:layout_height="?attr/actionBarSize" /> + app:tint="?attr/colorOnSurface" /> - + android:layout_height="wrap_content" /> @@ -139,7 +136,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_baseline_notes_black_24" - app:tint="?attr/iconColorPrimary" + app:tint="?attr/colorOnSurface" android:layout_marginStart="5dp" android:layout_marginEnd="15dp" android:layout_gravity="center_vertical"/> @@ -165,7 +162,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_vpn_key_black_24dp" - app:tint="?attr/iconColorPrimary" + app:tint="?attr/colorOnSurface" android:layout_marginStart="5dp" android:layout_marginEnd="15dp" android:layout_gravity="center_vertical"/> @@ -174,7 +171,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" - app:passwordToggleTint="#949494" + app:passwordToggleTint="?attr/colorOnSurface" app:passwordToggleEnabled="true"> @@ -206,7 +203,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" - app:passwordToggleTint="#949494" + app:passwordToggleTint="?attr/colorOnSurface" app:passwordToggleEnabled="true"> + app:tint="?attr/colorOnSurface" /> @@ -353,7 +350,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_counter_black_24dp" - app:tint="?attr/iconColorPrimary" + app:tint="?attr/colorOnSurface" android:layout_marginStart="5dp" android:layout_marginEnd="15dp" android:layout_gravity="center_vertical"/> diff --git a/app/src/main/res/layout/activity_groups.xml b/app/src/main/res/layout/activity_groups.xml index d7cca18048..62b6b623ca 100644 --- a/app/src/main/res/layout/activity_groups.xml +++ b/app/src/main/res/layout/activity_groups.xml @@ -4,18 +4,17 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="?attr/background" + android:fitsSystemWindows="true" tools:context="com.beemdevelopment.aegis.ui.GroupManagerActivity"> - + + android:layout_height="?attr/actionBarSize" /> + android:src="@drawable/ic_layers_black_24dp" /> - + + android:layout_height="?attr/actionBarSize" /> + android:src="@drawable/ic_check_black_24dp" /> diff --git a/app/src/main/res/layout/activity_intro.xml b/app/src/main/res/layout/activity_intro.xml index 79600e46d7..7b1ddce0b0 100644 --- a/app/src/main/res/layout/activity_intro.xml +++ b/app/src/main/res/layout/activity_intro.xml @@ -5,7 +5,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="?attr/background" + android:fitsSystemWindows="true" tools:context="com.beemdevelopment.aegis.ui.IntroActivity"> diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index f2b26f433d..8c4415519e 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -5,17 +5,20 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" + android:fitsSystemWindows="true" tools:context="com.beemdevelopment.aegis.ui.MainActivity"> - + + android:layout_height="?attr/actionBarSize" /> @@ -62,7 +65,7 @@ android:id="@+id/key_profiles" android:layout_height="fill_parent" android:layout_width="match_parent" - app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"/> + app:layout_behavior="@string/appbar_scrolling_view_behavior" /> + android:src="@drawable/ic_add_black_24dp" /> diff --git a/app/src/main/res/layout/activity_preferences.xml b/app/src/main/res/layout/activity_preferences.xml index b16858f82d..d4ab6cd35c 100644 --- a/app/src/main/res/layout/activity_preferences.xml +++ b/app/src/main/res/layout/activity_preferences.xml @@ -1,18 +1,17 @@ + android:orientation="vertical" + android:fitsSystemWindows="true"> - + + android:layout_height="?attr/actionBarSize" /> - + diff --git a/app/src/main/res/layout/activity_share_entry.xml b/app/src/main/res/layout/activity_share_entry.xml index 9044a0ec35..196c5bb630 100644 --- a/app/src/main/res/layout/activity_share_entry.xml +++ b/app/src/main/res/layout/activity_share_entry.xml @@ -4,7 +4,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="?attr/background" + android:fitsSystemWindows="true" tools:context="com.beemdevelopment.aegis.ui.TransferEntriesActivity"> - + + android:layout_height="?attr/actionBarSize" /> @@ -111,11 +105,10 @@ android:layout_height="wrap_content" android:layout_marginEnd="4dp" android:layout_marginBottom="4dp" - style="@style/Widget.MaterialComponents.Button.TextButton" + style="@style/Widget.Material3.Button.TextButton" android:text="@string/previous" android:textAllCaps="false" android:visibility="invisible" - android:textColor="@color/code_primary_text" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" /> diff --git a/app/src/main/res/layout/card_assign_icon_entry.xml b/app/src/main/res/layout/card_assign_icon_entry.xml index a9232419fd..3b7e36b7a7 100644 --- a/app/src/main/res/layout/card_assign_icon_entry.xml +++ b/app/src/main/res/layout/card_assign_icon_entry.xml @@ -1,7 +1,5 @@ @@ -38,7 +35,6 @@ android:layout_height="wrap_content" android:maxLines="1" android:ellipsize="end" - android:textColor="@color/secondary_text" android:text="AccountName" android:textSize="14sp" android:layout_marginBottom="8dp"/> @@ -58,7 +54,6 @@ + android:backgroundTint="?attr/colorFavorite" + android:background="@drawable/favorite_indicator" /> + app:civ_circle_background_color="?attr/colorPrimary" /> @@ -87,7 +86,6 @@ android:id="@+id/profile_issuer" android:text="@string/issuer" android:textStyle="bold" - android:textColor="?attr/primaryText" android:includeFontPadding="false" android:textSize="16sp" android:ellipsize="end" @@ -101,7 +99,6 @@ android:ellipsize="end" android:includeFontPadding="false" android:maxLines="1" - android:textColor="@color/secondary_text" android:textSize="16sp" tools:text=" - AccountName" /> @@ -119,7 +116,6 @@ android:includeFontPadding="false" android:fallbackLineSpacing="false" android:textSize="34sp" - android:textColor="?attr/codePrimaryText" android:layout_marginStart="6dp" android:layout_alignParentStart="true" android:layout_marginTop="0dp" @@ -144,7 +140,7 @@ android:clickable="true" android:focusable="true" android:src="@drawable/ic_refresh_black_24dp" - app:tint="?attr/iconColorPrimary" + app:tint="?attr/colorOnSurface" android:background="?android:attr/selectableItemBackground" /> + android:backgroundTint="?attr/colorFavorite" + android:background="@drawable/favorite_indicator" /> + app:civ_circle_background_color="?attr/colorPrimary" /> @@ -87,7 +86,6 @@ android:layout_height="wrap_content" android:id="@+id/profile_issuer" android:text="@string/issuer" - android:textColor="?attr/primaryText" android:textStyle="bold" android:includeFontPadding="false" android:textSize="13sp" @@ -102,7 +100,6 @@ android:ellipsize="end" android:includeFontPadding="false" android:maxLines="1" - android:textColor="@color/extra_info_text" android:textSize="13sp" tools:text=" - AccountName" /> @@ -120,7 +117,6 @@ android:includeFontPadding="false" android:fallbackLineSpacing="false" android:textSize="26sp" - android:textColor="?attr/codePrimaryText" android:layout_marginStart="6dp" android:layout_alignParentStart="true" android:layout_marginTop="0dp" @@ -145,7 +141,6 @@ android:clickable="true" android:focusable="true" android:src="@drawable/ic_refresh_black_24dp" - app:tint="?attr/iconColorPrimary" android:background="?android:attr/selectableItemBackground" /> + android:backgroundTint="?attr/colorFavorite" + android:background="@drawable/favorite_indicator" /> + app:civ_circle_background_color="?attr/colorPrimary" /> @@ -87,7 +86,6 @@ android:id="@+id/profile_issuer" android:text="@string/issuer" android:textStyle="bold" - android:textColor="?attr/primaryText" android:includeFontPadding="false" android:textSize="13sp" android:ellipsize="end" @@ -101,7 +99,6 @@ android:ellipsize="end" android:includeFontPadding="false" android:maxLines="1" - android:textColor="@color/extra_info_text" android:textSize="13sp" tools:text=" - AccountName" /> @@ -118,7 +115,6 @@ android:includeFontPadding="false" android:fallbackLineSpacing="false" android:textSize="26sp" - android:textColor="?attr/codePrimaryText" android:layout_marginStart="6dp" android:layout_alignParentStart="true" android:layout_marginTop="0dp" @@ -143,7 +139,6 @@ android:clickable="true" android:focusable="true" android:src="@drawable/ic_refresh_black_24dp" - app:tint="?attr/iconColorPrimary" android:background="?android:attr/selectableItemBackground" /> - + android:backgroundTint="?attr/colorFavorite" + android:background="@drawable/favorite_indicator" /> + app:civ_circle_background_color="?attr/colorPrimary" /> @@ -117,7 +114,6 @@ android:includeFontPadding="false" android:fallbackLineSpacing="false" android:textSize="26sp" - android:textColor="?attr/codePrimaryText" android:layout_alignParentStart="true" android:layout_marginTop="10dp" android:textStyle="normal|bold"/> @@ -141,7 +137,6 @@ android:clickable="true" android:focusable="true" android:src="@drawable/ic_refresh_black_24dp" - app:tint="?attr/iconColorPrimary" android:background="?android:attr/selectableItemBackground" /> - + diff --git a/app/src/main/res/layout/card_footer.xml b/app/src/main/res/layout/card_footer.xml index 730e6db586..4fb1336f52 100644 --- a/app/src/main/res/layout/card_footer.xml +++ b/app/src/main/res/layout/card_footer.xml @@ -9,7 +9,6 @@ android:layout_height="wrap_content" android:padding="4dp" android:layout_centerInParent="true" - android:textColor="@color/extra_info_text" android:textSize="14sp" /> \ No newline at end of file diff --git a/app/src/main/res/layout/card_group.xml b/app/src/main/res/layout/card_group.xml index b81bfdb4d4..8b0bf87dd5 100644 --- a/app/src/main/res/layout/card_group.xml +++ b/app/src/main/res/layout/card_group.xml @@ -57,7 +57,6 @@ android:paddingTop="12.5dp" android:paddingEnd="15dp" android:paddingBottom="12.5dp" - android:src="@drawable/ic_delete_black_24dp" - app:tint="?attr/iconColorPrimary" /> + android:src="@drawable/ic_delete_black_24dp" /> diff --git a/app/src/main/res/layout/card_icon_category.xml b/app/src/main/res/layout/card_icon_category.xml index 517f1ff5f4..cbd087c3c4 100644 --- a/app/src/main/res/layout/card_icon_category.xml +++ b/app/src/main/res/layout/card_icon_category.xml @@ -20,6 +20,6 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_chevron_down_black_24dp" - app:tint="?attr/iconColorPrimary" + app:tint="?attr/colorOnSurfaceVariant" android:layout_gravity="center_vertical" /> diff --git a/app/src/main/res/layout/card_icon_pack.xml b/app/src/main/res/layout/card_icon_pack.xml index c8d4812fe1..4996bb1800 100644 --- a/app/src/main/res/layout/card_icon_pack.xml +++ b/app/src/main/res/layout/card_icon_pack.xml @@ -1,6 +1,5 @@ @@ -37,7 +36,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="14sp" - android:textAppearance="@style/TextAppearance.MaterialComponents.Caption" /> + android:textAppearance="@style/TextAppearance.Material3.BodySmall" /> @@ -63,7 +62,6 @@ android:paddingTop="12.5dp" android:paddingEnd="15dp" android:paddingBottom="12.5dp" - android:src="@drawable/ic_delete_black_24dp" - app:tint="?attr/iconColorPrimary" /> + android:src="@drawable/ic_delete_black_24dp" /> diff --git a/app/src/main/res/layout/card_import_entry.xml b/app/src/main/res/layout/card_import_entry.xml index 6988b47f73..c679773849 100644 --- a/app/src/main/res/layout/card_import_entry.xml +++ b/app/src/main/res/layout/card_import_entry.xml @@ -4,7 +4,6 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:foreground="?android:attr/selectableItemBackground" - android:background="?attr/cardBackground" android:clickable="true" android:focusable="true" android:orientation="horizontal"> @@ -21,7 +20,6 @@ android:layout_height="wrap_content" android:fontFamily="sans-serif-light" android:textAppearance="?android:attr/textAppearanceMedium" - android:textColor="?attr/primaryText" android:textSize="18sp" android:textStyle="normal|bold" android:gravity="center_vertical" @@ -33,7 +31,6 @@ android:layout_marginTop="2dp" android:ellipsize="end" android:maxLines="1" - android:textColor="@color/extra_info_text" android:textSize="14sp" tools:text="AccountName" /> diff --git a/app/src/main/res/layout/chip_material.xml b/app/src/main/res/layout/chip_group_filter.xml similarity index 79% rename from app/src/main/res/layout/chip_material.xml rename to app/src/main/res/layout/chip_group_filter.xml index f0346c6d66..10c1b3815a 100644 --- a/app/src/main/res/layout/chip_material.xml +++ b/app/src/main/res/layout/chip_group_filter.xml @@ -1,5 +1,5 @@ \ No newline at end of file diff --git a/app/src/main/res/layout/content_about.xml b/app/src/main/res/layout/content_about.xml index 2b778f335e..b59b675061 100644 --- a/app/src/main/res/layout/content_about.xml +++ b/app/src/main/res/layout/content_about.xml @@ -8,19 +8,17 @@ android:padding="8dp" app:cardUseCompatPadding="true"> - + app:cardUseCompatPadding="true" + style="?attr/materialCardViewFilledStyle"> + app:ico_size="16dp" + app:ico_color="?attr/colorOnSurface" /> + app:ico_size="16dp" + app:ico_color="?attr/colorControlNormal" /> + app:ico_size="16dp" + app:ico_color="?attr/colorControlNormal" /> + app:ico_size="16dp" + app:ico_color="?attr/colorControlNormal" /> + app:ico_size="16dp" + app:ico_color="?attr/colorControlNormal" /> - + - + app:cardUseCompatPadding="true" + style="?attr/materialCardViewFilledStyle"> + app:ico_size="16dp" + app:ico_color="?attr/colorControlNormal" /> + app:ico_size="16dp" + app:ico_color="?attr/colorControlNormal" /> + app:ico_size="16dp" + app:ico_color="?attr/colorControlNormal" /> + app:ico_size="16dp" + app:ico_color="?attr/colorControlNormal" /> - + - + app:cardUseCompatPadding="true" + style="?attr/materialCardViewFilledStyle"> + app:ico_size="16dp" + app:ico_color="?attr/colorControlNormal" /> - + diff --git a/app/src/main/res/layout/dialog_add_entry.xml b/app/src/main/res/layout/dialog_add_entry.xml index 282f779ada..983a27fc41 100644 --- a/app/src/main/res/layout/dialog_add_entry.xml +++ b/app/src/main/res/layout/dialog_add_entry.xml @@ -5,6 +5,16 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> + + + app:tint="?attr/colorOnSurfaceVariant" /> @@ -45,13 +54,12 @@ android:layout_width="25dp" android:layout_height="match_parent" android:src="@drawable/ic_add_photo_24px" - app:tint="?attr/iconColorPrimary" /> + app:tint="?attr/colorOnSurfaceVariant" /> @@ -70,13 +78,12 @@ android:layout_width="25dp" android:layout_height="match_parent" android:src="@drawable/ic_create_black_24dp" - app:tint="?attr/iconColorPrimary" /> + app:tint="?attr/colorOnSurfaceVariant" /> diff --git a/app/src/main/res/layout/dialog_export.xml b/app/src/main/res/layout/dialog_export.xml index c89860c66d..90c7f02afa 100644 --- a/app/src/main/res/layout/dialog_export.xml +++ b/app/src/main/res/layout/dialog_export.xml @@ -52,7 +52,7 @@ android:layout_marginEnd="25dp" android:layout_marginTop="5dp" android:text="@string/export_warning_unencrypted" - android:textColor="#FF0000" + android:textColor="?attr/colorError" android:visibility="gone" /> - + + android:gravity="center" + android:text="@string/pick_icon" + android:textSize="20sp" /> + app:tint="?attr/colorOnSurfaceVariant" /> - + + + + diff --git a/app/src/main/res/layout/dialog_select_groups.xml b/app/src/main/res/layout/dialog_select_groups.xml index 11733771e5..8bdad3d702 100644 --- a/app/src/main/res/layout/dialog_select_groups.xml +++ b/app/src/main/res/layout/dialog_select_groups.xml @@ -4,36 +4,26 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" - android:paddingTop="12dp" android:orientation="vertical"> - + - - + android:gravity="center" + android:text="@string/groups" + android:textSize="20sp" /> + android:orientation="vertical" + android:layout_marginTop="15dp"> + style="@style/Widget.Material3.Button.TextButton" />