1<?xml version="1.0" encoding="utf-8"?>
2<!-- Copyright (C) 2018 The Android Open Source Project
3
4     Licensed under the Apache License, Version 2.0 (the "License");
5     you may not use this file except in compliance with the License.
6     You may obtain a copy of the License at
7
8          http://www.apache.org/licenses/LICENSE-2.0
9
10     Unless required by applicable law or agreed to in writing, software
11     distributed under the License is distributed on an "AS IS" BASIS,
12     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13     See the License for the specific language governing permissions and
14     limitations under the License.
15-->
16
17<androidx.viewpager.widget.ViewPager
18    xmlns:android="http://schemas.android.com/apk/res/android"
19    android:id="@+id/connectivity_pager"
20    android:layout_width="match_parent"
21    android:layout_height="match_parent">
22
23    <com.google.android.material.tabs.TabLayout
24        android:layout_width="match_parent"
25        android:layout_height="wrap_content"
26        android:layout_gravity="top" />
27
28    <LinearLayout
29        android:tag="WiFi Control"
30        android:orientation="vertical"
31        android:layout_width="match_parent"
32        android:layout_height="match_parent">
33
34        <LinearLayout
35            android:orientation="horizontal"
36            android:layout_width="match_parent"
37            android:layout_height="wrap_content"
38            android:layout_margin="4dp">
39
40            <TextView
41                android:layout_width="wrap_content"
42                android:layout_height="wrap_content"
43                android:layout_marginRight="20dp"
44                android:text="Wifi:" />
45
46            <Button android:id="@+id/startWifi"
47                android:layout_width="wrap_content"
48                android:layout_height="wrap_content"
49                android:layout_marginRight="5dp"
50                android:text="Start" />
51
52            <Button android:id="@+id/stopWifi"
53                android:layout_width="wrap_content"
54                android:layout_height="wrap_content"
55                android:layout_marginRight="20dp"
56                android:text="Stop" />
57
58            <TextView
59                android:id="@+id/wifiStatusPolled"
60                android:layout_width="wrap_content"
61                android:layout_height="wrap_content" />
62        </LinearLayout>
63
64        <LinearLayout
65            android:orientation="horizontal"
66            android:layout_width="match_parent"
67            android:layout_height="wrap_content"
68            android:layout_margin="4dp">
69
70            <TextView
71                android:layout_width="wrap_content"
72                android:layout_height="wrap_content"
73                android:layout_marginRight="20dp"
74                android:text="Tethering:" />
75
76            <Button android:id="@+id/startTethering"
77                android:layout_width="wrap_content"
78                android:layout_height="wrap_content"
79                android:layout_marginRight="5dp"
80                android:text="Start" />
81
82            <Button android:id="@+id/stopTethering"
83                android:layout_width="wrap_content"
84                android:layout_height="wrap_content"
85                android:layout_marginRight="20dp"
86                android:text="Stop" />
87
88            <TextView
89                android:id="@+id/tetheringStatus"
90                android:layout_width="wrap_content"
91                android:layout_height="wrap_content"
92                android:layout_marginRight="5dp" />
93
94            <TextView
95                android:id="@+id/tetheringStatusPolled"
96                android:layout_width="wrap_content"
97                android:layout_height="wrap_content" />
98        </LinearLayout>
99
100        <LinearLayout
101            android:orientation="horizontal"
102            android:layout_width="match_parent"
103            android:layout_height="wrap_content"
104            android:layout_margin="4dp">
105
106            <TextView
107                android:layout_width="wrap_content"
108                android:layout_height="wrap_content"
109                android:layout_marginRight="20dp"
110                android:text="LocalOnly:" />
111
112            <Button android:id="@+id/startLocalOnly"
113                android:layout_width="wrap_content"
114                android:layout_height="wrap_content"
115                android:layout_marginRight="5dp"
116                android:text="Start" />
117
118            <Button android:id="@+id/stopLocalOnly"
119                android:layout_width="wrap_content"
120                android:layout_height="wrap_content"
121                android:layout_marginRight="20dp"
122                android:text="Stop" />
123
124            <TextView
125                android:id="@+id/localOnlyStatus"
126                android:layout_width="wrap_content"
127                android:layout_height="wrap_content" />
128        </LinearLayout>
129
130        <LinearLayout
131            android:orientation="horizontal"
132            android:layout_width="match_parent"
133            android:layout_height="wrap_content"
134            android:layout_margin="4dp">
135            <Button android:id="@+id/networkEnableWifiIntent"
136                    android:layout_width="wrap_content"
137                    android:layout_height="wrap_content"
138                    android:text="Enable Wifi Intent"/>
139            <Button android:id="@+id/networkDisableWifiIntent"
140                    android:layout_width="wrap_content"
141                    android:layout_height="wrap_content"
142                    android:text="Disable Wifi Intent"/>
143        </LinearLayout>
144
145        <LinearLayout
146            android:orientation="horizontal"
147            android:layout_width="match_parent"
148            android:layout_height="wrap_content"
149            android:layout_margin="4dp">
150            <Button android:id="@+id/networkEnableBluetoothIntent"
151                    android:layout_width="wrap_content"
152                    android:layout_height="wrap_content"
153                    android:text="Enable Bluetooth Intent"/>
154            <Button android:id="@+id/networkDisableBluetoothIntent"
155                    android:layout_width="wrap_content"
156                    android:layout_height="wrap_content"
157                    android:text="Disable Bluetooth Intent"/>
158            <Button android:id="@+id/networkDiscoverableBluetoothIntent"
159                    android:layout_width="wrap_content"
160                    android:layout_height="wrap_content"
161                    android:text="Discoverable Bluetooth Intent"/>
162        </LinearLayout>
163    </LinearLayout>
164
165    <LinearLayout
166        android:tag="Network list"
167        android:orientation="vertical"
168        android:layout_width="match_parent"
169        android:layout_height="match_parent">
170
171        <!-- Header for table -->
172        <LinearLayout
173            android:orientation="horizontal"
174            android:layout_width="match_parent"
175            android:layout_height="wrap_content"
176            android:paddingLeft="4dp"
177            android:background="#3C3F41"
178            android:weightSum="12">
179
180            <TextView
181                android:layout_width="0dp"
182                android:layout_height="wrap_content"
183                android:layout_weight="1"
184                android:textSize="32sp"
185                android:textColor="#d4d4d4"
186                android:textStyle="bold"
187                android:text="Net ID" />
188
189            <TextView
190                android:layout_width="0dp"
191                android:layout_height="wrap_content"
192                android:layout_weight="9"
193                android:textSize="32sp"
194                android:textColor="#d4d4d4"
195                android:textStyle="bold"
196                android:text="Details" />
197
198            <TextView
199                android:layout_width="0dp"
200                android:layout_height="wrap_content"
201                android:layout_weight="2"
202                android:textSize="32sp"
203                android:textColor="#d4d4d4"
204                android:textStyle="bold"
205                android:text="Functions" />
206
207        </LinearLayout>
208
209        <!-- Wrapped list view to implement swipe to refresh -->
210        <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
211            android:id="@+id/refreshNetworksList"
212            android:layout_width="match_parent"
213            android:layout_height="wrap_content">
214
215            <!-- Filled in code with network_item.xml -->
216            <ListView
217                android:id="@+id/networks"
218                android:layout_width="match_parent"
219                android:layout_height="wrap_content" />
220
221        </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
222
223    </LinearLayout>
224
225</androidx.viewpager.widget.ViewPager>
226