<?xml version="1.0" encoding="utf-8"?><!--
  ownCloud Android client application

  Copyright (C) 2012  Bartek Przybylski
  Copyright (C) 2020 ownCloud GmbH.

  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License version 2,
  as published by the Free Software Foundation.

  This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
-->
<resources xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android">

    <style name="Animations" />

    <!-- THEMES: styles for whole APP or individual ACTIVITIES -->

    <!-- General ownCloud app style.
         To apply directly only on Activities that cannot extend ToolbarActivity;
         otherwise, prefer Theme.ownCloud.Toolbar -->
    <style name="Theme.ownCloud" parent="Theme.AppCompat.Light.DarkActionBar">
        <item name="android:windowBackground">@color/background_color</item>

        <!-- theme for the app bar (both for old actionbar and new toolbar) -->
        <item name="actionBarTheme">@style/ownCloud.Appbar</item>

        <!-- properties for action mode -->
        <item name="windowActionModeOverlay">true</item>
        <item name="actionModeBackground">@color/action_mode_background</item>

        <!-- colors, Material Design way -->
        <item name="colorPrimary">@color/primary</item>
        <item name="colorPrimaryDark">@color/actionbar_start_color</item>
        <item name="colorAccent">@color/color_accent</item>

        <!-- default theme for alert dialogs -->
        <item name="alertDialogTheme">@style/Theme.ownCloud.AlertDialog</item>

        <!-- style for search view -->
        <item name="searchViewStyle">@style/ownCloud.SearchView</item>
        <item name="android:windowOptOutEdgeToEdgeEnforcement" tools:targetApi="35">true</item>
    </style>

    <!-- Splash Screen -->
    <style name="Theme.ownCloud.Splash">
        <item name="android:windowBackground">@drawable/splash_screen</item>
        <item name="android:windowOptOutEdgeToEdgeEnforcement" tools:targetApi="35">true</item>
    </style>

    <!-- Extends Theme.ownCloud to remove legacy ActionBar from the window and add, via layouts, a Toolbar -->
    <style name="Theme.ownCloud.Toolbar">
        <item name="windowNoTitle">true</item>
        <item name="windowActionBar">false</item>
        <!-- (status/nav)BarColor are set by the Activity, not the system -->
        <item name="android:windowDrawsSystemBarBackgrounds">true</item>
        <item name="android:windowOptOutEdgeToEdgeEnforcement" tools:targetApi="35">true</item>
    </style>

    <!-- Extends Theme.ownCloud.Toolbar for Drawer activities including Drawer -->
    <style name="Theme.ownCloud.Toolbar.Drawer">
        <item name="android:statusBarColor">@android:color/transparent</item>
        <item name="android:windowAnimationStyle">@null</item>
        <item name="android:windowOptOutEdgeToEdgeEnforcement" tools:targetApi="35">true</item>
    </style>

    <!-- Extends Theme.ownCloud to make LEGACY ActionBar both OVERLAY and TRANSPARENT -->
    <style name="Theme.ownCloud.Overlay">
        <item name="windowActionBarOverlay">true</item>
        <item name="actionBarTheme">@style/ownCloud.Appbar.Transparent</item>
        <item name="android:windowOptOutEdgeToEdgeEnforcement" tools:targetApi="35">true</item>
    </style>

    <!-- Extends Theme.ownCloud for video in full screen mode -->
    <style name="Theme.ownCloud.Video">
        <item name="windowActionBarOverlay">true</item>
        <item name="android:windowLayoutInDisplayCutoutMode">never</item>
        <item name="actionBarTheme">@style/ownCloud.Appbar.Transparent</item>
        <item name="android:windowBackground">@android:color/background_dark</item>
        <item name="android:windowOptOutEdgeToEdgeEnforcement" tools:targetApi="35">true</item>
    </style>

    <!-- DIALOG THEMES: styles for DIALOGs -->

    <!-- DEFAULT (via Theme.ownCloud), and explicitly used ONCE, in Preference "behaviour" for instant uploads - NO MORE, not needed, it's default -->
    <style name="Theme.ownCloud.AlertDialog" parent="Theme.AppCompat.Light.Dialog.Alert">
        <item name="colorAccent">@color/color_accent</item>
        <item name="android:textColorPrimary">@color/primary</item>
        <item name="searchViewStyle">@style/ownCloud.SearchView</item>
        <item name="buttonBarButtonStyle">@style/Theme.ownCloud.Dialog.ButtonBar.Button</item>
        <item name="buttonBarStyle">@style/Theme.ownCloud.Dialog.ButtonBar</item>
        <item name="android:windowOptOutEdgeToEdgeEnforcement" tools:targetApi="35">true</item>
    </style>

    <!-- USED IN SHAREACTIVITY!! !! -->
    <style name="Theme.ownCloud.AlertDialog.NoTitle">
        <item name="windowNoTitle">true</item>
        <item name="android:windowOptOutEdgeToEdgeEnforcement" tools:targetApi="35">true</item>
    </style>

    <!-- APP BAR styles -->

    <!-- Regular style for the app bar (both for old actionbar and new toolbar);
         overrides colorPrimary to allow customization of the app bar color,
         independent of Material Design guidelines, if desired
    -->
    <style name="ownCloud.Appbar" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
        <item name="colorPrimary">@color/actionbar_start_color</item>
        <item name="toolbarNavigationButtonStyle">@style/Toolbar.Button.Navigation.Tinted</item>
        <item name="android:windowOptOutEdgeToEdgeEnforcement" tools:targetApi="35">true</item>
    </style>

    <style name="Toolbar.Button.Navigation.Tinted" parent="Widget.AppCompat.Toolbar.Button.Navigation">
        <item name="tint">@color/white</item>
    </style>

    <!-- Transparent style for the app bar -->
    <style name="ownCloud.Appbar.Transparent" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
        <item name="colorPrimary">@color/owncloud_blue_transparent</item>
        <item name="android:windowOptOutEdgeToEdgeEnforcement" tools:targetApi="35">true</item>
    </style>

    <!-- MORE styles -->

    <style name="ownCloud.SearchView" parent="Widget.AppCompat.SearchView">
        <!-- Close button icon -->
        <item name="closeIcon">@drawable/ic_close</item>
        <!-- Search button icon -->
        <item name="searchIcon">@drawable/ic_search</item>
        <!-- Layout for query suggestion rows -->
        <item name="suggestionRowLayout">@layout/search_suggestion_row</item>>
    </style>

    <style name="Button.Secondary" parent="Widget.AppCompat.Button.Colored">
        <item name="colorButtonNormal">@color/secondary_button_background_color</item>
        <item name="colorAccent">@color/secondary_button_background_color</item>
        <item name="android:textColor">@color/secondary_button_text_color</item>
    </style>

    <style name="Button.Primary" parent="Widget.AppCompat.Button.Colored">
        <item name="colorButtonNormal">@color/primary_button_background_color</item>
        <item name="colorAccent">@color/primary_button_background_color</item>
        <item name="android:textColor">@color/primary_button_text_color</item>
    </style>

    <style name="Button.Borderless" parent="Widget.AppCompat.Button.Borderless">
        <item name="android:textColor">@color/color_accent</item>
    </style>

    <!-- Style for top progress bar -->
    <style name="Widget.ownCloud.TopProgressBar" parent="@style/Widget.AppCompat.ProgressBar.Horizontal">
        <!-- for a custom color independent of @color/primary,
        change value of actionbar_start_color in setup.xml, don't modify here -->
        <item name="android:background">@color/actionbar_start_color</item>
        <item name="android:progressDrawable">@drawable/top_progress_bar_determinate</item>
        <item name="android:indeterminateDrawable">@drawable/top_progress_bar_indeterminate</item>
    </style>

    <!-- Dialogs -->
    <style name="menu_labels_style">
        <item name="android:background">@drawable/fab_label_background</item>
        <item name="android:textColor">@color/fab_white</item>
    </style>

    <style name="NavigationView_ItemTextAppearance">
        <item name="android:ellipsize">end</item>
        <item name="android:listDivider">@color/grey</item>
    </style>

    <!-- Button Bar hack due to Lollipop bug:
        https://code.google.com/p/android/issues/detail?id=78302
    fix see:
        http://stackoverflow.com/questions/27187353/dialog-buttons-with-long-text-not-wrapping-squeezed-out-material-theme-on-an
     -->
    <style name="Theme.ownCloud.Dialog.ButtonBar" parent="@style/Widget.AppCompat.ButtonBar.AlertDialog">
        <!-- Making sure, the button bar uses parent width and is not restricted in height -->
        <item name="android:layout_width">match_parent</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:height">@null</item>
        <item name="android:minHeight">@null</item>
    </style>

    <style name="Theme.ownCloud.Dialog.ButtonBar.Button" parent="@style/Widget.AppCompat.Button.Borderless.Colored">
        <!-- Setting the weight as follows should result in equally wide buttons filling the alert dialog width,
            but instead they span further out of the dialog, breaking in multiple lines though -->
        <item name="android:layout_width">0dp</item>
        <item name="android:layout_weight">1</item>
        <!-- setting a fixed width as follows results in narrow buttons with line breaks, but of course this is not a solution -->
        <!-- <item name="android:width">100dp</item> -->
    </style>

    <!-- PopDownMenu -->
    <style name="Animations.PopDownMenu" />

    <style name="Animations.PopDownMenu.Center">
        <item name="android:windowEnterAnimation">@anim/grow_from_top</item>
        <item name="android:windowExitAnimation">@anim/shrink_from_bottom</item>
    </style>

    <style name="Animations.PopDownMenu.Left">
        <item name="android:windowEnterAnimation">@anim/grow_from_topleft_to_bottomright</item>
        <item name="android:windowExitAnimation">@anim/shrink_from_bottomright_to_topleft</item>
    </style>

    <style name="Animations.PopDownMenu.Right">
        <item name="android:windowEnterAnimation">@anim/grow_from_topright_to_bottomleft</item>
        <item name="android:windowExitAnimation">@anim/shrink_from_bottomleft_to_topright</item>
    </style>

    <style name="Animations.PopDownMenu.Reflect">
        <item name="android:windowEnterAnimation">@anim/pump_top</item>
        <item name="android:windowExitAnimation">@anim/disappear</item>
    </style>

    <!-- PopUpMenu -->
    <style name="Animations.PopUpMenu" />

    <style name="Animations.PopUpMenu.Center">
        <item name="android:windowEnterAnimation">@anim/grow_from_bottom</item>
        <item name="android:windowExitAnimation">@anim/shrink_from_top</item>
    </style>

    <style name="Animations.PopUpMenu.Left">
        <item name="android:windowEnterAnimation">@anim/grow_from_bottomleft_to_topright</item>
        <item name="android:windowExitAnimation">@anim/shrink_from_topright_to_bottomleft</item>
    </style>

    <style name="Animations.PopUpMenu.Right">
        <item name="android:windowEnterAnimation">@anim/grow_from_bottomright_to_topleft</item>
        <item name="android:windowExitAnimation">@anim/shrink_from_topleft_to_bottomright</item>
    </style>

    <style name="Animations.PopUpMenu.Reflect">
        <item name="android:windowEnterAnimation">@anim/pump_bottom</item>
        <item name="android:windowExitAnimation">@anim/disappear</item>
    </style>

    <style name="PassCodeStyle">
        <item name="android:layout_width">50dp</item>
        <item name="android:layout_height">50dp</item>
        <item name="android:gravity">center</item>
        <item name="android:layout_margin">10dp</item>
        <item name="android:inputType">numberDecimal</item>
        <item name="android:numeric">decimal</item>
        <item name="android:digits">1234567890</item>
        <item name="android:maxLength">1</item>
        <item name="android:password">true</item>
        <item name="android:singleLine">true</item>
    </style>

    <style name="numberkeyboard_key">
        <item name="android:layout_width">match_parent</item>
        <item name="android:layout_height">match_parent</item>
        <item name="android:layout_gravity">center</item>
        <item name="android:gravity">center</item>
        <item name="android:clickable">true</item>
        <item name="android:layout_margin">@dimen/passcode_margin_buttons</item>
        <item name="android:background">@drawable/numberkeyboard_key_bg</item>
        <item name="android:padding">16dp</item>
        <item name="android:drawablePadding">-16dp</item>
        <item name="android:includeFontPadding">false</item>
        <item name="android:lineSpacingExtra">0dp</item>
        <item name="autoSizeTextType">uniform</item>
    </style>

    <style name="numberkeyboard_keyContainer">
        <item name="android:layout_width">0dp</item>
        <item name="android:layout_height">0dp</item>
    </style>

    <!-- Notifications -->
    <style name="Theme.ownCloud.NotificationText.Title" parent="@android:style/TextAppearance.StatusBar.EventContent.Title">
        <item name="android:textSize">18sp</item>
        <item name="android:textStyle">bold</item>
    </style>

    <style name="Theme.ownCloud.NotificationText.Content" parent="@android:style/TextAppearance.StatusBar.EventContent">
        <item name="android:textSize">16sp</item>
    </style>

    <!-- Authenticator Activity -->
    <style name="Theme.ownCloud.Authenticator" parent="Theme.ownCloud">
        <!-- properties for action mode -->
        <item name="windowActionModeOverlay">true</item>
        <item name="actionModeBackground">@color/action_mode_background</item>
        <item name="android:windowOptOutEdgeToEdgeEnforcement" tools:targetApi="35">true</item>
    </style>

    <style name="Button.Authenticator" parent="Widget.AppCompat.Button.Colored">
        <item name="colorButtonNormal">@color/login_button_background_color</item>
        <item name="colorAccent">@color/login_button_background_color</item>
        <item name="android:textColor">@color/login_button_text_color</item>
    </style>

    <style name="EditText.Authenticator" parent="Widget.AppCompat.EditText">
        <item name="android:textColor">@color/login_text_color</item>
        <item name="android:textColorHint">@color/login_text_hint_color</item>
    </style>

    <style name="Theme.ownCloud.Authenticator.EditText" parent="Theme.ownCloud.Authenticator">
        <item name="colorControlNormal">@color/login_text_color</item>
        <item name="colorControlActivated">@color/login_text_color</item>
        <item name="android:windowOptOutEdgeToEdgeEnforcement" tools:targetApi="35">true</item>
    </style>

    <!-- SortBottomSheetFragment -->
    <style name="Theme.ownCloud.SortBottomSheetFragment" />

    <style name="Theme.ownCloud.SortBottomSheetFragment.Item">
        <item name="android:textAppearance">@style/TextAppearance.OwnCloud.SortBottomSheetFragment.Item</item>
        <item name="android:windowOptOutEdgeToEdgeEnforcement" tools:targetApi="35">true</item>
    </style>
</resources>
