JobScheduler / res / layout /

sample_main.xml

1
<?xml version="1.0" encoding="utf-8"?>
2
<!--
3
Copyright 2014 The Android Open Source Project
4
 
5
Licensed under the Apache License, Version 2.0 (the "License");
6
you may not use this file except in compliance with the License.
7
You may obtain a copy of the License at
8
 
9
     http://www.apache.org/licenses/LICENSE-2.0
10
 
11
Unless required by applicable law or agreed to in writing, software
12
distributed under the License is distributed on an "AS IS" BASIS,
13
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
See the License for the specific language governing permissions and
15
limitations under the License.
16
-->
17
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
18
    android:layout_width="match_parent"
19
    android:layout_height="match_parent"
20
    android:orientation="vertical" >
21
 
22
    <LinearLayout
23
        android:layout_width="match_parent"
24
        android:layout_height="match_parent"
25
        android:layout_weight="1"
26
        android:orientation="vertical">
27
 
28
        <LinearLayout
29
            android:layout_width="match_parent"
30
            android:layout_height="100dp">
31
            <TextView
32
                android:id="@+id/onstart_textview"
33
                android:layout_width="wrap_content"
34
                android:layout_height="match_parent"
35
                android:layout_weight="1"
36
                android:background="@color/none_received"
37
                android:gravity="center"
38
                android:text="@string/onstarttask"/>
39
            <TextView
40
                android:id="@+id/onstop_textview"
41
                android:layout_width="wrap_content"
42
                android:layout_height="match_parent"
43
                android:layout_weight="1"
44
                android:background="@color/none_received"
45
                android:gravity="center"
46
                android:text="@string/onstoptask"/>
47
        </LinearLayout>
48
        <Button
49
            android:id="@+id/finished_button"
50
            android:layout_width="match_parent"
51
            android:layout_height="wrap_content"
52
            android:padding="20dp"
53
            android:layout_marginBottom="5dp"
54
            android:onClick="finishJob"
55
            android:text="@string/finish_job_button_text"/>
56
 
57
        <TextView
58
            android:id="@+id/task_params"
59
            android:layout_width="match_parent"
60
            android:layout_height="wrap_content"
61
            android:text="@string/defaultparamtext"
62
            android:gravity="center"
63
            android:textSize="20dp"
64
 
65
            android:padding="15dp"
66
            android:layout_marginBottom="10dp" />
67
 
68
        <TextView
69
            android:layout_width="match_parent"
70
            android:layout_height="wrap_content"
71
            android:text="@string/constraints"
72
            android:layout_margin="15dp"
73
            android:textSize="18dp"/>
74
        <LinearLayout
75
            android:layout_width="match_parent"
76
            android:layout_height="wrap_content"
77
            android:orientation="vertical"
78
            android:layout_marginLeft="10dp">
79
            <LinearLayout
80
                android:layout_width="match_parent"
81
                android:layout_height="wrap_content">
82
                <TextView
83
                    android:layout_width="wrap_content"
84
                    android:layout_height="wrap_content"
85
                    android:text="@string/connectivity"
86
                    android:layout_marginRight="10dp"/>
87
                <RadioGroup
88
                    android:layout_width="wrap_content"
89
                    android:layout_height="wrap_content"
90
                    android:orientation="horizontal">
91
                    <RadioButton android:id="@+id/checkbox_any"
92
                        android:layout_width="wrap_content"
93
                        android:layout_height="wrap_content"
94
                        android:text="@string/any"/>
95
                    <RadioButton android:id="@+id/checkbox_unmetered"
96
                        android:layout_width="wrap_content"
97
                        android:layout_height="wrap_content"
98
                        android:text="@string/unmetered"/>
99
                </RadioGroup>
100
 
101
            </LinearLayout>
102
            <LinearLayout
103
                android:layout_width="match_parent"
104
                android:layout_height="wrap_content">
105
                <TextView
106
                    android:layout_width="wrap_content"
107
                    android:layout_height="wrap_content"
108
                    android:text="@string/timing"/>
109
                <TextView
110
                    android:layout_width="wrap_content"
111
                    android:layout_height="wrap_content"
112
                    android:layout_marginLeft="15dp"
113
                    android:textSize="17dp"
114
                    android:text="@string/delay"/>
115
                <EditText
116
                    android:id="@+id/delay_time"
117
                    android:layout_width="60dp"
118
                    android:layout_height="wrap_content"
119
                    android:inputType="number"/>
120
                <TextView
121
                    android:layout_width="wrap_content"
122
                    android:layout_height="wrap_content"
123
                    android:text="@string/deadline"
124
                    android:textSize="17dp"/>
125
                <EditText
126
                    android:id="@+id/deadline_time"
127
                    android:layout_width="60dp"
128
                    android:layout_height="wrap_content"
129
                    android:inputType="number"/>
130
            </LinearLayout>
131
            <LinearLayout
132
                android:layout_width="match_parent"
133
                android:layout_height="wrap_content">
134
                <TextView
135
                    android:layout_width="wrap_content"
136
                    android:layout_height="wrap_content"
137
                    android:text="@string/charging_caption"
138
                    android:layout_marginRight="15dp"/>
139
                <CheckBox
140
                    android:layout_width="wrap_content"
141
                    android:layout_height="wrap_content"
142
                    android:id="@+id/checkbox_charging"
143
                    android:text="@string/charging_text"/>
144
            </LinearLayout>
145
            <LinearLayout
146
                android:layout_width="match_parent"
147
                android:layout_height="wrap_content">
148
                <TextView
149
                    android:layout_width="wrap_content"
150
                    android:layout_height="wrap_content"
151
                    android:text="@string/idle_caption"
152
                    android:layout_marginRight="15dp"/>
153
                <CheckBox
154
                    android:layout_width="wrap_content"
155
                    android:layout_height="wrap_content"
156
                    android:id="@+id/checkbox_idle"
157
                    android:text="@string/idle_mode_text"/>
158
            </LinearLayout>
159
 
160
        </LinearLayout>
161
        <Button
162
            android:id="@+id/schedule_button"
163
            android:layout_width="match_parent"
164
            android:layout_height="wrap_content"
165
            android:layout_marginTop="20dp"
166
            android:layout_marginLeft="40dp"
167
            android:layout_marginRight="40dp"
168
            android:onClick="scheduleJob"
169
            android:text="@string/schedule_job_button_text"/>
170
        <Button
171
            android:id="@+id/cancel_button"
172
            android:layout_width="match_parent"
173
            android:layout_height="wrap_content"
174
            android:layout_marginLeft="40dp"
175
            android:layout_marginRight="40dp"
176
            android:onClick="cancelAllJobs"
177
            android:text="@string/cancel_all_jobs_button_text"/>
178
    </LinearLayout>
179
</ScrollView>