Skip to content

Most visited

Recently visited

navigation
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="wrap_content"
25
        android:orientation="vertical">
26
 
27
        <LinearLayout
28
            android:layout_width="match_parent"
29
            android:layout_height="100dp">
30
 
31
            <TextView
32
                android:id="@+id/onstart_textview"
33
                android:layout_width="wrap_content"
34
                android:layout_height="match_parent"
35
                android:layout_margin="12dp"
36
                android:layout_weight="1"
37
                android:background="@color/none_received"
38
                android:gravity="center"
39
                android:text="@string/onstarttask" />
40
 
41
            <TextView
42
                android:id="@+id/onstop_textview"
43
                android:layout_width="wrap_content"
44
                android:layout_height="match_parent"
45
                android:layout_margin="12dp"
46
                android:layout_weight="1"
47
                android:background="@color/none_received"
48
                android:gravity="center"
49
                android:text="@string/onstoptask" />
50
 
51
        </LinearLayout>
52
 
53
        <TextView
54
            android:id="@+id/task_params"
55
            android:layout_width="match_parent"
56
            android:layout_height="wrap_content"
57
            android:layout_marginBottom="10dp"
58
            android:layout_weight="1"
59
            android:gravity="center"
60
 
61
            android:padding="15dp"
62
            android:textSize="20sp" />
63
 
64
        <Button
65
            android:id="@+id/finished_button"
66
            android:layout_width="match_parent"
67
            android:layout_height="wrap_content"
68
            android:padding="20dp"
69
            android:layout_marginBottom="5dp"
70
            android:layout_marginLeft="40dp"
71
            android:layout_marginRight="40dp"
72
            android:onClick="finishJob"
73
            android:text="@string/finish_job_button_text"/>
74
 
75
        <TableLayout
76
            android:layout_width="match_parent"
77
            android:layout_height="match_parent"
78
            android:layout_margin="8dp">
79
 
80
            <TableRow
81
                android:layout_width="match_parent"
82
                android:layout_height="match_parent">
83
 
84
                <TextView
85
                    android:layout_width="match_parent"
86
                    android:layout_height="match_parent"
87
                    android:layout_marginRight="12dp"
88
                    android:gravity="right|center_vertical"
89
                    android:text="@string/work_duration"
90
                    android:textSize="14sp" />
91
 
92
                <EditText
93
                    android:id="@+id/duration_time"
94
                    android:layout_width="48dp"
95
                    android:layout_height="wrap_content"
96
                    android:inputType="number"
97
                    android:text="2" />
98
 
99
            </TableRow>
100
 
101
            <TableRow
102
                android:layout_width="match_parent"
103
                android:layout_height="match_parent">
104
 
105
                <TextView
106
                    android:layout_width="match_parent"
107
                    android:layout_height="match_parent"
108
                    android:layout_marginRight="12dp"
109
                    android:gravity="right|center_vertical"
110
                    android:text="@string/connectivity"
111
                    android:textSize="14sp" />
112
 
113
                <RadioGroup
114
                    android:layout_width="wrap_content"
115
                    android:layout_height="wrap_content"
116
                    android:orientation="horizontal">
117
 
118
                    <RadioButton
119
                        android:id="@+id/checkbox_any"
120
                        android:layout_width="wrap_content"
121
                        android:layout_height="wrap_content"
122
                        android:checked="true"
123
                        android:text="@string/any" />
124
 
125
                    <RadioButton
126
                        android:id="@+id/checkbox_unmetered"
127
                        android:layout_width="wrap_content"
128
                        android:layout_height="wrap_content"
129
                        android:text="@string/unmetered" />
130
                </RadioGroup>
131
 
132
            </TableRow>
133
 
134
            <TableRow
135
                android:layout_width="match_parent"
136
                android:layout_height="match_parent">
137
 
138
                <TextView
139
                    android:layout_width="match_parent"
140
                    android:layout_height="match_parent"
141
                    android:layout_marginRight="12dp"
142
                    android:gravity="right|center_vertical"
143
                    android:text="@string/delay"
144
                    android:textSize="14sp" />
145
 
146
                <LinearLayout
147
                    android:layout_width="match_parent"
148
                    android:layout_height="match_parent"
149
                    android:orientation="horizontal">
150
 
151
                    <TextView
152
                        android:layout_width="wrap_content"
153
                        android:layout_height="wrap_content"
154
                        android:text="@string/timing" />
155
 
156
                    <EditText
157
                        android:id="@+id/delay_time"
158
                        android:layout_width="48dp"
159
                        android:layout_height="wrap_content"
160
                        android:inputType="number"
161
                        android:text="0" />
162
 
163
                    <TextView
164
                        android:layout_width="wrap_content"
165
                        android:layout_height="wrap_content"
166
                        android:text="@string/deadline"
167
                        android:textSize="14sp" />
168
 
169
                    <EditText
170
                        android:id="@+id/deadline_time"
171
                        android:layout_width="48dp"
172
                        android:layout_height="wrap_content"
173
                        android:inputType="number"
174
                        android:text="15" />
175
 
176
                </LinearLayout>
177
 
178
            </TableRow>
179
 
180
            <TableRow
181
                android:layout_width="match_parent"
182
                android:layout_height="match_parent"
183
                android:layout_weight="1">
184
 
185
                <TextView
186
                    android:layout_width="match_parent"
187
                    android:layout_height="match_parent"
188
                    android:layout_marginRight="12dp"
189
                    android:gravity="right|center_vertical"
190
                    android:text="@string/charging_caption"
191
                    android:textSize="14sp" />
192
 
193
                <CheckBox
194
                    android:id="@+id/checkbox_charging"
195
                    android:layout_width="wrap_content"
196
                    android:layout_height="wrap_content"
197
                    android:text="@string/charging_text" />
198
 
199
            </TableRow>
200
 
201
            <TableRow
202
                android:layout_width="match_parent"
203
                android:layout_height="match_parent"
204
                android:layout_weight="1">
205
 
206
                <TextView
207
                    android:layout_width="match_parent"
208
                    android:layout_height="match_parent"
209
                    android:layout_marginRight="12dp"
210
                    android:gravity="right|center_vertical"
211
                    android:text="@string/idle_caption" />
212
 
213
                <CheckBox
214
                    android:id="@+id/checkbox_idle"
215
                    android:layout_width="wrap_content"
216
                    android:layout_height="wrap_content"
217
                    android:text="@string/idle_mode_text" />
218
            </TableRow>
219
 
220
        </TableLayout>
221
 
222
        <Button
223
            android:id="@+id/schedule_button"
224
            android:layout_width="match_parent"
225
            android:layout_height="wrap_content"
226
            android:layout_marginTop="20dp"
227
            android:layout_marginLeft="40dp"
228
            android:layout_marginRight="40dp"
229
            android:onClick="scheduleJob"
230
            android:text="@string/schedule_job_button_text"/>
231
        <Button
232
            android:id="@+id/cancel_button"
233
            android:layout_width="match_parent"
234
            android:layout_height="wrap_content"
235
            android:layout_marginLeft="40dp"
236
            android:layout_marginRight="40dp"
237
            android:onClick="cancelAllJobs"
238
            android:text="@string/cancel_all_jobs_button_text"/>
239
    </LinearLayout>
240
</ScrollView>
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!