From 88c9a0d487cae916477ad733cea6786d442cfa5e Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Wed, 3 Nov 2021 14:22:31 +0530 Subject: [PATCH] app: refactor M3 themes and styles --- app/src/main/AndroidManifest.xml | 22 ++++----- .../aps/ui/dialogs/ItemCreationBottomSheet.kt | 7 --- .../res/values-night/themes_material3.xml | 5 -- app/src/main/res/values/styles_material3.xml | 12 +++++ app/src/main/res/values/themes_material3.xml | 47 +++++++++++++++---- 5 files changed, 61 insertions(+), 32 deletions(-) create mode 100644 app/src/main/res/values/styles_material3.xml diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 99301d11..c3ff6302 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -28,7 +28,7 @@ android:label="@string/app_name" android:requestLegacyExternalStorage="true" android:supportsRtl="true" - android:theme="@style/APSThemeM3" + android:theme="@style/AppThemeM3" tools:ignore="GoogleAppIndexingWarning"> + android:theme="@style/NoBackgroundThemeM3"> @@ -87,7 +87,7 @@ + android:theme="@style/NoBackgroundThemeM3" /> + android:theme="@style/NoBackgroundThemeM3" /> + android:theme="@style/NoBackgroundThemeM3" /> + android:theme="@style/NoBackgroundThemeM3" /> + android:theme="@style/NoBackgroundThemeM3" /> diff --git a/app/src/main/java/dev/msfjarvis/aps/ui/dialogs/ItemCreationBottomSheet.kt b/app/src/main/java/dev/msfjarvis/aps/ui/dialogs/ItemCreationBottomSheet.kt index cb693d28..af2a5f19 100644 --- a/app/src/main/java/dev/msfjarvis/aps/ui/dialogs/ItemCreationBottomSheet.kt +++ b/app/src/main/java/dev/msfjarvis/aps/ui/dialogs/ItemCreationBottomSheet.kt @@ -4,7 +4,6 @@ */ package dev.msfjarvis.aps.ui.dialogs -import android.graphics.drawable.GradientDrawable import android.os.Bundle import android.view.LayoutInflater import android.view.View @@ -21,7 +20,6 @@ import dev.msfjarvis.aps.ui.passwords.PasswordFragment.Companion.ACTION_FOLDER import dev.msfjarvis.aps.ui.passwords.PasswordFragment.Companion.ACTION_KEY import dev.msfjarvis.aps.ui.passwords.PasswordFragment.Companion.ACTION_PASSWORD import dev.msfjarvis.aps.ui.passwords.PasswordFragment.Companion.ITEM_CREATION_REQUEST_KEY -import dev.msfjarvis.aps.util.extensions.resolveAttribute class ItemCreationBottomSheet : BottomSheetDialogFragment() { @@ -70,11 +68,6 @@ class ItemCreationBottomSheet : BottomSheetDialogFragment() { } } ) - val gradientDrawable = - GradientDrawable().apply { - setColor(requireContext().resolveAttribute(android.R.attr.windowBackground)) - } - view.background = gradientDrawable } override fun dismiss() { diff --git a/app/src/main/res/values-night/themes_material3.xml b/app/src/main/res/values-night/themes_material3.xml index 6f56863a..a06aefe8 100644 --- a/app/src/main/res/values-night/themes_material3.xml +++ b/app/src/main/res/values-night/themes_material3.xml @@ -32,10 +32,5 @@ @color/md_theme_dark_inverseOnSurface @color/md_theme_dark_inverseSurface @color/md_theme_dark_primaryInverse - @font/manrope - @bool/light_status_bar - ?android:colorBackground - ?android:colorBackground - @style/APSThemeM3.Toolbar diff --git a/app/src/main/res/values/styles_material3.xml b/app/src/main/res/values/styles_material3.xml new file mode 100644 index 00000000..f855b826 --- /dev/null +++ b/app/src/main/res/values/styles_material3.xml @@ -0,0 +1,12 @@ + + + + + + + diff --git a/app/src/main/res/values/themes_material3.xml b/app/src/main/res/values/themes_material3.xml index 19ee0fc1..428a4699 100644 --- a/app/src/main/res/values/themes_material3.xml +++ b/app/src/main/res/values/themes_material3.xml @@ -5,6 +5,44 @@ + + + + + + + + - -