Skip to content

Most visited

Recently visited

navigation
WearHighBandwidthNetworking / res / layout /

activity_main.xml

1
<?xml version="1.0" encoding="utf-8"?>
2
<!--
3
  ~ Copyright 2016 Google Inc.
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
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
18
              xmlns:tools="http://schemas.android.com/tools"
19
              android:layout_width="match_parent"
20
              android:layout_height="match_parent"
21
              xmlns:app="http://schemas.android.com/apk/res-auto"
22
              android:orientation="vertical"
23
              tools:context="com.example.android.wearable.wear.wearhighbandwidthnetworking.MainActivity">
24
 
25
    <RelativeLayout
26
        android:id="@+id/connectivity_indicator"
27
        android:layout_height="56dp"
28
        android:layout_width="match_parent"
29
        android:paddingTop="12dp"
30
        style="@style/connectivity_indicator">
31
 
32
        <ImageView
33
            android:id="@+id/connectivity_icon"
34
            android:layout_centerHorizontal="true"
35
            android:src="@drawable/ic_cloud_disconnected"
36
            style="@style/connectivity_indicator_icon" />
37
 
38
        <TextView
39
            android:id="@+id/connectivity_text"
40
            android:layout_width="wrap_content"
41
            android:layout_height="wrap_content"
42
            android:layout_below="@id/connectivity_icon"
43
            android:layout_centerHorizontal="true"
44
            android:text="@string/network_disconnected"
45
            style="@style/connectivity_indicator_text" />
46
 
47
    </RelativeLayout>
48
 
49
    <android.support.wearable.view.BoxInsetLayout
50
        android:layout_width="match_parent"
51
        android:layout_height="match_parent">
52
 
53
        <RelativeLayout
54
            android:layout_width="match_parent"
55
            android:layout_height="match_parent"
56
            app:layout_box="left|right">
57
 
58
            <TextView
59
                android:id="@+id/info_text"
60
                android:layout_width="match_parent"
61
                android:layout_height="wrap_content"
62
                android:paddingTop="10dp"
63
                android:paddingBottom="10dp"
64
                android:text="@string/info_request_network"
65
                android:textAlignment="center" />
66
 
67
            <RelativeLayout
68
                android:id="@+id/button"
69
                android:layout_width="match_parent"
70
                android:layout_height="wrap_content"
71
                android:layout_below="@id/info_text"
72
                android:focusable="true"
73
                android:onClick="onButtonClick">
74
 
75
                <ImageView
76
                    android:id="@+id/button_icon"
77
                    android:src="@drawable/ic_fast_network"
78
                    style="@style/action_button" />
79
 
80
                <TextView
81
                    android:id="@+id/button_label"
82
                    android:layout_width="wrap_content"
83
                    android:layout_height="wrap_content"
84
                    android:layout_marginLeft="8dp"
85
                    android:layout_toRightOf="@id/button_icon"
86
                    android:layout_centerVertical="true"
87
                    android:text="@string/button_request_network" />
88
 
89
            </RelativeLayout>
90
 
91
            <ProgressBar
92
                android:id="@+id/progress_bar"
93
                android:layout_width="100dp"
94
                android:layout_height="100dp"
95
                android:layout_centerInParent="true"
96
                android:indeterminate="true"
97
                android:visibility="gone" />
98
 
99
        </RelativeLayout>
100
    </android.support.wearable.view.BoxInsetLayout>
101
</LinearLayout>
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.