<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="AppTheme" parent="Theme.AppCompat"></style>
    
    <style name="ActionBar.Style" parent="@style/Widget.AppCompat.ActionBar.Solid">
	    <item name="background">@color/bar_overlay</item>
	    <item name="backgroundStacked">@color/bar_overlay</item>
        <item name="actionBarPopupTheme">@style/ToolbarPopupStyle</item>
	</style>
    
    <style name="ToolbarPopupStyle" parent="Theme.AppCompat">
        <!-- Padding around icons in toolbar popup menu, i.e. component target selection. -->
        <!-- I don't think this actually works the way it is supposed to, but it does
             make the spacing look correct by accident. -->
        <!-- Unfortunately, this also affects the regular action overflow menu. -->
        <item name="android:layout_marginStart">4dp</item>
    </style>
    
    <style name="FullscreenTheme" parent="Theme.AppCompat.NoActionBar">
        <item name="android:actionBarStyle">@style/FullscreenActionBarStyle</item>
        <item name="android:windowActionBarOverlay">false</item>
        <item name="android:windowBackground">@color/activity_background</item>
        <item name="buttonBarStyle">?android:attr/buttonBarStyle</item>
        <item name="buttonBarButtonStyle">?android:attr/buttonBarButtonStyle</item>
        <item name="colorPrimary">@color/bar_overlay</item>
        <item name="android:windowNoTitle">true</item>
        <item name="android:windowActionBar">false</item>
        <item name="windowActionModeOverlay">true</item>
        <item name="alertDialogTheme">@style/Theme.AppCompat.Dialog.Alert</item>
    </style>
    
    <style name="FullscreenActionBarStyle" parent="Widget.AppCompat.ActionBar">
        <item name="android:background">@color/bar_overlay</item>
        <item name="background">@color/bar_overlay</item>
        <item name="backgroundStacked">@color/bar_overlay</item>
    </style>
    
    <style name="PreferencesTheme" parent="Theme.AppCompat.NoActionBar" >
        <item name="android:actionBarStyle">@style/PreferencesActionBarStyle</item>
        <item name="android:windowBackground">@color/activity_background</item>
        <item name="colorPrimary">@color/bar_overlay</item>
        <item name="android:windowNoTitle">true</item>
        <item name="android:windowActionBar">false</item>
        <item name="windowActionModeOverlay">true</item>
        <item name="preferenceTheme">@style/CustomPreferenceThemeOverlay</item>
    </style>
    
    <style name="PreferencesActionBarStyle" parent="android:style/Widget.Holo.ActionBar">
        <item name="android:background">@color/bar_overlay</item>
        <item name="android:displayOptions">showHome|homeAsUp|showTitle</item>
        <item name="colorPrimary">@color/bar_overlay</item>
    </style>
    
    <style name="CustomPreferenceThemeOverlay" parent="PreferenceThemeOverlay">
        <!-- remove dividers -->
        <item name="preferenceFragmentStyle">@style/CustomPreferenceFragment</item>
        <item name="preferenceFragmentCompatStyle">@style/CustomPreferenceFragment</item>
    </style>
    
    <style name="CustomPreferenceFragment" parent="PreferenceFragment.Material">
        <item name="android:divider">@null</item>
    </style>
    
    <!-- http://stackoverflow.com/a/31309996 -->
    <style name="CodeTabStrip" parent="Widget.Design.TabLayout">
        <item name="tabTextAppearance">@style/CodeTabStripTextAppearance</item>
    </style>
    
    <!-- http://stackoverflow.com/a/31309996 -->
    <style name="CodeTabStripTextAppearance" parent="TextAppearance.Design.Tab">
        <item name="android:textAllCaps">false</item>
        <item name="textAllCaps">false</item>
    </style>
</resources>