<?xml version="1.0" encoding="utf-8"?>
<!--
   Copyright 2015 Synced Synapse. All rights reserved.

   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
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">

    <!-- Text Appearance styles only -->
    <style name="TextAppearance.Kore.NavDrawerItem" parent="TextAppearance.Material3.LabelLarge" />

    <style name="TextAppearance.Kore.Title" parent="TextAppearance.Material3.TitleLarge" />

    <style name="TextAppearance.Kore.Title.Small" parent="TextAppearance.Material3.TitleMedium" />

    <style name="TextAppearance.Kore.Body" parent="TextAppearance.Material3.BodyMedium" />

    <style name="TextAppearance.Kore.NowPlaying.Title" parent="@style/TextAppearance.Material3.TitleMedium" />

    <style name="TextAppearance.Kore.NowPlaying.Details" parent="@style/TextAppearance.Material3.BodyMedium" />

    <style name="TextAppearance.Kore.TabLayout" parent="TextAppearance.Material3.LabelLarge">
        <!--        <item name="android:textSize">16sp</item>-->
    </style>

    <!-- For use in TextAppearanceSpan in code -->
    <style name="TextAppearanceSpanBold">
        <item name="android:textStyle">bold</item>
    </style>
    <style name="TextAppearanceSpanItalic">
        <item name="android:textStyle">italic</item>
    </style>

    <!-- Widget styles -->
    <style name="Widget.Kore" parent="android:Widget"/>

    <!-- Toolbar -->
    <style name="Widget.Kore.Toolbar" parent="Widget.Material3.Toolbar.Surface">
        <item name="android:elevation">@dimen/kore_elevation_level2</item>
        <item name="android:background">@android:color/transparent</item>
    </style>

    <style name="Widget.Kore.DrawerArrowToggle" parent="Widget.AppCompat.DrawerArrowToggle">
        <item name="spinBars">true</item>
        <item name="color">?attr/colorOnSurfaceVariant</item>
    </style>

    <!--
    Inheriting from Material3.Button makes buttons that are used on CardView lists highjack the onClick event, so they
    can't be used selected (see Host lists for instance). Furthermore they throws a lot of warning in LogCat regarding:
    ResourcesCompat: Failed to inflate ColorStateList, leaving it to the framework
    -->
<!--    <style name="Widget.Kore.Button.Borderless" parent="Widget.Material3.Button.TextButton">-->
    <style name="Widget.Kore.Button.Borderless" parent="Widget.Kore">
        <item name="android:background">?android:attr/selectableItemBackgroundBorderless</item>
        <item name="android:tint">?attr/colorOnSurfaceVariant</item>
    </style>

    <style name="Widget.Kore.Button.InfoAction" parent="@style/Widget.Material3.Button.TextButton.Icon">
        <item name="android:checkable">true</item>
        <item name="backgroundTint">@color/info_action_button_background_selector</item>
        <item name="iconGravity">textTop</item>
        <item name="iconSize">@dimen/small_icon_size</item>
        <item name="iconPadding">@dimen/default_icon_padding</item>
        <item name="iconTint">@color/info_action_button_foreground_selector</item>
        <item name="android:textColor">@color/info_action_button_foreground_selector</item>
        <item name="android:maxLines">1</item>
        <item name="android:ellipsize">marquee</item>
    </style>

    <style name="Widget.Kore.Grid" parent="Widget.Kore">
        <item name="android:columnWidth">@dimen/default_grid_column_width</item>
        <item name="android:numColumns">auto_fit</item>
        <item name="android:stretchMode">columnWidth</item>
    </style>

    <style name="Widget.Kore.Grid.Host" parent="Widget.Kore.Grid">
        <item name="android:fastScrollEnabled">true</item>
    </style>

    <style name="Widget.Kore.Grid.Media" parent="Widget.Kore.Grid">
        <item name="fastScrollPopupBgColor">?attr/colorOnSurfaceVariant</item>
        <item name="fastScrollPopupTextColor">?attr/colorSurfaceVariant</item>
        <item name="fastScrollPopupTextSize">@dimen/fastscroll_text_size</item>
        <item name="fastScrollPopupBackgroundSize">@dimen/fastscroll_popup_size</item>
        <item name="fastScrollThumbColor">?attr/colorOnSurfaceVariant</item>
        <item name="fastScrollThumbInactiveColor">?attr/colorSurfaceVariant</item>
        <item name="fastScrollPopupPosition">adjacent</item>
    </style>

    <style name="Widget.Kore.ListItem" parent="Widget.Kore">
        <item name="android:foreground">?attr/selectableItemBackground</item>
        <item name="android:paddingTop">@dimen/small_padding</item>
        <item name="android:paddingBottom">@dimen/small_padding</item>
        <item name="android:paddingStart">@dimen/small_padding</item>
        <item name="android:paddingEnd">@dimen/small_padding</item>
    </style>

    <style name="Widget.Kore.PagerIndicator">
        <item name="fillColor">?attr/colorPrimary</item>
        <item name="strokeColor">?attr/colorPrimary</item>
        <item name="pageColor">?attr/colorSurfaceVariant</item>
        <item name="strokeWidth">0dp</item>
        <item name="radius">3dp</item>
        <item name="centered">true</item>
        <item name="circleGapWidth">6dp</item>
    </style>

    <style name="Widget.Kore.InfoPanel" parent="Widget.Kore">
        <item name="android:background">@drawable/background_round_bottom_alpha</item>
        <item name="android:backgroundTint">?attr/colorSurfaceVariant</item>
        <item name="android:elevation">@dimen/kore_elevation_level1</item>
    </style>

    <style name="Widget.Kore.InfoPanel.Remote" parent="Widget.Kore.InfoPanel">
        <item name="android:background">@drawable/background_round_alpha</item>
    </style>

    <style name="Widget.Kore.BottomPanel" parent="Widget.Material3.BottomSheet">
        <item name="android:background">?attr/colorSurface</item>
