<?xml version="1.0" encoding="utf-8"?>
<!--
    TimeLimit Copyright <C> 2019 - 2020 Jonas Lochmann

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

    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 <https://www.gnu.org/licenses/>.
-->
<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools">

    <data>
        <variable
            name="minLevelCharging"
            type="int" />

        <variable
            name="minLevelMobile"
            type="int" />
    </data>

    <androidx.cardview.widget.CardView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:cardUseCompatPadding="true">
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:padding="8dp">

            <TextView
                tools:ignore="UnusedAttribute"
                android:drawableTint="?colorOnSurface"
                android:id="@+id/title_view"
                android:background="?selectableItemBackground"
                android:drawableEnd="@drawable/ic_info_outline_black_24dp"
                android:textAppearance="@style/TextAppearance.AppCompat.Large"
                android:text="@string/category_settings_battery_limit_title"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />

            <TextView
                android:textAppearance="?android:textAppearanceMedium"
                android:text="@{@string/category_settings_battery_limit_charging(minLevelCharging)}"
                tools:text="@string/category_settings_battery_limit_charging"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />

            <SeekBar
                android:max="10"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:id="@+id/seekbar_charging" />

            <TextView
                android:textAppearance="?android:textAppearanceMedium"
                android:text="@{@string/category_settings_battery_limit_mobile(minLevelMobile)}"
                tools:text="@string/category_settings_battery_limit_mobile"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />

            <SeekBar
                android:nextFocusDown="@id/confirm_btn"
                android:max="10"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:id="@+id/seekbar_mobile" />

            <com.google.android.material.button.MaterialButton
                android:visibility="gone"
                tools:visibility="visible"
                app:icon="@drawable/ic_check_black_24dp"
                android:text="@string/generic_save"
                android:id="@+id/confirm_btn"
                android:layout_gravity="end"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" />

        </LinearLayout>
    </androidx.cardview.widget.CardView>
</layout>