<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2015 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License
  -->

<resources>

    <!--
      ~ This theme should have been named SettingsBase, but it is exposed as overlayable to OEMs and
      ~ cannot be renamed now.
      -->
    <style name="Settings" parent="Theme.SubSettingsBase">
        <item name="preferenceCategoryTitleTextAppearance">@style/TextAppearance.CategoryTitle</item>
    </style>

    <!-- This theme should contain attributes that should always be set despite OEM overlays. -->
    <style name="Theme.PermissionController.Settings" parent="Settings">
        <!-- These two attributes are required when using Toolbar as ActionBar. -->
        <item name="android:windowActionBar">false</item>
        <item name="android:windowNoTitle">true</item>
    </style>

    <style name="TextAppearance.CategoryTitle"
           parent="@android:style/TextAppearance.DeviceDefault.Medium">
        <item name="android:textAllCaps">true</item>
        <item name="android:textSize">11sp</item>
        <!-- 0.8 Spacing, 0.8/11 = 0.072727273 -->
        <item name="android:letterSpacing">0.072727273</item>
    </style>

    <style name="ReviewPermissions"
           parent="@android:style/Theme.DeviceDefault.Settings">
        <item name="android:windowActionBar">false</item>
        <item name="android:windowNoTitle">true</item>
        <item name="android:switchStyle">@style/PermissionReviewSwitchStyle</item>
        <item name="preferenceTheme">@style/PreferenceThemeOverlay</item>
    </style>

    <style name="GrantPermissions"
           parent="@android:style/Theme.DeviceDefault.Light.Dialog.Alert">
        <item name="android:windowNoTitle">true</item>
        <item name="android:windowBackground">@android:color/transparent</item>
        <!-- The following attributes change the behavior of the dialog, hence they should not be
             themed -->
        <item name="android:windowIsTranslucent">true</item>
    </style>

    <style name="GrantPermissions.Car" parent="Theme.CarUi.NoToolbar">
        <item name="android:windowNoTitle">true</item>
        <item name="android:windowBackground">@android:color/transparent</item>
        <!-- The following attributes change the behavior of the dialog, hence they should not be
             themed -->
        <item name="android:windowIsTranslucent">true</item>
    </style>

    <!-- Unused since R but exposed as overlayable. -->
    <style name="Header.Settings"
            parent="@android:style/Theme.DeviceDefault.Settings">
    </style>

    <style name="RequestRole" parent="android:Theme.DeviceDefault.Settings">
        <item name="android:colorBackgroundCacheHint">@null</item>
        <item name="android:navigationBarColor">@android:color/transparent</item>
        <item name="android:navigationBarDividerColor">@null</item>
        <item name="android:statusBarColor">@android:color/transparent</item>
        <item name="android:windowActionBar">false</item>
        <item name="android:windowAnimationStyle">@null</item>
        <item name="android:windowBackground">@android:color/transparent</item>
        <item name="android:windowContentOverlay">@null</item>
        <item name="android:windowDisablePreview">true</item>
        <item name="android:windowIsTranslucent">true</item>
        <item name="android:windowLightNavigationBar">false</item>
        <item name="android:windowLightStatusBar">false</item>
        <item name="android:windowNoTitle">true</item>
    </style>

    <style name="Theme.PermissionGrantDialog"
           parent="@android:style/Theme.DeviceDefault.Light.Dialog">
        <item name="android:divider">@drawable/list_divider</item>
    </style>

    <style name="PermissionDialog"
           parent="@android:style/Theme.DeviceDefault.Light.Dialog.NoActionBar">
    </style>

    <style name="CarSettings" parent="Theme.CarUi.WithToolbar">
        <item name="carDividerColor">@color/car_divider_color</item>
    </style>

    <style name="PreferenceDivider" parent="AutoRevokeDivider" />

    <style name="AutoRevokeDivider">
        <item name="android:background">@color/divider_color_primary</item>
    </style>

    <style name="Theme.DeviceDefault.Dialog.NoActionBar.DayNight" parent="@android:style/Theme.DeviceDefault.Light.Dialog.NoActionBar" />

    <!--
        TODO(b/309578419): Make activities handle insets properly and then remove this.
    -->
    <style name="OptOutEdgeToEdgeEnforcement" />


<!-- Do not allow OEMs to overlay these themes.
 Must Guarantee that filterTouches is set for these activities -->
    <style name="FilterTouches">
        <item name="android:filterTouchesWhenObscured">true</item>
    </style>

    <style name="Theme.PermissionController.Settings.FilterTouches">
        <item name="android:filterTouchesWhenObscured">true</item>
    </style>

    <style name="ReviewPermissions.FilterTouches">
        <item name="android:filterTouchesWhenObscured">true</item>
    </style>

    <style name="GrantPermissions.FilterTouches">
        <item name="android:filterTouchesWhenObscured">true</item>
    </style>

    <style name="GrantPermissions.Car.FilterTouches">
        <item name="android:filterTouchesWhenObscured">true</item>
    </style>

    <style name="RequestRole.FilterTouches">
        <item name="android:filterTouchesWhenObscured">true</item>
    </style>

    <style name="PermissionDialog.FilterTouches">
        <item name="android:filterTouchesWhenObscured">true</item>
    </style>

    <style name="Theme.EnhancedConfirmationDialog.FilterTouches" parent="Theme.EnhancedConfirmationDialog">
        <item name="android:filterTouchesWhenObscured">true</item>
    </style>

    <style name="Theme.PermissionController.IncidentReportDialog"
        parent="@style/Theme.DeviceDefault.Dialog.NoActionBar.DayNight" />

    <!-- START ENHANCED CONFIRMATION DIALOG -->

    <style name="Theme.EnhancedConfirmationDialog" parent="@android:style/Theme.DeviceDefault.Dialog.NoActionBar">
        <item name="windowNoTitle">true</item>
        <item name="android:alertDialogTheme">@style/Theme.EnhancedConfirmationDialogFragment</item>
        <item name="android:buttonBarStyle">@style/EnhancedConfirmationDialogButtonBar</item>
        <item name="android:buttonBarPositiveButtonStyle">@style/EnhancedConfirmationDialogButton</item>
        <item name="android:buttonBarNegativeButtonStyle">@style/EnhancedConfirmationDialogButton</item>
        <item name="android:buttonBarNeutralButtonStyle">@style/EnhancedConfirmationDialogButton</item>
    </style>

    <style name="Theme.EnhancedConfirmationDialogFragment" parent="@android:style/Theme.DeviceDefault.Dialog.Alert">
        <item name="android:buttonBarStyle">@style/EnhancedConfirmationDialogButtonBar</item>
    </style>

    <!-- END ENHANCED CONFIRMATION DIALOG -->
</resources>