<!--        <item name="android:backgroundTint">?attr/colorSurfaceVariant</item>-->
        <item name="android:elevation">@dimen/kore_elevation_level3</item>
    </style>

    <style name="Widget.Kore.RatingBar" parent="Widget.Kore">
        <item name="backgroundColor">?attr/colorSurfaceVariant</item>
        <item name="foregroundColor">?attr/colorOnSurfaceVariant</item>
        <item name="icon">@drawable/ic_round_star_rate_24</item>
    </style>

    <style name="Widget.Kore.ControlPad" parent="Widget.Kore">
        <item name="columnCount">3</item>
        <item name="android:background">@drawable/remote_background_square_black</item>
        <item name="android:backgroundTint">?attr/colorSurfaceVariant</item>
        <!-- Elevation doesn't take into account the outline of the png.
        Needed to implement a custom OutlineProvider for it to work -->
<!--        <item name="android:elevation">@dimen/kore_elevation_level1</item>-->
<!--        <item name="android:outlineProvider">background</item>-->
    </style>

    <style name="Widget.Kore.ControlPad.Button" parent="Widget.Kore">
        <item name="tint">?attr/colorOnSurfaceVariant</item>
    </style>

    <style name="Widget.Kore.Divider.InfoSections" parent="Widget.Kore">
<!--        <item name="dividerColor">?attr/colorOnSurfaceVariant</item>-->
        <item name="dividerInsetEnd">@dimen/default_padding</item>
        <item name="dividerInsetStart">@dimen/default_padding</item>
    </style>

    <style name="ShapeAppearanceOverlay.Kore.Image" parent="">
        <item name="cornerFamily">rounded</item>
    </style>

    <style name="ShapeAppearanceOverlay.Kore.Image.List" parent="ShapeAppearanceOverlay.Kore.Image">
        <item name="cornerSize">@dimen/corner_radius_image_list</item>
    </style>

    <style name="ShapeAppearanceOverlay.Kore.Image.Poster" parent="ShapeAppearanceOverlay.Kore.Image">
        <item name="cornerSize">@dimen/corner_radius_image_poster</item>
    </style>

    <style name="ShapeAppearanceOverlay.Kore.Image.MediaArt" parent="ShapeAppearanceOverlay.Kore.Image">
        <item name="cornerSizeTopLeft">@dimen/corner_radius_image_poster</item>
        <item name="cornerSizeTopRight">@dimen/corner_radius_image_poster</item>
    </style>

    <style name="ShapeAppearanceOverlay.Kore.Image.PosterRemote" parent="ShapeAppearanceOverlay.Kore.Image">
        <item name="cornerSize">@dimen/corner_radius_image_poster</item>
