Merge branch 'feature/Material_You' into develop

This commit is contained in:
J-Jamet
2023-07-27 01:12:06 +02:00
27 changed files with 78 additions and 158 deletions

View File

@@ -46,7 +46,6 @@
android:value="${googleAndroidBackupAPIKey}" />
<activity
android:name="com.kunzisoft.keepass.activities.FileDatabaseSelectActivity"
android:theme="@style/KeepassDXStyle.SplashScreen"
android:launchMode="singleTop"
android:exported="true"
android:configChanges="keyboardHidden"

View File

@@ -2,16 +2,16 @@ package com.kunzisoft.keepass.activities.fragments
import android.os.Bundle
import android.view.View
import androidx.fragment.app.Fragment
import androidx.fragment.app.activityViewModels
import com.kunzisoft.keepass.activities.legacy.DatabaseRetrieval
import com.kunzisoft.keepass.activities.legacy.resetAppTimeoutWhenViewTouchedOrFocused
import com.kunzisoft.keepass.activities.stylish.StylishFragment
import com.kunzisoft.keepass.database.ContextualDatabase
import com.kunzisoft.keepass.database.element.binary.BinaryData
import com.kunzisoft.keepass.tasks.ActionRunnable
import com.kunzisoft.keepass.viewmodels.DatabaseViewModel
abstract class DatabaseFragment : StylishFragment(), DatabaseRetrieval {
abstract class DatabaseFragment : Fragment(), DatabaseRetrieval {
private val mDatabaseViewModel: DatabaseViewModel by activityViewModels()
protected var mDatabase: ContextualDatabase? = null

View File

@@ -77,12 +77,11 @@ class EntryEditFragment: DatabaseFragment() {
super.onCreateView(inflater, container, savedInstanceState)
// Retrieve the textColor to tint the icon
val taIconColor = contextThemed?.theme?.obtainStyledAttributes(intArrayOf(android.R.attr.textColor))
val taIconColor = context?.obtainStyledAttributes(intArrayOf(android.R.attr.textColor))
mIconColor = taIconColor?.getColor(0, Color.BLACK) ?: Color.BLACK
taIconColor?.recycle()
return inflater.cloneInContext(contextThemed)
.inflate(R.layout.fragment_entry_edit, container, false)
return inflater.inflate(R.layout.fragment_entry_edit, container, false)
}
override fun onViewCreated(view: View,

View File

@@ -59,8 +59,7 @@ class EntryFragment: DatabaseFragment() {
savedInstanceState: Bundle?): View? {
super.onCreateView(inflater, container, savedInstanceState)
return inflater.cloneInContext(contextThemed)
.inflate(R.layout.fragment_entry, container, false)
return inflater.inflate(R.layout.fragment_entry, container, false)
}
override fun onViewCreated(view: View,

View File

@@ -4,16 +4,16 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.fragment.app.activityViewModels
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.kunzisoft.keepass.R
import com.kunzisoft.keepass.activities.stylish.StylishFragment
import com.kunzisoft.keepass.adapters.EntryHistoryAdapter
import com.kunzisoft.keepass.model.EntryInfo
import com.kunzisoft.keepass.viewmodels.EntryViewModel
class EntryHistoryFragment: StylishFragment() {
class EntryHistoryFragment: Fragment() {
private lateinit var historyContainerView: View
private lateinit var historyListView: RecyclerView
@@ -28,8 +28,7 @@ class EntryHistoryFragment: StylishFragment() {
): View? {
super.onCreateView(inflater, container, savedInstanceState)
return inflater.cloneInContext(contextThemed)
.inflate(R.layout.fragment_entry_history, container, false)
return inflater.inflate(R.layout.fragment_entry_history, container, false)
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {

View File

@@ -181,7 +181,7 @@ class GroupFragment : DatabaseFragment(), SortDialogFragment.SortSelectionListen
mRecycleBinEnable = database?.isRecycleBinEnabled == true
mRecycleBin = database?.recycleBin
contextThemed?.let { context ->
context?.let { context ->
database?.let { database ->
mAdapter = NodesAdapter(context, database).apply {
setOnNodeClickListener(object : NodesAdapter.NodeClickCallback {
@@ -241,8 +241,7 @@ class GroupFragment : DatabaseFragment(), SortDialogFragment.SortSelectionListen
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
super.onCreateView(inflater, container, savedInstanceState)
// To apply theme
return inflater.cloneInContext(contextThemed)
.inflate(R.layout.fragment_nodes, container, false)
return inflater.inflate(R.layout.fragment_nodes, container, false)
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {

View File

@@ -59,7 +59,7 @@ abstract class IconFragment<T: IconImageDraw> : DatabaseFragment(),
super.onViewCreated(view, savedInstanceState)
// Retrieve the textColor to tint the icon
val ta = contextThemed?.obtainStyledAttributes(intArrayOf(android.R.attr.textColor))
val ta = context?.obtainStyledAttributes(intArrayOf(android.R.attr.textColor))
val tintColor = ta?.getColor(0, Color.BLACK) ?: Color.BLACK
ta?.recycle()

View File

@@ -73,7 +73,7 @@ class PassphraseGeneratorFragment : DatabaseFragment() {
minSliderWordCount = resources.getInteger(R.integer.passphrase_generator_word_count_min)
maxSliderWordCount = resources.getInteger(R.integer.passphrase_generator_word_count_max)
contextThemed?.let { context ->
context?.let { context ->
passphraseCopyView?.visibility = if(PreferencesUtil.allowCopyProtectedFields(context))
View.VISIBLE else View.GONE
val clipboardHelper = ClipboardHelper(context)

View File

@@ -94,7 +94,7 @@ class PasswordGeneratorFragment : DatabaseFragment() {
atLeastOneCompound = view.findViewById(R.id.atLeastOne_filter)
excludeAmbiguousCompound = view.findViewById(R.id.excludeAmbiguous_filter)
contextThemed?.let { context ->
context?.let { context ->
passwordCopyView?.visibility = if(PreferencesUtil.allowCopyProtectedFields(context))
View.VISIBLE else View.GONE
val clipboardHelper = ClipboardHelper(context)

View File

@@ -23,6 +23,7 @@ import android.content.Context
import android.content.res.Configuration
import android.util.Log
import androidx.annotation.StyleRes
import com.google.android.material.color.DynamicColors
import com.kunzisoft.keepass.R
import com.kunzisoft.keepass.settings.PreferencesUtil
@@ -38,7 +39,7 @@ object Stylish {
* @param context Context to retrieve the theme preference
*/
fun load(context: Context) {
Log.d(Stylish::class.java.name, "Attatching to " + context.packageName)
Log.d(Stylish::class.java.name, "Attaching to " + context.packageName)
try {
themeString = PreferencesUtil.getStyle(context)
} catch (e: Exception) {
@@ -46,7 +47,7 @@ object Stylish {
}
}
fun retrieveEquivalentSystemStyle(context: Context, styleString: String): String {
fun retrieveEquivalentSystemStyle(context: Context, styleString: String?): String {
val systemNightMode = when (PreferencesUtil.getStyleBrightness(context)) {
context.getString(R.string.list_style_brightness_light) -> false
context.getString(R.string.list_style_brightness_night) -> true
@@ -58,14 +59,21 @@ object Stylish {
}
}
return if (systemNightMode) {
retrieveEquivalentNightStyle(context, styleString)
retrieveEquivalentNightStyle(
context,
styleString ?: context.getString(R.string.list_style_name_night)
)
} else {
retrieveEquivalentLightStyle(context, styleString)
retrieveEquivalentLightStyle(
context,
styleString ?: context.getString(R.string.list_style_name_light)
)
}
}
fun retrieveEquivalentLightStyle(context: Context, styleString: String): String {
return when (styleString) {
context.getString(R.string.list_style_name_dynamic_night) -> context.getString(R.string.list_style_name_dynamic_light)
context.getString(R.string.list_style_name_night) -> context.getString(R.string.list_style_name_light)
context.getString(R.string.list_style_name_black) -> context.getString(R.string.list_style_name_white)
context.getString(R.string.list_style_name_dark) -> context.getString(R.string.list_style_name_clear)
@@ -80,6 +88,7 @@ object Stylish {
private fun retrieveEquivalentNightStyle(context: Context, styleString: String): String {
return when (styleString) {
context.getString(R.string.list_style_name_dynamic_light) -> context.getString(R.string.list_style_name_dynamic_night)
context.getString(R.string.list_style_name_light) -> context.getString(R.string.list_style_name_night)
context.getString(R.string.list_style_name_white) -> context.getString(R.string.list_style_name_black)
context.getString(R.string.list_style_name_clear) -> context.getString(R.string.list_style_name_dark)
@@ -104,6 +113,13 @@ object Stylish {
PreferencesUtil.setStyle(context, styleString)
}
fun isDynamic(context: Context): Boolean {
return DynamicColors.isDynamicColorAvailable() && (
themeString == context.getString(R.string.list_style_name_dynamic_night)
|| themeString == context.getString(R.string.list_style_name_dynamic_light)
)
}
/**
* Function that returns the current id of the style selected in the preference
* @param context Context to retrieve the id
@@ -111,7 +127,7 @@ object Stylish {
*/
@StyleRes
fun getThemeId(context: Context): Int {
return when (retrieveEquivalentSystemStyle(context, themeString ?: context.getString(R.string.list_style_name_light))) {
return when (retrieveEquivalentSystemStyle(context, themeString)) {
context.getString(R.string.list_style_name_night) -> R.style.KeepassDXStyle_Night
context.getString(R.string.list_style_name_white) -> R.style.KeepassDXStyle_White
context.getString(R.string.list_style_name_black) -> R.style.KeepassDXStyle_Black
@@ -127,6 +143,8 @@ object Stylish {
context.getString(R.string.list_style_name_reply_night) -> R.style.KeepassDXStyle_Reply_Night
context.getString(R.string.list_style_name_purple) -> R.style.KeepassDXStyle_Purple
context.getString(R.string.list_style_name_purple_dark) -> R.style.KeepassDXStyle_Purple_Dark
context.getString(R.string.list_style_name_dynamic_light) -> R.style.KeepassDXStyle_Light_Dynamic
context.getString(R.string.list_style_name_dynamic_night) -> R.style.KeepassDXStyle_Night_Dynamic
else -> R.style.KeepassDXStyle_Light
}
}

View File

@@ -33,6 +33,7 @@ import android.view.WindowManager.LayoutParams.FLAG_SECURE
import androidx.annotation.StyleRes
import androidx.appcompat.app.AppCompatActivity
import androidx.preference.PreferenceManager
import com.google.android.material.color.DynamicColors
import com.kunzisoft.keepass.R
import com.kunzisoft.keepass.settings.NestedAppSettingsFragment.Companion.DATABASE_PREFERENCE_CHANGED
import com.kunzisoft.keepass.settings.PreferencesUtil
@@ -84,8 +85,13 @@ abstract class StylishActivity : AppCompatActivity() {
customStyle = applyCustomStyle()
if (customStyle) {
// Preconfigured themes
this.themeId = Stylish.getThemeId(this)
setTheme(themeId)
if (Stylish.isDynamic(this)) {
// Material You theme
DynamicColors.applyToActivityIfAvailable(this)
}
}
PreferenceManager.getDefaultSharedPreferences(this)

View File

@@ -1,99 +0,0 @@
/*
* Copyright 2019 Jeremy Jamet / Kunzisoft.
*
* This file is part of KeePassDX.
*
* KeePassDX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* KeePassDX is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with KeePassDX. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.kunzisoft.keepass.activities.stylish
import android.content.Context
import android.graphics.Color
import android.os.Build
import android.os.Bundle
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.annotation.StyleRes
import androidx.appcompat.view.ContextThemeWrapper
import androidx.core.view.WindowInsetsControllerCompat
import androidx.fragment.app.Fragment
abstract class StylishFragment : Fragment() {
@StyleRes
protected var themeId: Int = 0
protected var contextThemed: Context? = null
override fun onAttach(context: Context) {
super.onAttach(context)
this.themeId = Stylish.getThemeId(context)
contextThemed = ContextThemeWrapper(context, themeId)
}
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
// To fix status bar color
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
val window = requireActivity().window
val defaultColor = Color.BLACK
val windowInset = WindowInsetsControllerCompat(window, window.decorView)
try {
val taStatusBarColor = contextThemed?.theme?.obtainStyledAttributes(intArrayOf(android.R.attr.statusBarColor))
window.statusBarColor = taStatusBarColor?.getColor(0, defaultColor) ?: defaultColor
taStatusBarColor?.recycle()
} catch (e: Exception) {
Log.e(TAG, "Unable to retrieve theme : status bar color", e)
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
try {
val taWindowStatusLight = contextThemed?.theme?.obtainStyledAttributes(intArrayOf(android.R.attr.windowLightStatusBar))
windowInset.isAppearanceLightStatusBars = taWindowStatusLight
?.getBoolean(0, false) == true
taWindowStatusLight?.recycle()
} catch (e: Exception) {
Log.e(TAG, "Unable to retrieve theme : window light status bar", e)
}
}
try {
val taNavigationBarColor = contextThemed?.theme?.obtainStyledAttributes(intArrayOf(android.R.attr.navigationBarColor))
window.navigationBarColor = taNavigationBarColor?.getColor(0, defaultColor) ?: defaultColor
taNavigationBarColor?.recycle()
} catch (e: Exception) {
Log.e(TAG, "Unable to retrieve theme : navigation bar color", e)
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) {
try {
val taWindowLightNavigationBar = contextThemed?.theme?.obtainStyledAttributes(intArrayOf(android.R.attr.windowLightNavigationBar))
windowInset.isAppearanceLightNavigationBars = taWindowLightNavigationBar
?.getBoolean(0, false) == true
taWindowLightNavigationBar?.recycle()
} catch (e: Exception) {
Log.e(TAG, "Unable to retrieve theme : navigation light navigation bar", e)
}
}
}
return super.onCreateView(inflater, container, savedInstanceState)
}
override fun onDetach() {
contextThemed = null
super.onDetach()
}
companion object {
private val TAG = StylishFragment::class.java.simpleName
}
}

View File

@@ -118,27 +118,27 @@ class NodesAdapter (
this.mNodeSortedListCallback = NodeSortedListCallback()
this.mNodeSortedList = SortedList(Node::class.java, mNodeSortedListCallback)
val taColorSurfaceContainer = context.theme.obtainStyledAttributes(intArrayOf(R.attr.colorSurfaceContainer))
val taColorSurfaceContainer = context.obtainStyledAttributes(intArrayOf(R.attr.colorSurfaceContainer))
this.mColorSurfaceContainer = taColorSurfaceContainer.getColor(0, Color.BLACK)
taColorSurfaceContainer.recycle()
// Retrieve the color to tint the icon
val taTextColorPrimary = context.theme.obtainStyledAttributes(intArrayOf(android.R.attr.textColorPrimary))
val taTextColorPrimary = context.obtainStyledAttributes(intArrayOf(android.R.attr.textColorPrimary))
this.mTextColorPrimary = taTextColorPrimary.getColor(0, Color.BLACK)
taTextColorPrimary.recycle()
// To get text color
val taTextColor = context.theme.obtainStyledAttributes(intArrayOf(android.R.attr.textColor))
val taTextColor = context.obtainStyledAttributes(intArrayOf(android.R.attr.textColor))
this.mTextColor = taTextColor.getColor(0, Color.BLACK)
taTextColor.recycle()
// To get text color secondary
val taTextColorSecondary = context.theme.obtainStyledAttributes(intArrayOf(android.R.attr.textColorSecondary))
val taTextColorSecondary = context.obtainStyledAttributes(intArrayOf(android.R.attr.textColorSecondary))
this.mTextColorSecondary = taTextColorSecondary.getColor(0, Color.BLACK)
taTextColorSecondary.recycle()
// To get background color for selection
val taColorSecondary = context.theme.obtainStyledAttributes(intArrayOf(R.attr.colorSecondary))
val taColorSecondary = context.obtainStyledAttributes(intArrayOf(R.attr.colorSecondary))
this.mColorSecondary = taColorSecondary.getColor(0, Color.GRAY)
taColorSecondary.recycle()
// To get text color for selection
val taColorOnSecondary = context.theme.obtainStyledAttributes(intArrayOf(R.attr.colorOnSecondary))
val taColorOnSecondary = context.obtainStyledAttributes(intArrayOf(R.attr.colorOnSecondary))
this.mColorOnSecondary = taColorOnSecondary.getColor(0, Color.WHITE)
taColorOnSecondary.recycle()
}

View File

@@ -16,7 +16,7 @@ import com.kunzisoft.keepass.icons.IconDrawableFactory
class TemplatesSelectorAdapter(
context: Context,
private val context: Context,
private var templates: List<Template>): BaseAdapter() {
var iconDrawableFactory: IconDrawableFactory? = null
@@ -36,7 +36,9 @@ class TemplatesSelectorAdapter(
var templateView = convertView
if (templateView == null) {
holder = TemplateSelectorViewHolder()
templateView = inflater.inflate(R.layout.item_template, parent, false)
templateView = inflater
.cloneInContext(context)
.inflate(R.layout.item_template, parent, false)
holder.background = templateView?.findViewById(R.id.template_background)
holder.icon = templateView?.findViewById(R.id.template_image)
holder.name = templateView?.findViewById(R.id.template_name)

View File

@@ -33,10 +33,10 @@ import androidx.annotation.RequiresApi
import androidx.biometric.BiometricManager
import androidx.biometric.BiometricPrompt
import androidx.core.view.MenuProvider
import androidx.fragment.app.Fragment
import androidx.fragment.app.activityViewModels
import androidx.lifecycle.lifecycleScope
import com.kunzisoft.keepass.R
import com.kunzisoft.keepass.activities.stylish.StylishFragment
import com.kunzisoft.keepass.app.database.CipherDatabaseAction
import com.kunzisoft.keepass.database.exception.UnknownDatabaseLocationException
import com.kunzisoft.keepass.model.CipherDecryptDatabase
@@ -50,7 +50,7 @@ import com.kunzisoft.keepass.viewmodels.AdvancedUnlockViewModel
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
class AdvancedUnlockFragment: StylishFragment(), AdvancedUnlockManager.AdvancedUnlockCallback {
class AdvancedUnlockFragment: Fragment(), AdvancedUnlockManager.AdvancedUnlockCallback {
private var mBuilderListener: BuilderListener? = null
@@ -162,8 +162,7 @@ class AdvancedUnlockFragment: StylishFragment(), AdvancedUnlockManager.AdvancedU
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
super.onCreateView(inflater, container, savedInstanceState)
val rootView = inflater.cloneInContext(contextThemed)
.inflate(R.layout.fragment_advanced_unlock, container, false)
val rootView = inflater.inflate(R.layout.fragment_advanced_unlock, container, false)
mAdvancedUnlockInfoView = rootView.findViewById(R.id.advanced_unlock_view)

View File

@@ -30,7 +30,7 @@ import com.kunzisoft.keepass.R
class SectionView @JvmOverloads constructor(context: Context,
attrs: AttributeSet? = null,
defStyle: Int = 0)
defStyle: Int = R.attr.cardViewStyle)
: CardView(context, attrs, defStyle) {
private var containerSectionView = LinearLayout(context).apply {

View File

@@ -29,7 +29,7 @@
android:scrollbarStyle="insideOverlay"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="?attr/actionBarSize"
android:paddingBottom="64dp"
android:clipToPadding="false" />
<LinearLayout
android:id="@+id/not_found_container"

View File

@@ -115,7 +115,6 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@+id/file_alias_save"
android:textColor="?android:attr/textColor"
tools:text="DatabaseAlias" />
<androidx.appcompat.widget.AppCompatImageButton
android:id="@+id/file_alias_save"

View File

@@ -18,10 +18,10 @@
-->
<FrameLayout 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="wrap_content"
android:background="?android:attr/windowBackground"
xmlns:tools="http://schemas.android.com/tools">
android:background="?android:attr/windowBackground">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"

View File

@@ -436,6 +436,7 @@
<item>Sonne</item>
<item>Antwort</item>
<item>Kunzite</item>
<item>System verfolgen</item>
</string-array>
<string name="warning_database_read_only">Schreibrechte gewähren, um Datenbankänderungen zu speichern</string>
<string name="education_setup_OTP_summary">Einmal-Passwortverwaltung (HOTP / TOTP) einrichten, um Token für Zwei-Faktor-Authentifizierung (2FA) zu generieren.</string>

View File

@@ -271,6 +271,7 @@
<item>Soleil</item>
<item>Réponse</item>
<item>Kunzite</item>
<item>Suivre le système</item>
</string-array>
<string name="icon_pack_choose_title">Collection dicônes</string>
<string name="icon_pack_choose_summary">Collection dicônes utilisées dans lapplication</string>

View File

@@ -477,6 +477,7 @@
<item>Sun</item>
<item>Reply</item>
<item>Kunzite</item>
<item>システムに従う</item>
</string-array>
<string name="icon_pack_choose_title">アイコンパック</string>
<string name="icon_pack_choose_summary">アプリで使用するアイコンパック</string>

View File

@@ -19,10 +19,6 @@
-->
<resources>
<!-- To encapsulate elevation & status bar color -->
<style name="KeepassDXStyle.SplashScreen" parent="KeepassDXStyle.SplashScreen.v21">
<item name="android:statusBarColor">@color/grey_dark</item>
<item name="android:navigationBarColor">@color/grey_dark</item>
</style>
<style name="KeepassDXStyle.Light.v21" parent="KeepassDXStyle.Light.v14" >
<item name="preferenceTheme">@style/KeepassDXStyle.Preference.Theme</item>
<item name="android:statusBarColor">@color/grey_dark</item>

View File

@@ -21,7 +21,7 @@
<attr name="toolbarSpecialStyle" format="reference" />
<attr name="toolbarActionStyle" format="reference" />
<attr name="dialogBackgroundColor" format="reference|color" />
<attr name="dialogBackgroundColor" format="color" />
<declare-styleable name="explanationDialog">
<attr name="explanations" format="string" />

View File

@@ -393,6 +393,8 @@
<string name="list_style_name_reply_night" translatable="false">KeepassDXStyle_Reply_Night</string>
<string name="list_style_name_purple" translatable="false">KeepassDXStyle_Purple</string>
<string name="list_style_name_purple_dark" translatable="false">KeepassDXStyle_Purple_Dark</string>
<string name="list_style_name_dynamic_light" translatable="false">KeepassDXStyle_Dynamic_Light</string>
<string name="list_style_name_dynamic_night" translatable="false">KeepassDXStyle_Dynamic_Night</string>
<string-array name="list_style_values_light">
<item translatable="false">@string/list_style_name_light</item>
<item translatable="false">@string/list_style_name_white</item>
@@ -402,6 +404,7 @@
<item translatable="false">@string/list_style_name_red</item>
<item translatable="false">@string/list_style_name_reply</item>
<item translatable="false">@string/list_style_name_purple</item>
<item translatable="false">@string/list_style_name_dynamic_light</item>
</string-array>
<string-array name="list_style_values_night">
<item translatable="false">@string/list_style_name_night</item>
@@ -412,6 +415,7 @@
<item translatable="false">@string/list_style_name_red_night</item>
<item translatable="false">@string/list_style_name_reply_night</item>
<item translatable="false">@string/list_style_name_purple_dark</item>
<item translatable="false">@string/list_style_name_dynamic_night</item>
</string-array>
<string name="list_style_brightness_light" translatable="false">KeepassDXStyle_Brightness_Light</string>
<string name="list_style_brightness_night" translatable="false">KeepassDXStyle_Brightness_Night</string>

View File

@@ -700,6 +700,7 @@
<item>Sun</item>
<item>Reply</item>
<item>Kunzite</item>
<item>Follow the system</item>
</string-array>
<string name="style_brightness_title">Theme brightness</string>
<string name="style_brightness_summary">Select light or dark themes</string>

View File

@@ -19,14 +19,6 @@
-->
<resources>
<!-- SplashScreen theme -->
<style name="KeepassDXStyle.SplashScreen.v21" parent="Theme.Material3.DayNight.NoActionBar">
<item name="colorPrimary">@color/green</item>
<item name="colorPrimaryDark">@color/grey_dark</item>
<item name="android:windowBackground">@drawable/background_splash</item>
</style>
<style name="KeepassDXStyle.SplashScreen" parent="KeepassDXStyle.SplashScreen.v21"/>
<!-- Light WhiteBar Style -->
<style name="KeepassDXStyle.Light" parent="KeepassDXStyle.Light.v27" />
<style name="KeepassDXStyle.Light.v27" parent="KeepassDXStyle.Light.v23" />
@@ -52,7 +44,6 @@
<item name="colorErrorContainer">@color/forest_theme_light_errorContainer</item>
<item name="colorOnError">@color/forest_theme_light_onError</item>
<item name="colorOnErrorContainer">@color/forest_theme_light_onErrorContainer</item>
<item name="android:windowBackground">@color/forest_theme_light_background</item>
<item name="android:colorBackground">@color/forest_theme_light_background</item>
<item name="colorOnBackground">@color/forest_theme_light_onBackground</item>
<item name="colorSurface">@color/forest_theme_light_surface</item>
@@ -82,12 +73,13 @@
<item name="android:textAppearanceMedium">@style/KeepassDXStyle.Text</item>
<item name="android:textColor">?attr/colorOnSurface</item>
<item name="android:textColorPrimary">@color/green_light</item>
<item name="android:textColorPrimary">@color/forest_theme_light_primary</item>
<item name="android:editTextColor">?attr/colorOnSurface</item>
<!-- Dialog -->
<item name="android:alertDialogTheme">@style/KeepassDXStyle.Light.Dialog</item>
<item name="alertDialogTheme">@style/KeepassDXStyle.Light.Dialog</item>
<item name="dialogBackgroundColor">@color/forest_theme_light_background</item>
<item name="dialogBackgroundColor">?attr/colorSurfaceContainerHigh</item>
<!-- CardView -->
<item name="materialCardViewStyle">@style/KeepassDXStyle.Cardview</item>
@@ -146,7 +138,6 @@
<item name="colorErrorContainer">@color/forest_theme_night_errorContainer</item>
<item name="colorOnError">@color/forest_theme_night_onError</item>
<item name="colorOnErrorContainer">@color/forest_theme_night_onErrorContainer</item>
<item name="android:windowBackground">@color/forest_theme_night_background</item>
<item name="android:colorBackground">@color/forest_theme_night_background</item>
<item name="colorOnBackground">@color/forest_theme_night_onBackground</item>
<item name="colorSurface">@color/forest_theme_night_surface</item>
@@ -176,12 +167,13 @@
<item name="android:textAppearanceMedium">@style/KeepassDXStyle.Text</item>
<item name="android:textColor">?attr/colorOnSurface</item>
<item name="android:textColorPrimary">@color/green_light</item>
<item name="android:textColorPrimary">@color/forest_theme_night_primary</item>
<item name="android:editTextColor">?attr/colorOnSurface</item>
<!-- Dialog -->
<item name="android:alertDialogTheme">@style/KeepassDXStyle.Night.Dialog</item>
<item name="alertDialogTheme">@style/KeepassDXStyle.Night.Dialog</item>
<item name="dialogBackgroundColor">@color/forest_theme_night_background</item>
<item name="dialogBackgroundColor">?attr/colorSurfaceContainerHigh</item>
<!-- CardView -->
<item name="materialCardViewStyle">@style/KeepassDXStyle.Cardview</item>
@@ -591,4 +583,8 @@
<item name="popupLayout">@layout/keyboard_popup_fields</item>
</style>
<!-- Only to have a specific base to build a dynamic theme properly programmatically -->
<style name="KeepassDXStyle.Light.Dynamic" parent="KeepassDXStyle.Light" />
<style name="KeepassDXStyle.Night.Dynamic" parent="KeepassDXStyle.Night" />
</resources>