<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2014 The Android Open Source Project

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.
-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

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

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="100dp">

            <TextView
                android:id="@+id/onstart_textview"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_margin="12dp"
                android:layout_weight="1"
                android:background="@color/none_received"
                android:gravity="center"
                android:text="@string/onstarttask" />

            <TextView
                android:id="@+id/onstop_textview"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_margin="12dp"
                android:layout_weight="1"
                android:background="@color/none_received"
                android:gravity="center"
                android:text="@string/onstoptask" />

        </LinearLayout>

        <TextView
            android:id="@+id/task_params"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="10dp"
            android:layout_weight="1"
            android:gravity="center"

            android:padding="15dp"
            android:textSize="20sp" />

        <Button
            android:id="@+id/finished_button"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:padding="20dp"
            android:layout_marginBottom="5dp"
            android:layout_marginLeft="40dp"
            android:layout_marginRight="40dp"
            android:onClick="finishJob"
            android:text="@string/finish_job_button_text"/>

        <TableLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_margin="8dp">

            <TableRow
                android:layout_width="match_parent"
                android:layout_height="match_parent">

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_marginRight="12dp"
                    android:gravity="right|center_vertical"
                    android:text="@string/work_duration"
                    android:textSize="14sp" />

                <EditText
                    android:id="@+id/duration_time"
                    android:layout_width="48dp"
                    android:layout_height="wrap_content"
                    android:inputType="number"
                    android:text="2" />

            </TableRow>

            <TableRow
                android:layout_width="match_parent"
                android:layout_height="match_parent">

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_marginRight="12dp"
                    android:gravity="right|center_vertical"
                    android:text="@string/connectivity"
                    android:textSize="14sp" />

                <RadioGroup
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal">

                    <RadioButton
                        android:id="@+id/checkbox_any"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:checked="true"
                        android:text="@string/any" />

                    <RadioButton
                        android:id="@+id/checkbox_unmetered"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/unmetered" />
                </RadioGroup>

            </TableRow>

            <TableRow
                android:layout_width="match_parent"
                android:layout_height="match_parent">

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_marginRight="12dp"
                    android:gravity="right|center_vertical"
                    android:text="@string/delay"
                    android:textSize="14sp" />

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:orientation="horizontal">

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/timing" />

                    <EditText
                        android:id="@+id/delay_time"
                        android:layout_width="48dp"
                        android:layout_height="wrap_content"
                        android:inputType="number"
                        android:text="0" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/deadline"
                        android:textSize="14sp" />

                    <EditText
                        android:id="@+id/deadline_time"
                        android:layout_width="48dp"
                        android:layout_height="wrap_content"
                        android:inputType="number"
                        android:text="15" />

                </LinearLayout>

            </TableRow>

            <TableRow
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_weight="1">

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_marginRight="12dp"
                    android:gravity="right|center_vertical"
                    android:text="@string/charging_caption"
                    android:textSize="14sp" />

                <CheckBox
                    android:id="@+id/checkbox_charging"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/charging_text" />

            </TableRow>

            <TableRow
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_weight="1">

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_marginRight="12dp"
                    android:gravity="right|center_vertical"
                    android:text="@string/idle_caption" />

                <CheckBox
                    android:id="@+id/checkbox_idle"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/idle_mode_text" />
            </TableRow>

        </TableLayout>

        <Button
            android:id="@+id/schedule_button"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="20dp"
            android:layout_marginLeft="40dp"
            android:layout_marginRight="40dp"
            android:onClick="scheduleJob"
            android:text="@string/schedule_job_button_text"/>
        <Button
            android:id="@+id/cancel_button"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="40dp"
            android:layout_marginRight="40dp"
            android:onClick="cancelAllJobs"
            android:text="@string/cancel_all_jobs_button_text"/>
    </LinearLayout>
</ScrollView>