<!--        <item name="cornerSizeTopLeft">@dimen/corner_radius_image_poster</item>-->
<!--        <item name="cornerSizeTopRight">0dp</item>-->
<!--        <item name="cornerSizeBottomRight">@dimen/corner_radius_image_poster</item>-->
<!--        <item name="cornerSizeBottomLeft">0dp</item>-->
    </style>

    <style name="ShapeAppearanceOverlay.Kore.Image.NowPlayingArt" parent="ShapeAppearanceOverlay.Kore.Image">
        <item name="cornerSizeTopLeft">@dimen/corner_radius_image_poster</item>
        <item name="cornerSizeTopRight">0dp</item>
        <item name="cornerSizeBottomRight">@dimen/corner_radius_image_poster</item>
        <item name="cornerSizeBottomLeft">0dp</item>
    </style>

    <!-- TextView widget styles, including more attributes than simply textAppearance -->
    <style name="Widget.Kore.TextView" parent="Widget.Kore">
        <item name="android:gravity">start</item>
        <item name="android:ellipsize">end</item>
    </style>

    <style name="Widget.Kore.TextView.WizardTitle" parent="Widget.Kore.TextView">
        <item name="android:textAppearance">@style/TextAppearance.Material3.HeadlineMedium</item>
        <item name="android:textColor">?attr/colorWizardTitleText</item>
        <item name="android:gravity">start|bottom</item>
        <item name="android:padding">@dimen/large_padding</item>
        <item name="android:maxLines">2</item>
    </style>

    <style name="Widget.Kore.TextView.WizardMessage" parent="Widget.Kore.TextView">
        <item name="android:textAppearance">@style/TextAppearance.Material3.BodyLarge</item>
        <item name="android:padding">@dimen/large_padding</item>
    </style>

    <style name="Widget.Kore.TextView.Edit" parent="Widget.Kore.TextView">
        <item name="android:textAppearance">@style/TextAppearance.Material3.BodyMedium</item>
        <item name="android:singleLine">true</item>
    </style>

    <style name="Widget.Kore.TextView.MediaTitle" parent="Widget.Kore.TextView">
        <item name="android:textAppearance">@style/TextAppearance.Material3.TitleMedium</item>
        <item name="android:textSize">20sp</item>
        <item name="android:paddingTop">@dimen/default_padding</item>
        <item name="android:paddingBottom">@dimen/small_padding</item>
        <item name="android:maxLines">2</item>
        <item name="android:ellipsize">marquee</item>
        <item name="android:marqueeRepeatLimit">marquee_forever</item>
        <item name="android:focusable">true</item>
        <item name="android:focusableInTouchMode">true</item>
        <item name="android:scrollHorizontally">true</item>
