<!--
  ~ Copyright (C) 2016 Álinson Santos Xavier <isoron@gmail.com>
  ~
  ~ This file is part of Loop Habit Tracker.
  ~
  ~ Loop Habit Tracker 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, either version 3 of the License, or (at your
  ~ option) any later version.
  ~
  ~ Loop Habit Tracker 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/>.
  -->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/container"
    tools:context="org.isoron.uhabits.fragments.EditHabitFragment"
    tools:ignore="MergeRootFrame"
    style="@style/dialogForm">

    <LinearLayout
        android:id="@+id/formPanel"
        style="@style/dialogFormPanel">

        <LinearLayout
            android:id="@+id/namePanel"
            style="@style/dialogFormRow">

            <EditText
                android:id="@+id/input_name"
                android:hint="@string/name"
                style="@style/dialogFormInput">

                <requestFocus />
            </EditText>

            <ImageButton
                android:id="@+id/buttonPickColor"
                android:src="@drawable/ic_action_color_light"
                android:contentDescription="@string/color_picker_default_title"
                style="@style/dialogFormInputColor" />
        </LinearLayout>

        <EditText
            android:id="@+id/input_description"
            android:hint="@string/description_hint"
            style="@style/dialogFormInputMultiline" />

        <LinearLayout
            style="@style/dialogFormRow"
            android:gravity="start">

            <TextView
                android:id="@+id/textView1"
                style="@style/dialogFormLabel"
                android:text="@string/repeat" />

            <EditText
                android:id="@+id/input_freq_num"
                style="@style/dialogFormInputSmallNumber" />

            <TextView
                android:id="@+id/textView3"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/times_every" />

            <EditText
                android:id="@+id/input_freq_den"
                style="@style/dialogFormInputSmallNumber" />

            <TextView
                android:id="@+id/textView5"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/days" />
        </LinearLayout>

        <LinearLayout
            android:id="@+id/reminedPanel"
            style="@style/dialogFormRow">

            <TextView
                android:id="@+id/TextView2"
                style="@style/dialogFormLabel"
                android:text="@string/reminder" />

            <TextView
                android:id="@+id/inputReminderTime"
                style="@style/dialogFormTimePicker" />

            <TextView
                android:id="@+id/inputReminderDays"
                style="@style/dialogFormTimePicker" />

        </LinearLayout>
    </LinearLayout>

    <LinearLayout
        style="?android:attr/buttonBarStyle"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="end"
        android:paddingEnd="16dp"
        android:paddingRight="16dp">

        <Button
            android:id="@+id/buttonDiscard"
            style="?android:attr/buttonBarButtonStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/discard" />

        <Button
            android:id="@+id/buttonSave"
            style="?android:attr/buttonBarButtonStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/save" />
    </LinearLayout>
</LinearLayout>