<?xml version="1.0" encoding="utf-8"?>
<!--
  TimeLimit Copyright <C> 2019 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:tools="http://schemas.android.com/tools">

    <data>
        <variable
            name="minutes"
            type="Integer" />

        <variable
            name="hours"
            type="Integer" />

        <variable
            name="days"
            type="Integer" />

        <variable
            name="maxDays"
            type="Integer" />

        <variable
            name="minutesText"
            type="String" />

        <variable
            name="hoursText"
            type="String" />

        <variable
            name="daysText"
            type="String" />

        <import type="android.view.View" />
    </data>

    <LinearLayout
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <SeekBar
            android:id="@+id/minutes_seek"
            android:progress="@{safeUnbox(minutes)}"
            android:max="59"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

        <TextView
            tools:text="5 Minuten"
            android:text="@{minutesText}"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

        <SeekBar
            android:id="@+id/hours_seek"
            android:progress="@{safeUnbox(hours)}"
            android:max="23"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

        <TextView
            tools:text="1 Stunde"
            android:text="@{hoursText}"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

        <SeekBar
            android:visibility="@{safeUnbox(maxDays) > 0 ? View.VISIBLE : View.GONE}"
            android:id="@+id/days_seek"
            android:progress="@{safeUnbox(days)}"
            android:max="@{safeUnbox(maxDays)}"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

        <TextView
            android:visibility="@{safeUnbox(maxDays) > 0 ? View.VISIBLE : View.GONE}"
            tools:text="2 Tage"
            android:text="@{daysText}"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

    </LinearLayout>

</layout>