<!--        <item name="android:textColor">?attr/colorTertiary</item>-->
    </style>

    <style name="Widget.Kore.TextView.MediaDetails" parent="Widget.Kore.TextView">
        <item name="android:textAppearance">@style/TextAppearance.Material3.BodyLarge</item>
        <item name="android:textColor">?attr/colorOnSurfaceVariant</item>
        <item name="android:paddingTop">@dimen/small_padding</item>
        <item name="android:paddingBottom">@dimen/small_padding</item>
        <item name="android:maxLines">2</item>
    </style>

    <style name="Widget.Kore.TextView.MediaTitle.Remote" parent="Widget.Kore.TextView.MediaTitle">
        <item name="android:paddingStart">@dimen/default_padding</item>
        <item name="android:paddingEnd">@dimen/small_padding</item>
        <item name="android:paddingTop">@dimen/small_padding</item>
        <item name="android:paddingBottom">@dimen/small_padding</item>
        <item name="android:singleLine">true</item>
    </style>
    <style name="Widget.Kore.TextView.MediaDetails.Remote" parent="Widget.Kore.TextView.MediaDetails">
        <item name="android:paddingTop">0dp</item>
        <item name="android:paddingStart">@dimen/default_padding</item>
        <item name="android:paddingEnd">@dimen/small_padding</item>
        <item name="android:maxLines">1</item>
    </style>

    <style name="Widget.Kore.TextView.MediaSmallDetails" parent="Widget.Kore.TextView">
        <item name="android:textAppearance">@style/TextAppearance.Material3.BodySmall</item>
        <item name="android:textColor">?attr/colorOnSurfaceVariant</item>
    </style>

    <style name="Widget.Kore.TextView.MediaRating" parent="Widget.Kore.TextView">
        <item name="android:textAppearance">@style/TextAppearance.Material3.HeadlineSmall</item>
        <item name="android:gravity">center</item>
        <item name="android:singleLine">true</item>
    </style>

    <style name="Widget.Kore.TextView.MediaCast" parent="Widget.Kore.TextView">
        <item name="android:background">@drawable/background_square_alpha</item>
        <item name="android:backgroundTint">?attr/colorSurfaceVariant</item>
        <item name="android:textAppearance">@style/TextAppearance.Material3.LabelMedium</item>
        <item name="android:textColor">?attr/colorOnSurfaceVariant</item>
        <item name="android:paddingStart">@dimen/small_padding</item>
        <item name="android:paddingEnd">@dimen/small_padding</item>
        <item name="android:singleLine">true</item>
    </style>

    <style name="Widget.Kore.TextView.MediaInfo" parent="Widget.Kore.TextView">
        <item name="android:textAppearance">@style/TextAppearance.Material3.BodyMedium</item>
        <item name="android:paddingTop">@dimen/default_padding</item>
        <item name="android:paddingBottom">@dimen/default_padding</item>
    </style>

    <style name="Widget.Kore.TextView.SectionTitle" parent="Widget.Kore.TextView.MediaTitle">
        <item name="android:paddingTop">@dimen/small_padding</item>
        <item name="android:paddingStart">@dimen/small_padding</item>
        <item name="android:paddingEnd">@dimen/small_padding</item>
    </style>

    <style name="Widget.Kore.SeekBar" parent="Widget.Kore">
        <item name="android:progressTint">?attr/colorOnSurfaceVariant</item>
        <item name="android:thumbTint">?attr/colorOnSurfaceVariant</item>
    </style>

    <style name="Widget.Kore.TextView.SeekBar" parent="Widget.Kore.TextView">
        <item name="android:textAppearance">@style/TextAppearance.Material3.LabelLarge</item>
        <item name="android:textColor">?attr/colorOnSurfaceVariant</item>
        <item name="android:singleLine">true</item>
        <item name="android:minEms">2</item>
        <item name="android:gravity">center</item>
    </style>

    <style name="Widget.Kore.TextView.MediaList" parent="Widget.Kore.TextView">
        <item name="android:paddingStart">@dimen/default_padding</item>
        <item name="android:paddingEnd">@dimen/default_padding</item>
        <item name="android:ellipsize">end</item>
    </style>

    <style name="Widget.Kore.TextView.MediaList.Title" parent="Widget.Kore.TextView.MediaList">
        <item name="android:textAppearance">@style/TextAppearance.Material3.TitleMedium</item>
        <item name="android:singleLine">true</item>
        <item name="android:ellipsize">end</item>
    </style>

    <style name="Widget.Kore.TextView.MediaList.Details" parent="Widget.Kore.TextView.MediaList">
        <item name="android:textAppearance">@style/TextAppearance.Material3.BodyMedium</item>
        <item name="android:textColor">?attr/colorOnSurfaceVariant</item>
        <item name="android:maxLines">2</item>
    </style>

    <style name="Widget.Kore.TextView.MediaList.Info" parent="Widget.Kore.TextView.MediaList">
        <item name="android:textAppearance">@style/TextAppearance.Material3.BodySmall</item>
        <!--<item name="android:textSize">@dimen/text_size_small</item>-->
        <item name="android:textColor">?attr/colorOnSurfaceVariant</item>
        <item name="android:singleLine">true</item>
    </style>

    <style name="Widget.Kore.TextView.InfoTitle">
        <item name="android:textAppearance">@style/TextAppearance.Material3.HeadlineMedium</item>
        <item name="android:textColor">?attr/colorPrimary</item>
        <item name="android:singleLine">true</item>
        <item name="android:padding">@dimen/default_padding</item>
        <item name="android:maxLines">1</item>
        <item name="android:ellipsize">end</item>
        <item name="android:gravity">center</item>
    </style>

    <style name="Widget.Kore.TextView.InfoDetails">
        <item name="android:textAppearance">@style/TextAppearance.Material3.TitleLarge</item>
        <item name="android:padding">@dimen/default_padding</item>
        <item name="android:textSize">@dimen/text_size_xlarge</item>
        <!--<item name="android:maxLines">2</item>-->
        <item name="android:ellipsize">end</item>
        <item name="android:gravity">center</item>
    </style>

    <style name="Widget.Kore.TextView.Day" parent="Widget.Kore.TextView">
        <item name="android:textAppearance">@style/TextAppearance.Material3.BodyMedium</item>
        <item name="android:textColor">?attr/colorPrimary</item>
        <item name="android:textSize">@dimen/text_size_xlarge</item>
    </style>

</resources>

