mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
First commit to implement Dark mode
This commit is contained in:
@@ -51,7 +51,11 @@ android {
|
||||
buildConfigField "String", "BUILD_VERSION", "\"libre\""
|
||||
buildConfigField "boolean", "FULL_VERSION", "true"
|
||||
buildConfigField "boolean", "CLOSED_STORE", "false"
|
||||
buildConfigField "String[]", "STYLES_DISABLED", "{\"KeepassDXStyle_Red\",\"KeepassDXStyle_Purple\",\"KeepassDXStyle_Purple_Dark\"}"
|
||||
buildConfigField "String[]", "STYLES_DISABLED",
|
||||
"{\"KeepassDXStyle_Red\"," +
|
||||
"\"KeepassDXStyle_Red_Night\"," +
|
||||
"\"KeepassDXStyle_Purple\"," +
|
||||
"\"KeepassDXStyle_Purple_Dark\"}"
|
||||
buildConfigField "String[]", "ICON_PACKS_DISABLED", "{}"
|
||||
}
|
||||
pro {
|
||||
@@ -70,7 +74,13 @@ android {
|
||||
buildConfigField "String", "BUILD_VERSION", "\"free\""
|
||||
buildConfigField "boolean", "FULL_VERSION", "false"
|
||||
buildConfigField "boolean", "CLOSED_STORE", "true"
|
||||
buildConfigField "String[]", "STYLES_DISABLED", "{\"KeepassDXStyle_Blue\",\"KeepassDXStyle_Red\",\"KeepassDXStyle_Purple\",\"KeepassDXStyle_Purple_Dark\"}"
|
||||
buildConfigField "String[]", "STYLES_DISABLED",
|
||||
"{\"KeepassDXStyle_Blue\"," +
|
||||
"\"KeepassDXStyle_Blue_Night\"," +
|
||||
"\"KeepassDXStyle_Red\"," +
|
||||
"\"KeepassDXStyle_Red_Night\"," +
|
||||
"\"KeepassDXStyle_Purple\"," +
|
||||
"\"KeepassDXStyle_Purple_Dark\"}"
|
||||
buildConfigField "String[]", "ICON_PACKS_DISABLED", "{}"
|
||||
manifestPlaceholders = [ googleAndroidBackupAPIKey:"AEdPqrEAAAAIbRfbV8fHLItXo8OcHwrO0sSNblqhPwkc0DPTqg" ]
|
||||
}
|
||||
|
||||
@@ -20,10 +20,10 @@
|
||||
package com.kunzisoft.keepass.activities.stylish
|
||||
|
||||
import android.content.Context
|
||||
import android.content.res.Configuration
|
||||
import android.util.Log
|
||||
import androidx.annotation.StyleRes
|
||||
import androidx.preference.PreferenceManager
|
||||
import android.util.Log
|
||||
|
||||
import com.kunzisoft.keepass.R
|
||||
|
||||
/**
|
||||
@@ -43,12 +43,45 @@ object Stylish {
|
||||
themeString = PreferenceManager.getDefaultSharedPreferences(context).getString(stylishPrefKey, context.getString(R.string.list_style_name_light))
|
||||
}
|
||||
|
||||
private fun retrieveEquivalentSystemStyle(styleString: String, context: Context): String {
|
||||
var newStyleString: String = styleString
|
||||
when (context.resources.configuration.uiMode.and(Configuration.UI_MODE_NIGHT_MASK)) {
|
||||
Configuration.UI_MODE_NIGHT_NO -> false
|
||||
Configuration.UI_MODE_NIGHT_YES -> true
|
||||
else -> null
|
||||
}?.let { systemNightMode ->
|
||||
newStyleString = if (systemNightMode) {
|
||||
when (styleString) {
|
||||
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)
|
||||
context.getString(R.string.list_style_name_blue) -> context.getString(R.string.list_style_name_blue_night)
|
||||
context.getString(R.string.list_style_name_red) -> context.getString(R.string.list_style_name_red_night)
|
||||
context.getString(R.string.list_style_name_purple) -> context.getString(R.string.list_style_name_purple_dark)
|
||||
else -> styleString
|
||||
}
|
||||
} else {
|
||||
when (styleString) {
|
||||
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)
|
||||
context.getString(R.string.list_style_name_blue_night) -> context.getString(R.string.list_style_name_blue)
|
||||
context.getString(R.string.list_style_name_red_night) -> context.getString(R.string.list_style_name_red)
|
||||
context.getString(R.string.list_style_name_purple_dark) -> context.getString(R.string.list_style_name_purple)
|
||||
else -> styleString
|
||||
}
|
||||
}
|
||||
}
|
||||
return newStyleString
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign the style to the class attribute
|
||||
* @param styleString Style id String
|
||||
*/
|
||||
fun assignStyle(styleString: String) {
|
||||
themeString = styleString
|
||||
fun assignStyle(styleString: String, context: Context) {
|
||||
|
||||
themeString = retrieveEquivalentSystemStyle(styleString, context)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -59,12 +92,16 @@ object Stylish {
|
||||
@StyleRes
|
||||
fun getThemeId(context: Context): Int {
|
||||
|
||||
return when (themeString) {
|
||||
return when (retrieveEquivalentSystemStyle(themeString ?: context.getString(R.string.list_style_name_light), context)) {
|
||||
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
|
||||
context.getString(R.string.list_style_name_clear) -> R.style.KeepassDXStyle_Clear
|
||||
context.getString(R.string.list_style_name_dark) -> R.style.KeepassDXStyle_Dark
|
||||
context.getString(R.string.list_style_name_blue) -> R.style.KeepassDXStyle_Blue
|
||||
context.getString(R.string.list_style_name_blue_night) -> R.style.KeepassDXStyle_Blue_Night
|
||||
context.getString(R.string.list_style_name_red) -> R.style.KeepassDXStyle_Red
|
||||
context.getString(R.string.list_style_name_red_night) -> R.style.KeepassDXStyle_Red_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
|
||||
else -> R.style.KeepassDXStyle_Light
|
||||
|
||||
@@ -385,7 +385,7 @@ class NestedAppSettingsFragment : NestedSettingsFragment() {
|
||||
}
|
||||
}
|
||||
if (styleEnabled) {
|
||||
Stylish.assignStyle(styleIdString)
|
||||
Stylish.assignStyle(styleIdString, activity)
|
||||
// Relaunch the current activity to redraw theme
|
||||
(activity as? SettingsActivity?)?.apply {
|
||||
keepCurrentScreen()
|
||||
|
||||
@@ -446,10 +446,14 @@
|
||||
<string-array name="list_style_names">
|
||||
<item>Hell</item>
|
||||
<item>Dunkel</item>
|
||||
<item>Weiß</item>
|
||||
<item>Schwarz</item>
|
||||
<item>Klassisch Bright</item>
|
||||
<item>Klassisch Dunkel</item>
|
||||
<item>Himmel und Meer</item>
|
||||
<item>Roter Vulkan</item>
|
||||
<item>Himmel</item>
|
||||
<item>Mond</item>
|
||||
<item>Sonne</item>
|
||||
<item>Vulkan</item>
|
||||
<item>Purple Light</item>
|
||||
<item>Purple Dark</item>
|
||||
</string-array>
|
||||
|
||||
@@ -283,10 +283,14 @@
|
||||
<string-array name="list_style_names">
|
||||
<item>Jour</item>
|
||||
<item>Nuit</item>
|
||||
<item>Blanc</item>
|
||||
<item>Noir</item>
|
||||
<item>Clair Classique</item>
|
||||
<item>Foncé Classique</item>
|
||||
<item>Ciel et Océan</item>
|
||||
<item>Rouge Volcan</item>
|
||||
<item>Ciel</item>
|
||||
<item>Lune</item>
|
||||
<item>Soleil</item>
|
||||
<item>Volcan</item>
|
||||
<item>Pourpre Lumineux</item>
|
||||
<item>Pourpre Obscur</item>
|
||||
</string-array>
|
||||
|
||||
@@ -495,10 +495,14 @@
|
||||
<string-array name="list_style_names">
|
||||
<item>Light</item>
|
||||
<item>Night</item>
|
||||
<item>White</item>
|
||||
<item>Black</item>
|
||||
<item>Classic Clear</item>
|
||||
<item>Classic Dark</item>
|
||||
<item>Sky and Ocean</item>
|
||||
<item>Red Volcano</item>
|
||||
<item>Sky</item>
|
||||
<item>Moon</item>
|
||||
<item>Sun</item>
|
||||
<item>Volcano</item>
|
||||
<item>Purple Light</item>
|
||||
<item>Purple Dark</item>
|
||||
</string-array>
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
</style>
|
||||
|
||||
<!-- FAB -->
|
||||
<style name="KeepassDXStyle.v21.Fab" parent="Theme.AppCompat">
|
||||
<style name="KeepassDXStyle.v21.Fab" parent="Theme.AppCompat.DayNight">
|
||||
<item name="android:elevation">4dp</item>
|
||||
</style>
|
||||
|
||||
|
||||
@@ -327,19 +327,27 @@
|
||||
<!-- Style -->
|
||||
<string name="list_style_name_light" translatable="false">KeepassDXStyle_Light</string>
|
||||
<string name="list_style_name_night" translatable="false">KeepassDXStyle_Night</string>
|
||||
<string name="list_style_name_white" translatable="false">KeepassDXStyle_White</string>
|
||||
<string name="list_style_name_black" translatable="false">KeepassDXStyle_Black</string>
|
||||
<string name="list_style_name_clear" translatable="false">KeepassDXStyle_Clear</string>
|
||||
<string name="list_style_name_dark" translatable="false">KeepassDXStyle_Dark</string>
|
||||
<string name="list_style_name_blue" translatable="false">KeepassDXStyle_Blue</string>
|
||||
<string name="list_style_name_blue_night" translatable="false">KeepassDXStyle_Blue_Night</string>
|
||||
<string name="list_style_name_red" translatable="false">KeepassDXStyle_Red</string>
|
||||
<string name="list_style_name_red_night" translatable="false">KeepassDXStyle_Red_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-array name="list_style_values">
|
||||
<item translatable="false">@string/list_style_name_light</item>
|
||||
<item translatable="false">@string/list_style_name_night</item>
|
||||
<item translatable="false">@string/list_style_name_white</item>
|
||||
<item translatable="false">@string/list_style_name_black</item>
|
||||
<item translatable="false">@string/list_style_name_clear</item>
|
||||
<item translatable="false">@string/list_style_name_dark</item>
|
||||
<item translatable="false">@string/list_style_name_blue</item>
|
||||
<item translatable="false">@string/list_style_name_blue_night</item>
|
||||
<item translatable="false">@string/list_style_name_red</item>
|
||||
<item translatable="false">@string/list_style_name_red_night</item>
|
||||
<item translatable="false">@string/list_style_name_purple</item>
|
||||
<item translatable="false">@string/list_style_name_purple_dark</item>
|
||||
</string-array>
|
||||
|
||||
@@ -560,10 +560,14 @@
|
||||
<string-array name="list_style_names">
|
||||
<item>Light</item>
|
||||
<item>Night</item>
|
||||
<item>White</item>
|
||||
<item>Black</item>
|
||||
<item>Classic Clear</item>
|
||||
<item>Classic Dark</item>
|
||||
<item>Sky and Ocean</item>
|
||||
<item>Red Volcano</item>
|
||||
<item>Sky</item>
|
||||
<item>Moon</item>
|
||||
<item>Sun</item>
|
||||
<item>Volcano</item>
|
||||
<item>Purple Light</item>
|
||||
<item>Purple Dark</item>
|
||||
</string-array>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
along with KeePassDX. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<resources>
|
||||
<!-- Dark Style -->
|
||||
<!-- Black Style -->
|
||||
<style name="KeepassDXStyle.Black" parent="KeepassDXStyle.Night" >
|
||||
<item name="colorPrimary">@color/dark</item>
|
||||
<item name="colorPrimaryDark">@color/black</item>
|
||||
|
||||
68
app/src/main/res/values/style_blue_night.xml
Normal file
68
app/src/main/res/values/style_blue_night.xml
Normal file
@@ -0,0 +1,68 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2018 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/>.
|
||||
-->
|
||||
<resources>
|
||||
<!-- Blue Style -->
|
||||
<style name="KeepassDXStyle.Blue.Night" parent="KeepassDXStyle.Night" >
|
||||
<item name="colorPrimary">@color/blue</item>
|
||||
<item name="colorPrimaryDark">@color/blue_dark</item>
|
||||
<item name="colorAccent">@color/blue_white</item>
|
||||
<item name="colorAccentLight">@color/blue_lighter</item>
|
||||
<item name="colorControlActivated">@color/blue_white</item>
|
||||
<item name="android:textColorPrimary">@color/blue_light</item>
|
||||
<item name="android:textColorHintInverse">@color/blue_lighter</item>
|
||||
<item name="android:windowBackground">@color/background_night</item>
|
||||
<item name="toolbarAppearance">@style/KeepassDXStyle.Toolbar.Blue.Night</item>
|
||||
<item name="toolbarHomeAppearance">@style/KeepassDXStyle.Toolbar.Home.Blue.Night</item>
|
||||
<item name="specialToolbarAppearance">@style/KeepassDXStyle.Toolbar.Special.Blue.Night</item>
|
||||
<item name="android:alertDialogTheme">@style/KeepassDXStyle.Blue.Night.Dialog</item>
|
||||
<item name="alertDialogTheme">@style/KeepassDXStyle.Blue.Night.Dialog</item>
|
||||
<item name="actionModeStyle">@style/KeepassDXStyle.ActionMode.Blue.Night</item>
|
||||
</style>
|
||||
<!-- Toolbar Style Blue -->
|
||||
<style name="KeepassDXStyle.Toolbar.Blue.Night" parent="KeepassDXStyle.Blue.Night">
|
||||
<item name="colorControlActivated">@color/blue_lighter</item>
|
||||
<item name="colorControlNormal">@color/colorTextInverse</item>
|
||||
<item name="android:textColorPrimary">@color/colorTextInverse</item>
|
||||
<item name="android:textColorSecondary">@color/colorTextInverse</item>
|
||||
<item name="android:editTextColor">@color/colorTextInverse</item>
|
||||
<item name="android:textColorHint">@color/blue_lighter</item>
|
||||
<item name="android:tint">@color/colorTextInverse</item>
|
||||
</style>
|
||||
<!-- Toolbar Home Blue -->
|
||||
<style name="KeepassDXStyle.Toolbar.Home.Blue.Night" parent="KeepassDXStyle.Blue.Night">
|
||||
<item name="toolbarNavigationButtonStyle">@style/KeepassDXStyle.Toolbar.Navigation.Tinted</item>
|
||||
</style>
|
||||
<!-- Special Toolbar Blue -->
|
||||
<style name="KeepassDXStyle.Toolbar.Special.Blue.Night" parent="KeepassDXStyle.Toolbar.Blue.Night">
|
||||
<item name="actionMenuTextColor">@color/colorTextInverse</item>
|
||||
<item name="android:background">@color/blue_dark</item>
|
||||
<item name="background">@color/blue_dark</item>
|
||||
</style>
|
||||
<!-- Contextual Action Bar Blue -->
|
||||
<style name="KeepassDXStyle.ActionMode.Blue.Night" parent="@style/Widget.AppCompat.ActionMode">
|
||||
<item name="android:background">@color/blue_dark</item>
|
||||
<item name="background">@color/blue_dark</item>
|
||||
</style>
|
||||
<!-- Dialog -->
|
||||
<style name="KeepassDXStyle.Blue.Night.Dialog" parent="KeepassDXStyle.Night.Dialog">
|
||||
<item name="colorAccent">@color/blue_lighter</item>
|
||||
<item name="android:textColorPrimary">@color/blue</item>
|
||||
</style>
|
||||
</resources>
|
||||
72
app/src/main/res/values/style_clear.xml
Normal file
72
app/src/main/res/values/style_clear.xml
Normal file
@@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2018 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/>.
|
||||
-->
|
||||
<resources>
|
||||
<!-- Clear Style -->
|
||||
<style name="KeepassDXStyle.Clear" parent="KeepassDXStyle.Light" >
|
||||
<item name="colorPrimary">@color/white</item>
|
||||
<item name="colorPrimaryDark">@color/white</item>
|
||||
<item name="colorAccent">@color/cyan</item>
|
||||
<item name="colorAccentLight">@color/cyan_lighter</item>
|
||||
<item name="colorControlActivated">@color/cyan_lighter</item>
|
||||
<item name="android:textColorPrimary">@color/cyan_lighter</item>
|
||||
<item name="android:textColorHintInverse">@color/cyan_lighter</item>
|
||||
<item name="android:windowBackground">@color/background_light</item>
|
||||
<item name="toolbarAppearance">@style/KeepassDXStyle.Toolbar.Clear</item>
|
||||
<item name="toolbarHomeAppearance">@style/KeepassDXStyle.Toolbar.Home.Clear</item>
|
||||
<item name="specialToolbarAppearance">@style/KeepassDXStyle.Toolbar.Special.Clear</item>
|
||||
<item name="android:alertDialogTheme">@style/KeepassDXStyle.Clear.Dialog</item>
|
||||
<item name="alertDialogTheme">@style/KeepassDXStyle.Clear.Dialog</item>
|
||||
<item name="actionModeStyle">@style/KeepassDXStyle.ActionMode.Clear</item>
|
||||
<item name="cardViewStyle">@style/KeepassDXStyle.Cardview.Clear</item>
|
||||
<item name="cardBackgroundTransparentColor">@color/white_transparent</item>
|
||||
</style>
|
||||
<!-- Toolbar Style Clear -->
|
||||
<style name="KeepassDXStyle.Toolbar.Clear" parent="KeepassDXStyle.Clear">
|
||||
<item name="colorControlNormal">@color/colorText</item>
|
||||
<item name="android:textColorPrimary">@color/colorText</item>
|
||||
<item name="android:textColorSecondary">@color/colorTextSecondary</item>
|
||||
<item name="android:tint">@color/colorText</item>
|
||||
</style>
|
||||
<!-- Toolbar Home Clear -->
|
||||
<style name="KeepassDXStyle.Toolbar.Home.Clear" parent="KeepassDXStyle.Clear">
|
||||
<item name="toolbarNavigationButtonStyle">@style/KeepassDXStyle.Toolbar.Navigation.Tinted</item>
|
||||
</style>
|
||||
<!-- Special Toolbar Clear -->
|
||||
<style name="KeepassDXStyle.Toolbar.Special.Clear" parent="KeepassDXStyle.Toolbar.Clear">
|
||||
<item name="android:background">@color/white</item>
|
||||
<item name="background">@color/white</item>
|
||||
</style>
|
||||
<!-- Contextual Action Bar Clear -->
|
||||
<style name="KeepassDXStyle.ActionMode.Clear" parent="@style/Widget.AppCompat.ActionMode">
|
||||
<item name="android:background">@color/white</item>
|
||||
<item name="background">@color/white</item>
|
||||
</style>
|
||||
<!-- Dialog -->
|
||||
<style name="KeepassDXStyle.Clear.Dialog" parent="KeepassDXStyle.Light.Dialog">
|
||||
<item name="colorAccent">#fefefe</item>
|
||||
<item name="android:textColorPrimary">@color/cyan</item>
|
||||
<item name="android:background">@color/white</item>
|
||||
<item name="background">@color/white</item>
|
||||
</style>
|
||||
<!-- CardView -->
|
||||
<style name="KeepassDXStyle.Cardview.Clear" parent="CardView">
|
||||
<item name="cardBackgroundColor">@color/white</item>
|
||||
</style>
|
||||
</resources>
|
||||
@@ -19,7 +19,7 @@
|
||||
-->
|
||||
<resources>
|
||||
<!-- Red Style -->
|
||||
<style name="KeepassDXStyle.Red" parent="KeepassDXStyle.Night" >
|
||||
<style name="KeepassDXStyle.Red" parent="KeepassDXStyle.Light" >
|
||||
<item name="colorPrimary">@color/red</item>
|
||||
<item name="colorPrimaryDark">@color/red_dark</item>
|
||||
<item name="colorAccent">@color/orange</item>
|
||||
@@ -50,11 +50,12 @@
|
||||
</style>
|
||||
<!-- Special Toolbar Red -->
|
||||
<style name="KeepassDXStyle.Toolbar.Special.Red" parent="KeepassDXStyle.Toolbar.Red">
|
||||
<item name="actionMenuTextColor">@color/colorTextInverse</item>
|
||||
<item name="android:background">@color/red_dark</item>
|
||||
<item name="background">@color/red_dark</item>
|
||||
</style>
|
||||
<!-- Dialog -->
|
||||
<style name="KeepassDXStyle.Red.Dialog" parent="KeepassDXStyle.Night.Dialog">
|
||||
<style name="KeepassDXStyle.Red.Dialog" parent="KeepassDXStyle.Light.Dialog">
|
||||
<item name="colorAccent">@color/red</item>
|
||||
<item name="android:textColorPrimary">@color/orange</item>
|
||||
</style>
|
||||
|
||||
67
app/src/main/res/values/style_red_night.xml
Normal file
67
app/src/main/res/values/style_red_night.xml
Normal file
@@ -0,0 +1,67 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2018 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/>.
|
||||
-->
|
||||
<resources>
|
||||
<!-- Red Style -->
|
||||
<style name="KeepassDXStyle.Red.Night" parent="KeepassDXStyle.Night" >
|
||||
<item name="colorPrimary">@color/red</item>
|
||||
<item name="colorPrimaryDark">@color/red_dark</item>
|
||||
<item name="colorAccent">@color/orange</item>
|
||||
<item name="colorAccentLight">@color/orange_light</item>
|
||||
<item name="colorControlActivated">@color/orange</item>
|
||||
<item name="android:textColorPrimary">@color/red</item>
|
||||
<item name="android:textColorHintInverse">@color/red_lighter</item>
|
||||
<item name="android:windowBackground">@color/background_night</item>
|
||||
<item name="toolbarAppearance">@style/KeepassDXStyle.Toolbar.Red.Night</item>
|
||||
<item name="toolbarHomeAppearance">@style/KeepassDXStyle.Toolbar.Home.Red.Night</item>
|
||||
<item name="specialToolbarAppearance">@style/KeepassDXStyle.Toolbar.Special.Red.Night</item>
|
||||
<item name="android:alertDialogTheme">@style/KeepassDXStyle.Red.Night.Dialog</item>
|
||||
<item name="alertDialogTheme">@style/KeepassDXStyle.Red.Night.Dialog</item>
|
||||
<item name="actionModeStyle">@style/KeepassDXStyle.ActionMode.Red.Night</item>
|
||||
</style>
|
||||
<!-- Toolbar Style Red -->
|
||||
<style name="KeepassDXStyle.Toolbar.Red.Night" parent="KeepassDXStyle.Red.Night">
|
||||
<item name="colorControlActivated">@color/red_lighter</item>
|
||||
<item name="colorControlNormal">@color/colorTextInverse</item>
|
||||
<item name="android:textColorPrimary">@color/colorTextInverse</item>
|
||||
<item name="android:textColorSecondary">@color/colorTextInverse</item>
|
||||
<item name="android:editTextColor">@color/colorTextInverse</item>
|
||||
<item name="android:textColorHint">@color/red_lighter</item>
|
||||
<item name="android:tint">@color/colorTextInverse</item>
|
||||
</style>
|
||||
<!-- Toolbar Home Red -->
|
||||
<style name="KeepassDXStyle.Toolbar.Home.Red.Night" parent="KeepassDXStyle.Red.Night">
|
||||
<item name="toolbarNavigationButtonStyle">@style/KeepassDXStyle.Toolbar.Navigation.Tinted</item>
|
||||
</style>
|
||||
<!-- Special Toolbar Red -->
|
||||
<style name="KeepassDXStyle.Toolbar.Special.Red.Night" parent="KeepassDXStyle.Toolbar.Red.Night">
|
||||
<item name="android:background">@color/red_dark</item>
|
||||
<item name="background">@color/red_dark</item>
|
||||
</style>
|
||||
<!-- Contextual Action Bar Red -->
|
||||
<style name="KeepassDXStyle.ActionMode.Red.Night" parent="@style/Widget.AppCompat.ActionMode">
|
||||
<item name="android:background">@color/orange</item>
|
||||
<item name="background">@color/orange</item>
|
||||
</style>
|
||||
<!-- Dialog -->
|
||||
<style name="KeepassDXStyle.Red.Night.Dialog" parent="KeepassDXStyle.Night.Dialog">
|
||||
<item name="colorAccent">@color/red</item>
|
||||
<item name="android:textColorPrimary">@color/orange</item>
|
||||
</style>
|
||||
</resources>
|
||||
90
app/src/main/res/values/style_white.xml
Normal file
90
app/src/main/res/values/style_white.xml
Normal file
@@ -0,0 +1,90 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2020 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/>.
|
||||
-->
|
||||
<resources>
|
||||
<!-- White Style -->
|
||||
<style name="KeepassDXStyle.White" parent="KeepassDXStyle.Light" >
|
||||
<item name="colorPrimary">@color/white</item>
|
||||
<item name="colorPrimaryDark">@color/white</item>
|
||||
<item name="colorAccent">@color/orange_dark</item>
|
||||
<item name="colorAccentLight">@color/orange</item>
|
||||
<item name="colorControlNormal">@color/colorText</item>
|
||||
<item name="colorControlActivated">@color/green_darker</item>
|
||||
<item name="android:textColorPrimary">@color/green</item>
|
||||
<item name="android:textColorHintInverse">@color/green_light</item>
|
||||
<item name="android:windowBackground">@color/background_light</item>
|
||||
<item name="toolbarAppearance">@style/KeepassDXStyle.Toolbar.White</item>
|
||||
<item name="toolbarPopupAppearance">@style/KeepassDXStyle.Toolbar.Popup.White</item>
|
||||
<item name="toolbarHomeAppearance">@style/KeepassDXStyle.Toolbar.Home.White</item>
|
||||
<item name="specialToolbarAppearance">@style/KeepassDXStyle.Toolbar.Special.White</item>
|
||||
<item name="android:alertDialogTheme">@style/KeepassDXStyle.White.Dialog</item>
|
||||
<item name="alertDialogTheme">@style/KeepassDXStyle.White.Dialog</item>
|
||||
<item name="actionModeStyle">@style/KeepassDXStyle.ActionMode.White</item>
|
||||
<item name="cardViewStyle">@style/KeepassDXStyle.Cardview.White</item>
|
||||
<item name="cardBackgroundTransparentColor">@color/white_transparent</item>
|
||||
|
||||
<item name="android:textColor">@color/text_color_light</item>
|
||||
<item name="android:editTextColor">@color/colorText</item>
|
||||
<item name="textColorInverse">@color/colorText</item>d
|
||||
<item name="android:textColorPrimaryInverse">@color/colorText</item>
|
||||
<item name="android:textColorSecondary">@color/text_color_secondary_light</item>
|
||||
<item name="android:textColorSecondaryInverse">@color/colorTextSecondary</item>
|
||||
<item name="android:textColorHint">@color/colorTextSecondary</item>
|
||||
</style>
|
||||
<!-- Toolbar Style White -->
|
||||
<style name="KeepassDXStyle.Toolbar.White" parent="KeepassDXStyle.White">
|
||||
<item name="colorControlNormal">@color/colorText</item>
|
||||
<item name="android:textColorPrimary">@color/colorText</item>
|
||||
<item name="android:textColorSecondary">@color/colorTextSecondary</item>
|
||||
<item name="android:editTextColor">@color/colorText</item>
|
||||
<item name="android:textColorHint">@color/green</item>
|
||||
<item name="android:tint">@color/colorText</item>
|
||||
<item name="tint">@color/colorText</item>
|
||||
</style>
|
||||
<!-- Toolbar Home White -->
|
||||
<style name="KeepassDXStyle.Toolbar.Home.White" parent="KeepassDXStyle.Toolbar.White">
|
||||
<item name="toolbarNavigationButtonStyle">@style/KeepassDXStyle.Toolbar.Navigation.Tinted</item>
|
||||
</style>
|
||||
<!-- Toolbar Popup menu -->
|
||||
<style name="KeepassDXStyle.Toolbar.Popup.White" parent="KeepassDXStyle.Toolbar.Popup.Night">
|
||||
<item name="android:textColor">@color/colorText</item>
|
||||
<item name="android:colorBackground">@color/white</item>
|
||||
</style>
|
||||
<!-- Special Toolbar Black -->
|
||||
<style name="KeepassDXStyle.Toolbar.Special.White" parent="KeepassDXStyle.Toolbar.White">
|
||||
<item name="android:background">@color/white</item>
|
||||
<item name="background">@color/white</item>
|
||||
</style>
|
||||
<!-- Contextual Action Bar Dark -->
|
||||
<style name="KeepassDXStyle.ActionMode.White" parent="@style/Widget.AppCompat.ActionMode">
|
||||
<item name="android:background">@color/white</item>
|
||||
<item name="background">@color/white</item>
|
||||
</style>
|
||||
<!-- Dialog -->
|
||||
<style name="KeepassDXStyle.White.Dialog" parent="KeepassDXStyle.Light.Dialog">
|
||||
<item name="colorAccent">@color/orange_dark</item>
|
||||
<item name="android:textColorPrimary">@color/green_dark</item>
|
||||
<item name="android:background">@color/white</item>
|
||||
<item name="background">@color/white</item>
|
||||
</style>
|
||||
<!-- CardView -->
|
||||
<style name="KeepassDXStyle.Cardview.White" parent="CardView">
|
||||
<item name="cardBackgroundColor">@color/white</item>
|
||||
</style>
|
||||
</resources>
|
||||
@@ -85,7 +85,7 @@
|
||||
<item name="expandedTitleTextAppearance">@style/KeepassDXStyle.Expanded.Title</item>
|
||||
<item name="collapsedTitleTextAppearance">@style/KeepassDXStyle.Collapsed.Title</item>
|
||||
</style>
|
||||
<style name="KeepassDXStyle.Night.v21" parent="Theme.AppCompat">
|
||||
<style name="KeepassDXStyle.Night.v21" parent="Theme.AppCompat.DayNight">
|
||||
<item name="android:windowAnimationStyle">@style/KeepassDXStyle.ActivityAnimation</item>
|
||||
|
||||
<item name="windowNoTitle">true</item>
|
||||
@@ -148,7 +148,7 @@
|
||||
|
||||
<!-- Night Style -->
|
||||
<style name="KeepassDXStyle.Night" parent="KeepassDXStyle.Night.v21" />
|
||||
<style name="KeepassDXStyle.Toolbar.Popup.Night" parent="Theme.AppCompat" />
|
||||
<style name="KeepassDXStyle.Toolbar.Popup.Night" parent="Theme.AppCompat.DayNight" />
|
||||
|
||||
<!-- Activity Animation -->
|
||||
<style name="KeepassDXStyle.ActivityAnimation" parent="@android:style/Animation.Activity">
|
||||
|
||||
Reference in New Issue
Block a user