]> gitweb.stoutner.com Git - PrivacyCell.git/blob - app/src/main/res/layout/privacy_cell_top_appbar.xml
Release 1.11.
[PrivacyCell.git] / app / src / main / res / layout / privacy_cell_top_appbar.xml
1 <?xml version="1.0" encoding="utf-8"?>
2
3 <!--
4   SPDX-License-Identifier: GPL-3.0-or-later
5   SPDX-FileCopyrightText: 2021-2022, 2025 Soren Stoutner <soren@stoutner.com>
6
7   This file is part of Privacy Cell <https://www.stoutner.com/privacy-cell/>.
8
9   This program is free software: you can redistribute it and/or modify it under
10   the terms of the GNU General Public License as published by the Free Software
11   Foundation, either version 3 of the License, or (at your option) any later
12   version.
13
14   This program is distributed in the hope that it will be useful, but WITHOUT
15   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16   FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
17   details.
18
19   You should have received a copy of the GNU General Public License along with
20   this program.  If not, see <https://www.gnu.org/licenses/>. -->
21
22 <!-- API 35 (Android 15) requires setting `android:fitsSystemWindows="true"`. -->
23 <FrameLayout
24     xmlns:android="http://schemas.android.com/apk/res/android"
25     xmlns:tools="http://schemas.android.com/tools"
26     xmlns:app="http://schemas.android.com/apk/res-auto"
27     android:layout_height="match_parent"
28     android:layout_width="match_parent"
29     android:fitsSystemWindows="true" >
30
31     <androidx.drawerlayout.widget.DrawerLayout
32         android:id="@+id/drawerlayout"
33         android:layout_height="match_parent"
34         android:layout_width="match_parent" >
35
36         <androidx.coordinatorlayout.widget.CoordinatorLayout
37             android:layout_height="match_parent"
38             android:layout_width="match_parent" >
39
40             <!-- The linear layout with `orientation="vertical"` moves the main content below the app bar layout. -->
41             <LinearLayout
42                 android:layout_height="match_parent"
43                 android:layout_width="match_parent"
44                 android:orientation="vertical" >
45
46                 <!-- The app bar theme must be specified here because the activity uses a `NoActionBar` theme. -->
47                 <com.google.android.material.appbar.AppBarLayout
48                     android:layout_height="wrap_content"
49                     android:layout_width="match_parent"
50                     android:background="?android:attr/colorBackground"
51                     android:theme="@style/ThemeOverlay.AppCompat.DayNight.ActionBar" >
52
53                     <androidx.appcompat.widget.Toolbar
54                         android:id="@+id/toolbar"
55                         android:layout_height="wrap_content"
56                         android:layout_width="match_parent" />
57                 </com.google.android.material.appbar.AppBarLayout>
58
59                 <!-- The main content is wrapped in a scroll view. -->
60                 <ScrollView
61                     android:layout_height="match_parent"
62                     android:layout_width="match_parent" >
63
64                     <LinearLayout
65                         android:layout_height="wrap_content"
66                         android:layout_width="match_parent"
67                         android:orientation="vertical" >
68
69                         <!-- Overall status. -->
70                         <androidx.cardview.widget.CardView
71                             android:id="@+id/overall_status_cardview"
72                             android:layout_height="wrap_content"
73                             android:layout_width="match_parent"
74                             android:layout_marginTop="20dp"
75                             android:layout_marginStart="20dp"
76                             android:layout_marginEnd="20dp"
77                             android:layout_marginBottom="10dp" >
78
79                             <LinearLayout
80                                 android:id="@+id/overall_status_linearlayout"
81                                 android:layout_height="wrap_content"
82                                 android:layout_width="wrap_content"
83                                 android:layout_gravity="center_horizontal"
84                                 android:orientation="vertical"
85                                 android:layout_margin="20dp"
86                                 tools:ignore="UseCompoundDrawables" >
87
88                                 <ImageView
89                                     android:id="@+id/overall_status_imageview"
90                                     android:layout_width="wrap_content"
91                                     android:layout_height="wrap_content"
92                                     android:layout_gravity="center_horizontal"
93                                     tools:ignore="ContentDescription" />
94
95                                 <!-- The text color primary is only displayed if the read phone state permission is not granted.
96                                     The default text is replaced if the permission is not granted or the device is connected to a cell phone network. -->
97                                 <TextView
98                                     android:id="@+id/overall_status_textview"
99                                     android:layout_height="wrap_content"
100                                     android:layout_width="wrap_content"
101                                     android:layout_gravity="center_horizontal"
102                                     android:textAlignment="center"
103                                     android:layout_marginTop="10dp"
104                                     android:textColor="?android:textColorPrimary"
105                                     android:textSize="20sp"
106                                     android:textStyle="bold"
107                                     android:text="@string/not_connected" />
108                             </LinearLayout>
109                         </androidx.cardview.widget.CardView>
110
111                         <!-- Voice network. -->
112                         <androidx.cardview.widget.CardView
113                             android:id="@+id/voice_network_cardview"
114                             android:layout_height="wrap_content"
115                             android:layout_width="match_parent"
116                             android:layout_marginTop="10dp"
117                             android:layout_marginStart="20dp"
118                             android:layout_marginEnd="20dp"
119                             android:layout_marginBottom="10dp" >
120
121                             <LinearLayout
122                                 android:layout_height="wrap_content"
123                                 android:layout_width="wrap_content"
124                                 android:layout_gravity="center_horizontal"
125                                 android:orientation="vertical"
126                                 android:layout_margin="15dp" >
127
128                                 <TextView
129                                     android:id="@+id/voice_network"
130                                     android:layout_height="wrap_content"
131                                     android:layout_width="wrap_content"
132                                     android:layout_gravity="center_horizontal"
133                                     android:textAlignment="center"
134                                     android:textSize="18sp"
135                                     android:textStyle="bold" />
136
137                                 <TextView
138                                     android:id="@+id/voice_network_details"
139                                     android:layout_height="wrap_content"
140                                     android:layout_width="wrap_content"
141                                     android:layout_gravity="center_horizontal"
142                                     android:textAlignment="center"
143                                     android:textColor="?android:textColorPrimary" />
144
145                                 <TextView
146                                     android:id="@+id/voice_network_subscription_info"
147                                     android:layout_height="wrap_content"
148                                     android:layout_width="wrap_content"
149                                     android:layout_gravity="center_horizontal"
150                                     android:textAlignment="center"
151                                     android:textSize="12sp" />
152                             </LinearLayout>
153                         </androidx.cardview.widget.CardView>
154
155                         <!-- Data network. -->
156                         <androidx.cardview.widget.CardView
157                             android:layout_height="wrap_content"
158                             android:layout_width="match_parent"
159                             android:layout_marginTop="10dp"
160                             android:layout_marginStart="20dp"
161                             android:layout_marginEnd="20dp"
162                             android:layout_marginBottom="10dp" >
163
164                             <LinearLayout
165                                 android:layout_height="wrap_content"
166                                 android:layout_width="wrap_content"
167                                 android:layout_gravity="center_horizontal"
168                                 android:orientation="vertical"
169                                 android:layout_margin="15dp" >
170
171                                 <LinearLayout
172                                     android:id="@+id/data_network_linearlayout"
173                                     android:layout_height="wrap_content"
174                                     android:layout_width="wrap_content"
175                                     android:layout_gravity="center_horizontal"
176                                     android:orientation="vertical" >
177
178                                     <TextView
179                                         android:id="@+id/data_network"
180                                         android:layout_height="wrap_content"
181                                         android:layout_width="wrap_content"
182                                         android:layout_gravity="center_horizontal"
183                                         android:textAlignment="center"
184                                         android:textSize="18sp"
185                                         android:textStyle="bold"
186                                         tools:ignore="TooDeepLayout" />
187
188                                     <TextView
189                                         android:id="@+id/data_network_details"
190                                         android:layout_height="wrap_content"
191                                         android:layout_width="wrap_content"
192                                         android:layout_gravity="center_horizontal"
193                                         android:textAlignment="center"
194                                         android:textColor="?android:textColorPrimary" />
195
196                                     <TextView
197                                         android:id="@+id/data_network_subscription_info"
198                                         android:layout_height="wrap_content"
199                                         android:layout_width="wrap_content"
200                                         android:layout_gravity="center_horizontal"
201                                         android:textAlignment="center"
202                                         android:textSize="12sp"
203                                         android:layout_marginBottom="20dp" />
204                                 </LinearLayout>
205
206                                 <!-- Additional network info. -->
207                                 <LinearLayout
208                                     android:id="@+id/additional_network_info_linearlayout"
209                                     android:layout_height="wrap_content"
210                                     android:layout_width="wrap_content"
211                                     android:layout_gravity="center_horizontal"
212                                     android:orientation="vertical" >
213
214                                     <TextView
215                                         android:id="@+id/additional_network_info"
216                                         android:layout_height="wrap_content"
217                                         android:layout_width="wrap_content"
218                                         android:layout_gravity="center_horizontal"
219                                         android:textAlignment="center"
220                                         android:textSize="18sp"
221                                         android:textStyle="bold" />
222
223                                     <TextView
224                                         android:id="@+id/additional_network_info_details"
225                                         android:layout_height="wrap_content"
226                                         android:layout_width="wrap_content"
227                                         android:layout_gravity="center_horizontal"
228                                         android:textAlignment="center"
229                                         android:textColor="?android:textColorPrimary" />
230                                 </LinearLayout>
231                             </LinearLayout>
232                         </androidx.cardview.widget.CardView>
233                     </LinearLayout>
234                 </ScrollView>
235             </LinearLayout>
236         </androidx.coordinatorlayout.widget.CoordinatorLayout>
237
238         <!-- The navigation drawer. -->
239         <com.google.android.material.navigation.NavigationView
240             android:id="@+id/navigationview"
241             android:layout_height="match_parent"
242             android:layout_width="wrap_content"
243             android:layout_gravity="start"
244             app:menu="@menu/navigation_menu_top_appbar"
245             app:itemIconTint="@color/blue_icon" />
246     </androidx.drawerlayout.widget.DrawerLayout>
247 </FrameLayout>