<?xml version="1.0" encoding="utf-8"?>
<!--
 Copyright 2017 Jeremy Jamet / Kunzisoft.

 This file is part of KeePass DX.

  KeePass DX 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.

  KeePass DX 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 KeePass DX.  If not, see <http://www.gnu.org/licenses/>.
-->
<resources>

    <!-- Base application theme. -->
    <!-- For setting encapsulation -->
    <style name="KeepassDXStyle.Light.v21" parent="Theme.AppCompat.Light">

        <item name="windowNoTitle">true</item>
        <item name="windowActionBar">false</item>

        <item name="android:buttonStyle">@style/KeepassDXStyle.Button</item>
        <item name="buttonStyle">@style/KeepassDXStyle.Button</item>
        <item name="android:imageButtonStyle">@style/KeepassDXStyle.ImageButton</item>
        <item name="imageButtonStyle">@style/KeepassDXStyle.ImageButton</item>

        <item name="android:checkboxStyle">@style/KeepassDXStyle.CheckBox</item>

        <item name="colorPrimary">@color/green</item>
        <item name="colorPrimaryDark">@color/green_dark</item>
        <item name="colorAccent">@color/orange</item>
        <item name="colorAccentCompat">@color/orange</item>

        <item name="colorControlNormal">@color/colorTextSecondary</item>
        <item name="colorControlActivated">@color/orange</item>

        <item name="android:textAppearance">@style/KeepassDXStyle.TextAppearance</item>
        <item name="android:textAppearanceMedium">@style/KeepassDXStyle.TextAppearance</item>

        <item name="android:windowBackground">@color/background_light</item>

        <item name="android:textColor">@color/text_color_light</item>
        <item name="android:editTextColor">@color/colorText</item>
        <item name="textColorInverse">@color/colorTextInverse</item>
        <item name="android:textColorPrimary">@color/green_light</item>
        <item name="android:textColorPrimaryInverse">@color/colorTextPrimaryInverse</item>
        <item name="android:textColorSecondary">@color/text_color_secondary_light</item>
        <item name="android:textColorSecondaryInverse">@color/colorTextSecondaryInverse</item>
        <item name="android:textColorHint">@color/colorTextSecondary</item>
        <item name="android:textColorHintInverse">@color/green_lighter</item>

        <item name="iconPreferenceColor">@color/text_color_secondary_light</item>

        <!-- Dialog -->
        <item name="buttonBarNegativeButtonStyle">@style/KeepassDXStyle.Dialog.NegativeButton</item>
        <item name="buttonBarPositiveButtonStyle">@style/KeepassDXStyle.Dialog.PositiveButton</item>

        <!-- Toolbar -->
        <item name="toolbarAppearance">@style/KeepassDXStyle.Toolbar</item>
        <item name="toolbarPopupAppearance">@style/KeepassDXStyle.Light.Toolbar.Popup</item>

        <!-- White FAB -->
        <item name="whiteFab">@style/KeepassDXStyle.Fab.White</item>
    </style>
    <style name="KeepassDXStyle.Night.v21" parent="Theme.AppCompat">

        <item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>

        <item name="windowNoTitle">true</item>
        <item name="windowActionBar">false</item>

        <item name="android:buttonStyle">@style/KeepassDXStyle.Button</item>
        <item name="buttonStyle">@style/KeepassDXStyle.Button</item>
        <item name="android:imageButtonStyle">@style/KeepassDXStyle.ImageButton</item>
        <item name="imageButtonStyle">@style/KeepassDXStyle.ImageButton</item>

        <item name="android:checkboxStyle">@style/KeepassDXStyle.CheckBox</item>

        <item name="colorPrimary">@color/green</item>
        <item name="colorPrimaryDark">@color/green_dark</item>
        <item name="colorAccent">@color/orange</item>
        <item name="colorAccentCompat">@color/orange</item>

        <item name="colorControlNormal">@color/colorTextSecondary</item>
        <item name="colorControlActivated">@color/orange</item>

        <item name="android:textAppearance">@style/KeepassDXStyle.TextAppearance</item>
        <item name="android:textAppearanceMedium">@style/KeepassDXStyle.TextAppearance</item>

        <item name="android:windowBackground">@color/background_night</item>

        <item name="android:textColor">@color/text_color_night</item>
        <item name="android:editTextColor">@color/colorTextInverse</item>
        <item name="textColorInverse">@color/colorTextInverse</item>
        <item name="android:textColorPrimary">@color/green_light</item>
        <item name="android:textColorPrimaryInverse">@color/colorTextPrimaryInverse</item>
        <item name="android:textColorSecondary">@color/text_color_secondary_night</item>
        <item name="android:textColorSecondaryInverse">@color/colorTextSecondaryInverse</item>
        <item name="android:textColorHint">@color/colorTextSecondary</item>
        <item name="android:textColorHintInverse">@color/green_lighter</item>

        <item name="iconPreferenceColor">@color/text_color_secondary_night</item>

        <item name="android:alertDialogTheme">@style/KeepassDXStyle.Night.Dialog</item>
        <item name="alertDialogTheme">@style/KeepassDXStyle.Night.Dialog</item>

        <!-- Dialog -->
        <item name="buttonBarNegativeButtonStyle">@style/KeepassDXStyle.Dialog.NegativeButton</item>
        <item name="buttonBarPositiveButtonStyle">@style/KeepassDXStyle.Dialog.PositiveButton</item>

        <!-- Toolbar -->
        <item name="toolbarAppearance">@style/KeepassDXStyle.Toolbar</item>
        <item name="toolbarPopupAppearance">@style/KeepassDXStyle.Night.Toolbar.Popup</item>

        <!-- White FAB -->
        <item name="whiteFab">@style/KeepassDXStyle.Fab.White</item>
    </style>

    <!-- Light Style -->
    <style name="KeepassDXStyle.Light" parent="KeepassDXStyle.Light.v21" />
    <style name="KeepassDXStyle.Light.Toolbar.Popup" parent="Theme.AppCompat.Light.DarkActionBar">
        <item name="android:textColor">@color/colorText</item>
        <item name="android:colorBackground">@color/background_light</item>
    </style>

    <!-- Night Style -->
    <style name="KeepassDXStyle.Night" parent="KeepassDXStyle.Night.v21" />
    <style name="KeepassDXStyle.Night.Toolbar.Popup" parent="Theme.AppCompat">
        <item name="android:textColor">@color/colorTextInverse</item>
        <item name="android:colorBackground">@color/background_night</item>
    </style>

    <!-- Toolbar Style Green -->
    <style name="KeepassDXStyle.Toolbar" parent="Theme.AppCompat">
        <item name="colorControlNormal">@color/colorTextInverse</item>

        <item name="colorPrimary">@color/green</item>

        <item name="android:textColorPrimary">@color/colorTextInverse</item>
        <item name="android:textColorSecondary">@color/colorTextSecondary</item>
    </style>

    <!-- Dialog -->
    <style name="KeepassDXStyle.Night.Dialog" parent="Theme.AppCompat.Dialog.Alert">
        <item name="colorAccent">@color/orange</item>
        <item name="android:textColorPrimary">@color/green</item>
        <item name="android:background">@color/background_night</item>
        <item name="buttonBarNegativeButtonStyle">@style/KeepassDXStyle.Dialog.NegativeButton</item>
        <item name="buttonBarPositiveButtonStyle">@style/KeepassDXStyle.Dialog.PositiveButton</item>
    </style>
    <style name="KeepassDXStyle.Dialog.NegativeButton" parent="Widget.AppCompat.Button.ButtonBar.AlertDialog">
        <item name="android:textColor">?attr/colorAccent</item>
    </style>
    <style name="KeepassDXStyle.Dialog.PositiveButton" parent="Widget.AppCompat.Button.ButtonBar.AlertDialog">
        <item name="android:textColor">?android:attr/textColorPrimary</item>
    </style>

    <!-- CheckBox -->
    <style name="KeepassDXStyle.CheckBox" parent="Widget.AppCompat.CompoundButton.CheckBox">
        <item name="android:textColor">?android:attr/textColor</item>
    </style>

    <!-- Text Style -->
    <style name="KeepassDXStyle.TextAppearance" parent="android:style/TextAppearance">
        <item name="android:textColor">?android:attr/textColor</item>
    </style>
    <style name="KeepassDXStyle.TextAppearance.Inverse" parent="android:style/TextAppearance">
        <item name="android:textColor">?attr/textColorInverse</item>
    </style>
    <style name="KeepassDXStyle.TextAppearance.DefaultTextOnPrimary" parent="android:style/TextAppearance">
        <item name="android:textColor">?attr/textColorInverse</item>
    </style>
    <style name="KeepassDXStyle.TextAppearance.TitleTextOnPrimary" parent="KeepassDXStyle.TextAppearance.DefaultTextOnPrimary">
        <item name="android:textSize">18sp</item>
        <item name="android:textStyle">bold</item>
    </style>

    <style name="KeepassDXStyle.TextAppearance.Default" parent="KeepassDXStyle.TextAppearance">
        <item name="android:textSize">16sp</item>
    </style>
    <style name="KeepassDXStyle.TextAppearance.Large" parent="KeepassDXStyle.TextAppearance">
        <item name="android:textSize">18sp</item>
    </style>
    <style name="KeepassDXStyle.TextAppearance.FolderTitle" parent="KeepassDXStyle.TextAppearance.Default">
        <item name="android:textColor">?android:attr/textColorPrimary</item>
    </style>
    <style name="KeepassDXStyle.TextAppearance.Title" parent="KeepassDXStyle.TextAppearance">
        <item name="android:textColor">?android:attr/textColorPrimary</item>
        <item name="android:textSize">16sp</item>
    </style>
    <style name="KeepassDXStyle.TextAppearance.SmallTitle" parent="KeepassDXStyle.TextAppearance">
        <item name="android:textColor">?android:attr/textColorPrimary</item>
        <item name="android:textSize">14sp</item>
    </style>
    <style name="KeepassDXStyle.TextAppearance.LargeTitle" parent="KeepassDXStyle.TextAppearance">
        <item name="android:textColor">?android:attr/textColorPrimary</item>
        <item name="android:textSize">20sp</item>
    </style>
    <style name="KeepassDXStyle.TextAppearance.SecondaryText" parent="KeepassDXStyle.TextAppearance">
        <item name="android:textSize">14sp</item>
    </style>
    <style name="KeepassDXStyle.TextAppearance.TinyText" parent="KeepassDXStyle.TextAppearance">
        <item name="android:textSize">12sp</item>
    </style>
	<style name="KeepassDXStyle.TextAppearance.WarningTextStyle" parent="KeepassDXStyle.TextAppearance">
		<item name="android:textColor">?attr/colorAccent</item>
	</style>

    <!-- Button Style -->
    <style name="KeepassDXStyle.v21.Button" parent="Base.TextAppearance.AppCompat.Button" />
    <style name="KeepassDXStyle.Button" parent="KeepassDXStyle.v21.Button">
        <item name="android:textColor">?attr/textColorInverse</item>
        <item name="android:background">@drawable/button_background</item>
        <item name="android:gravity">center</item>
    </style>
    <style name="KeepassDXStyle.v21.ImageButton" parent="Base.Widget.AppCompat.ImageButton" />
    <style name="KeepassDXStyle.ImageButton" parent="KeepassDXStyle.v21.ImageButton">
        <item name="android:background">@drawable/image_button_background</item>
        <item name="android:gravity">center</item>
    </style>

    <!-- FAB -->
    <style name="KeepassDXStyle.v21.Fab" parent="Theme.AppCompat" />
    <style name="KeepassDXStyle.Fab" parent="KeepassDXStyle.v21.Fab">
    </style>
    <style name="KeepassDXStyle.Fab.White" parent="KeepassDXStyle.v21.Fab">
        <item name="colorAccent">@color/white</item>
        <item name="tint">?attr/colorAccentCompat</item>
    </style>

    <!-- Menu FAB -->
    <style name="KeepassDXStyle.v21.FabMenu" parent="KeepassDXStyle.TextAppearance.DefaultTextOnPrimary" />
    <style name="KeepassDXStyle.FabMenu" parent="KeepassDXStyle.v21.FabMenu">
        <item name="android:textSize">15sp</item>
        <item name="android:background">@drawable/button_small_background</item>
    </style>

    <!-- Form -->
	<style name="KeepassDXStyle.TextAppearance.LabelTextStyle" parent="KeepassDXStyle.TextAppearance">
        <item name="android:textColor">?attr/colorAccent</item>
		<item name="android:textSize">12sp</item>
	</style>
	<style name="KeepassDXStyle.TextAppearance.TextEntryItem" parent="KeepassDXStyle.TextAppearance">
		<item name="android:padding">5sp</item>
        <item name="android:textSize">16sp</item>
	</style>

    <!-- File Picker Theme -->
    <style name="KeepassDXStyle.FilePickerStyle.Night" parent="Theme.AppCompat.DialogWhenLarge">
        <!-- You can override this in your sub theme -->
        <item name="nnf_toolbarTheme">@style/ThemeOverlay.AppCompat.ActionBar</item>
        <item name="nnf_separator_color">@color/nnf_dark_separator_color</item>
        <item name="nnf_save_icon_color">?attr/colorAccent</item>
        <item name="nnf_dir_icon_color">?attr/colorAccent</item>

        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>

        <item name="colorPrimary">@color/green</item>
        <item name="colorPrimaryDark">@color/green_dark</item>
        <item name="colorAccent">@color/orange</item>
    </style>

    <style name="KeepassDXStyle.FilePickerStyle.Light" parent="Theme.AppCompat.Light.DialogWhenLarge">
        <item name="nnf_toolbarTheme">@style/ThemeOverlay.AppCompat.ActionBar</item>
        <item name="nnf_separator_color">@color/nnf_light_separator_color</item>
        <item name="nnf_save_icon_color">?attr/colorAccent</item>
        <item name="nnf_dir_icon_color">?attr/colorAccent</item>

        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>

        <item name="colorPrimary">@color/green</item>
        <item name="colorPrimaryDark">@color/green_dark</item>
        <item name="colorAccent">@color/orange</item>
    </style>

</resources>