<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="Theme.Aegis.Launch" parent="Theme.MaterialComponents.DayNight.NoActionBar">
        <!-- colorPrimary in the root theme sets the task description color (seen in task switcher) -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="android:windowDrawsSystemBarBackgrounds">true</item>
        <item name="android:statusBarColor">@android:color/transparent</item>
    </style>

    <style name="Theme.Aegis.Light" parent="Theme.MaterialComponents.Light.NoActionBar">
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorSecondary">@color/colorSecondary</item>
        <item name="colorAppBar">@color/colorPrimary</item>

        <item name="primaryText">@color/primary_text</item>
        <item name="secondaryText">@color/secondary_text</item>
        <item name="cardBackground">@color/card_background</item>
        <item name="cardBackgroundFocused">@color/card_background_focused</item>
        <item name="codePrimaryText">@color/code_primary_text</item>
        <item name="background">@color/background</item>
        <item name="divider">@color/divider</item>
        <item name="authText">@color/auth_text</item>

        <item name="iconColorPrimary">@color/icon_primary</item>
        <item name="iconColorInverted">@color/icon_primary_inverted</item>
        <item name="dot_color">@color/indicator_dot</item>
        <item name="dot_color_selected">@color/indicator_dot_selected</item>

        <item name="popupTheme">@style/ThemeOverlay.Aegis.Popup.Light</item>
        <item name="actionModeStyle">@style/Theme.Aegis.ActionMode.Light</item>
        <item name="alertDialogTheme">@style/Theme.Aegis.Dialog.Light</item>
        <item name="preferenceTheme">@style/Theme.Aegis.Preference.Light</item>
        <item name="textInputStyle">@style/Widget.Aegis.TextInput.Light</item>
        <item name="introButtonStyle">@style/Widget.Aegis.OutlinedButton.Light</item>
        <item name="dropdownStyle">@style/Widget.Aegis.Dropdown.Light</item>
        <item name="bottomSheetDialogTheme">@style/ThemeOverLay.Aegis.BottomSheetDialog.Rounded</item>

        <item name="windowActionModeOverlay">true</item>
        <item name="android:statusBarColor">?attr/colorAppBar</item>
        <item name="android:indeterminateTint">@color/colorSecondary</item>
    </style>

    <style name="Theme.Aegis.Light.Default" />

    <style name="Theme.Aegis.Light.NoActionBar">
        <item name="android:statusBarColor">@android:color/black</item>
    </style>

    <style name="Theme.Aegis.Light.Fullscreen" parent="Theme.Aegis.Light.Default">
        <item name="android:windowNoTitle">true</item>
        <item name="android:windowFullscreen">true</item>
    </style>

    <style name="Theme.Aegis.Dark" parent="Theme.MaterialComponents.NoActionBar">
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorSecondary">@color/colorSecondary</item>
        <item name="colorAppBar">@color/colorPrimary</item>

        <item name="primaryText">@color/primary_text_dark</item>
        <item name="secondaryText">@color/secondary_text_dark</item>
        <item name="cardBackground">@color/card_background_dark</item>
        <item name="cardBackgroundFocused">@color/card_background_focused_dark</item>
        <item name="codePrimaryText">@color/code_primary_text_dark</item>
        <item name="background">@color/background_dark</item>
        <item name="divider">@color/divider_dark</item>
        <item name="authText">@color/primary_text_inverted</item>

        <item name="iconColorPrimary">@color/icon_primary_dark</item>
        <item name="iconColorInverted">@color/icon_primary_dark_inverted</item>
        <item name="dot_color">@color/indicator_dot_dark</item>
        <item name="dot_color_selected">@color/indicator_dot_selected_dark</item>

        <item name="popupTheme">@style/ThemeOverlay.MaterialComponents.Dark</item>
        <item name="actionModeStyle">@style/Theme.Aegis.ActionMode.Dark</item>
        <item name="alertDialogTheme">@style/Theme.Aegis.Dialog.Dark</item>
        <item name="preferenceTheme">@style/Theme.Aegis.Preference.Dark</item>
        <item name="textInputStyle">@style/Widget.Aegis.TextInput.Dark</item>
        <item name="introButtonStyle">@style/Widget.Aegis.OutlinedButton.Dark</item>
        <item name="dropdownStyle">@style/Widget.Aegis.Dropdown.Dark</item>
        <item name="bottomSheetDialogTheme">@style/ThemeOverLay.Aegis.BottomSheetDialog.Rounded</item>

        <item name="windowActionModeOverlay">true</item>
        <item name="android:statusBarColor">?attr/colorAppBar</item>
        <item name="android:indeterminateTint">@color/colorSecondary</item>
        <item name="android:colorBackground">@color/background_dark</item>
        <item name="android:colorEdgeEffect">@color/background_dark</item>
        <item name="android:colorControlActivated">@color/colorSecondary</item>
    </style>

    <style name="Theme.Aegis.Dark.Default" />
    <style name="Theme.Aegis.Dark.NoActionBar">
        <item name="android:statusBarColor">?attr/background</item>
        <item name="android:navigationBarColor">?attr/background</item>
    </style>

    <style name="Theme.Aegis.Dark.Fullscreen" parent="Theme.Aegis.Dark.Default">
        <item name="android:windowNoTitle">true</item>
        <item name="android:windowFullscreen">true</item>
    </style>

    <style name="Theme.Aegis.TrueDark" parent="Theme.Aegis.Dark">
        <item name="colorAppBar">@color/background_true_dark</item>
        <item name="cardBackground">@color/background_true_dark</item>
        <item name="background">@color/background_true_dark</item>
        <item name="cardBackgroundFocused">@color/card_background_focused_true_dark</item>
        <item name="divider">@color/divider_true_dark</item>

        <item name="popupTheme">@style/ThemeOverlay.MaterialComponents.Dark</item>
        <item name="actionModeStyle">@style/Theme.Aegis.ActionMode.TrueDark</item>
        <item name="alertDialogTheme">@style/Theme.Aegis.Dialog.TrueDark</item>
        <item name="preferenceTheme">@style/Theme.Aegis.Preference.Dark</item>
        <item name="textInputStyle">@style/Widget.Aegis.TextInput.Dark</item>
        <item name="introButtonStyle">@style/Widget.Aegis.OutlinedButton.Dark</item>
        <item name="dropdownStyle">@style/Widget.Aegis.Dropdown.Dark</item>
        <item name="bottomSheetDialogTheme">@style/ThemeOverLay.Aegis.BottomSheetDialog.Rounded</item>

        <item name="windowActionModeOverlay">true</item>
        <item name="android:statusBarColor">@color/background_true_dark</item>
        <item name="android:windowBackground">@color/background_true_dark</item>
        <item name="android:colorBackground">@color/background_true_dark</item>
        <item name="android:colorEdgeEffect">@color/background_true_dark</item>
    </style>

    <style name="Theme.Aegis.TrueDark.Default" />
    <style name="Theme.Aegis.TrueDark.NoActionBar">
        <item name="android:statusBarColor">?attr/background</item>
        <item name="android:navigationBarColor">?attr/background</item>
    </style>

    <style name="Theme.Aegis.TrueDark.Fullscreen" parent="Theme.Aegis.TrueDark.Default">
        <item name="android:windowNoTitle">true</item>
        <item name="android:windowFullscreen">true</item>
    </style>

    <style name="Theme.Aegis.Preference.Light" parent="@style/PreferenceThemeOverlay.v14.Material">
        <item name="android:tint">@color/icon_primary</item>
    </style>

    <style name="Theme.Aegis.Preference.Dark" parent="@style/PreferenceThemeOverlay.v14.Material">
        <item name="android:tint">@color/icon_primary_dark</item>
    </style>

    <style name="Theme.Aegis.ActionMode.Light" parent="@style/Widget.AppCompat.Light.ActionMode.Inverse">
        <item name="background">@color/colorPrimary</item>
        <item name="titleTextStyle">@style/Theme.Aegis.ActionMode.Title</item>
        <item name="iconColorPrimary">@color/icon_primary</item>
        <item name="iconColorInverted">@color/icon_primary_inverted</item>
    </style>

    <style name="Theme.Aegis.ActionMode.Dark" parent="@style/Widget.AppCompat.Light.ActionMode.Inverse">
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="background">@color/colorPrimary</item>
        <item name="titleTextStyle">@style/Theme.Aegis.ActionMode.Title</item>
        <item name="iconColorPrimary">@color/icon_primary</item>
        <item name="iconColorInverted">@color/icon_primary_inverted</item>
    </style>

    <style name="Theme.Aegis.ActionMode.TrueDark" parent="@style/Widget.AppCompat.Light.ActionMode.Inverse">
        <item name="colorPrimary">@color/background_true_dark</item>
        <item name="background">@color/background_true_dark</item>
        <item name="titleTextStyle">@style/Theme.Aegis.ActionMode.Title</item>
        <item name="iconColorPrimary">@color/icon_primary</item>
        <item name="iconColorInverted">@color/icon_primary_inverted</item>
    </style>

    <style name="Theme.Aegis.ActionMode.Title" parent="@style/TextAppearance.AppCompat.Widget.ActionMode.Title">
        <item name="android:textColor">@android:color/white</item>
    </style>

    <style name="Theme.Aegis.Dialog.Light" parent="Theme.MaterialComponents.Light.Dialog.Alert">
        <item name="android:background">@color/card_background</item>
        <item name="colorSecondary">@color/colorSecondary</item>
        <item name="textColorAlertDialogListItem">@color/primary_text</item>

        <item name="buttonBarPositiveButtonStyle">@style/Widget.Aegis.DialogButton</item>
        <item name="buttonBarNegativeButtonStyle">@style/Widget.Aegis.DialogButton</item>
        <item name="buttonBarNeutralButtonStyle">@style/Widget.Aegis.DialogButton</item>
    </style>

    <style name="Theme.Aegis.Dialog.Dark" parent="Theme.MaterialComponents.Dialog.Alert">
        <item name="android:background">@color/card_background_dark</item>
        <item name="colorSecondary">@color/colorSecondary</item>
        <item name="textColorAlertDialogListItem">@color/primary_text_dark</item>

        <item name="buttonBarPositiveButtonStyle">@style/Widget.Aegis.DialogButton</item>
        <item name="buttonBarNegativeButtonStyle">@style/Widget.Aegis.DialogButton</item>
        <item name="buttonBarNeutralButtonStyle">@style/Widget.Aegis.DialogButton</item>

        <!--The following lines are needed because the non-light version of this parent changes the
        min width to 80% or something. Looks weird.-->
        <item name="android:windowMinWidthMajor">97%</item>
        <item name="android:windowMinWidthMinor">97%</item>
    </style>

    <style name="Theme.Aegis.Dialog.TrueDark" parent="Theme.Aegis.Dialog.Dark">
        <item name="android:background">@color/card_background_focused_true_dark</item>
    </style>

    <style name="ThemeOverlay.Aegis.AppBar" parent="ThemeOverlay.MaterialComponents.Dark.ActionBar">
        <item name="android:tint">@color/icon_primary_inverted</item>
    </style>

    <style name="ThemeOverlay.Aegis.Popup.Light" parent="ThemeOverlay.MaterialComponents.Light">
        <item name="android:tint">@color/icon_primary</item>
    </style>

    <style name="ThemeOverLay.Aegis.BottomSheetDialog.Rounded" parent="@style/ThemeOverlay.MaterialComponents.BottomSheetDialog">
        <item name="android:windowIsFloating">false</item>
        <item name="bottomSheetStyle">@style/Widget.Aegis.BottomSheet.Rounded</item>
    </style>

    <style name="Widget.Aegis.Dropdown.Light" parent="Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense.ExposedDropdownMenu"/>
    <style name="Widget.Aegis.Dropdown.Dark" parent="Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense.ExposedDropdownMenu">
        <item name="boxStrokeColor">@color/text_input_box_stroke_dark</item>
        <item name="hintTextColor">@color/text_input_box_stroke_dark</item>
        <item name="endIconTint">@color/text_input_box_icon_dark</item>
    </style>

    <style name="Widget.Aegis.TextInput.Light" parent="Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"/>
    <style name="Widget.Aegis.TextInput.Dark" parent="Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense">
        <item name="boxStrokeColor">@color/text_input_box_stroke_dark</item>
        <item name="hintTextColor">@color/text_input_box_stroke_dark</item>
    </style>

    <style name="Widget.Aegis.DialogButton" parent="Widget.MaterialComponents.Button.TextButton.Dialog">
        <item name="rippleColor">@color/colorSecondary</item>
        <item name="android:textColor">@color/dialog_button_color</item>
    </style>

    <style name="Widget.Aegis.OutlinedButton.Light" parent="Widget.MaterialComponents.Button.OutlinedButton"/>
    <style name="Widget.Aegis.OutlinedButton.Dark" parent="Widget.MaterialComponents.Button.OutlinedButton">
        <item name="android:textColor">@color/secondary_text</item>
        <item name="rippleColor">@color/secondary_text</item>
    </style>

    <style name="Widget.Aegis.BottomSheet.Rounded" parent="Widget.MaterialComponents.BottomSheet">
        <item name="shapeAppearanceOverlay">@style/ShapeAppearanceOverlay.Aegis.BottomSheetDialog.Rounded</item>
        <item name="android:background">@android:color/transparent</item>
    </style>

    <style name="TextAppearance.Aegis.ActionChip" parent="TextAppearance.MaterialComponents.Chip">
        <item name="android:textSize">12sp</item>
    </style>

    <style name="ShapeAppearanceOverlay.Aegis.BottomSheetDialog.Rounded" parent="">
        <item name="cornerFamily">rounded</item>
        <item name="cornerSizeTopRight">10dp</item>
        <item name="cornerSizeTopLeft">10dp</item>
        <item name="cornerSizeBottomRight">0dp</item>
        <item name="cornerSizeBottomLeft">0dp</item>
    </style>
</resources>
