]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blob - app/src/main/res/layout/view_headers_bottom_appbar.xml
0b896c71d31b6dc1c0fd54fd3cd97955c418e6d3
[PrivacyBrowserAndroid.git] / app / src / main / res / layout / view_headers_bottom_appbar.xml
1 <?xml version="1.0" encoding="utf-8"?>
2
3 <!--
4   Copyright 2017-2023 Soren Stoutner <soren@stoutner.com>.
5
6   This file is part of Privacy Browser Android <https://www.stoutner.com/privacy-browser-android>.
7
8   Privacy Browser Android is free software: you can redistribute it and/or modify
9   it under the terms of the GNU General Public License as published by
10   the Free Software Foundation, either version 3 of the License, or
11   (at your option) any later version.
12
13   Privacy Browser Android is distributed in the hope that it will be useful,
14   but WITHOUT ANY WARRANTY; without even the implied warranty of
15   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16   GNU General Public License for more details.
17
18   You should have received a copy of the GNU General Public License
19   along with Privacy Browser Android.  If not, see <http://www.gnu.org/licenses/>. -->
20
21 <!-- Setting the layout root to be `focusableInTouchMode` prevents the URL toolbar from stealing focus on launch and opening the keyboard. -->
22 <androidx.coordinatorlayout.widget.CoordinatorLayout
23     android:id="@+id/coordinatorlayout"
24     xmlns:android="http://schemas.android.com/apk/res/android"
25     xmlns:tools="http://schemas.android.com/tools"
26     android:layout_height="match_parent"
27     android:layout_width="match_parent"
28     android:focusable="true"
29     android:focusableInTouchMode="true"
30     xmlns:app="http://schemas.android.com/apk/res-auto">
31
32     <!-- The linear layout with `orientation="vertical"` keeps the content above the app bar layout.  `app:layout_dodgeInsetEdges="bottom"` as a child of a coordinator layout moves the view above snackbars. -->
33     <LinearLayout
34         android:layout_height="match_parent"
35         android:layout_width="match_parent"
36         android:orientation="vertical"
37         app:layout_dodgeInsetEdges="bottom" >
38
39         <!-- `android:layout_weight="1"` causes the swipe refresh layout to fill all the remaining space. -->
40         <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
41             android:id="@+id/swiperefreshlayout"
42             android:layout_height="0dp"
43             android:layout_width="match_parent"
44             android:layout_weight="1">
45
46             <ScrollView
47                 android:id="@+id/scrollview"
48                 android:layout_height="wrap_content"
49                 android:layout_width="match_parent" >
50
51                 <LinearLayout
52                     android:layout_height="wrap_content"
53                     android:layout_width="match_parent"
54                     android:orientation="vertical"
55                     android:layout_margin="10dp" >
56
57                     <!-- SSL information. -->
58                     <TextView
59                         android:id="@+id/ssl_information_title_textview"
60                         android:layout_height="wrap_content"
61                         android:layout_width="match_parent"
62                         android:text="@string/ssl_information"
63                         android:textAlignment="center"
64                         android:textSize="18sp"
65                         android:textColor="@color/blue_text"
66                         android:textStyle="bold" />
67
68                     <TextView
69                         android:id="@+id/ssl_information_textview"
70                         android:layout_height="wrap_content"
71                         android:layout_width="match_parent"
72                         android:textIsSelectable="true"
73                         android:layout_marginBottom="8dp" />
74
75                     <!-- Button row. -->
76                     <LinearLayout
77                         android:layout_height="wrap_content"
78                         android:layout_width="wrap_content"
79                         android:orientation="horizontal"
80                         android:layout_marginBottom="16dp"
81                         android:layout_gravity="center_horizontal" >
82
83                             <Button
84                                 android:id="@+id/ciphers_button"
85                                 android:layout_height="wrap_content"
86                                 android:layout_width="wrap_content"
87                                 android:text="@string/ciphers"
88                                 android:layout_gravity="center_horizontal"
89                                 android:layout_marginEnd="10dp"
90                                 android:onClick="showCiphers"
91                                 app:backgroundTint="@color/button_background_selector"
92                                 android:textColor="@color/button_text_selector"
93                                 tools:ignore="ButtonStyle" />
94
95                             <Button
96                                 android:id="@+id/certificate_button"
97                                 android:layout_height="wrap_content"
98                                 android:layout_width="wrap_content"
99                                 android:text="@string/certificate"
100                                 android:onClick="showCertificate"
101                                 app:backgroundTint="@color/button_background_selector"
102                                 android:textColor="@color/button_text_selector"
103                                 tools:ignore="ButtonStyle" />
104                     </LinearLayout>
105
106                     <!-- Request headers. -->
107                     <TextView
108                         android:id="@+id/request_headers_title_textview"
109                         android:layout_height="wrap_content"
110                         android:layout_width="match_parent"
111                         android:text="@string/request_headers"
112                         android:textAlignment="center"
113                         android:textSize="18sp"
114                         android:textColor="@color/blue_text"
115                         android:textStyle="bold" />
116
117                     <TextView
118                         android:id="@+id/request_headers_textview"
119                         android:layout_height="wrap_content"
120                         android:layout_width="match_parent"
121                         android:textIsSelectable="true"
122                         android:layout_marginBottom="8dp" />
123
124                     <!-- Response message. -->
125                     <TextView
126                         android:id="@+id/response_message_title_textview"
127                         android:layout_height="wrap_content"
128                         android:layout_width="match_parent"
129                         android:text="@string/response_message"
130                         android:textAlignment="center"
131                         android:textSize="18sp"
132                         android:textColor="@color/blue_text"
133                         android:textStyle="bold" />
134
135                     <TextView
136                         android:id="@+id/response_message_textview"
137                         android:layout_height="wrap_content"
138                         android:layout_width="match_parent"
139                         android:textIsSelectable="true"
140                         android:layout_marginBottom="8dp" />
141
142                     <!-- Response headers. -->
143                     <!-- The title text is set programatically. -->
144                     <TextView
145                         android:id="@+id/response_headers_title_textview"
146                         android:layout_height="wrap_content"
147                         android:layout_width="match_parent"
148                         android:textAlignment="center"
149                         android:textSize="18sp"
150                         android:textColor="@color/blue_text"
151                         android:textStyle="bold" />
152
153                     <TextView
154                         android:id="@+id/response_headers_textview"
155                         android:layout_height="wrap_content"
156                         android:layout_width="match_parent"
157                         android:textIsSelectable="true"
158                         android:layout_marginBottom="8dp" />
159
160                     <!-- Response body. -->
161                     <!-- The title text is set programatically. -->
162                     <TextView
163                         android:id="@+id/response_body_title_textview"
164                         android:layout_height="wrap_content"
165                         android:layout_width="match_parent"
166                         android:textAlignment="center"
167                         android:textSize="18sp"
168                         android:textColor="@color/blue_text"
169                         android:textStyle="bold" />
170
171                     <TextView
172                         android:id="@+id/response_body_textview"
173                         android:layout_height="wrap_content"
174                         android:layout_width="match_parent"
175                         android:textIsSelectable="true" />
176                 </LinearLayout>
177             </ScrollView>
178         </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
179
180         <!-- The app bar theme must be specified here because the activity uses a `NoActionBar` theme. -->
181         <com.google.android.material.appbar.AppBarLayout
182             android:layout_height="wrap_content"
183             android:layout_width="match_parent"
184             android:background="?android:attr/colorBackground"
185             android:theme="@style/PrivacyBrowserAppBar" >
186
187             <!-- The frame layout allows the toolbar and the progress bar to occupy the same space. -->
188             <FrameLayout
189                 android:layout_height="wrap_content"
190                 android:layout_width="match_parent" >
191
192                 <androidx.appcompat.widget.Toolbar
193                     android:id="@+id/toolbar"
194                     android:layout_height="wrap_content"
195                     android:layout_width="match_parent" />
196
197                 <!-- Android automatically uses a different, skinnier drawable with padding for indeterminate horizontal progress bars in API >= 21.
198                     They make this very difficult to override.  https://redmine.stoutner.com/issues/241
199                     `tools:ignore="UnusedAttribute"` removes the lint warning about `progressTint` and `progressBackgroundTint` not applying to API < 21. -->
200                 <ProgressBar
201                     android:id="@+id/progress_bar"
202                     style="?android:attr/progressBarStyleHorizontal"
203                     android:layout_height="wrap_content"
204                     android:layout_width="match_parent"
205                     android:minHeight="3dp"
206                     android:layout_gravity="bottom"
207                     android:visibility="gone"
208                     tools:ignore="UnusedAttribute" />
209             </FrameLayout>
210         </com.google.android.material.appbar.AppBarLayout>
211     </LinearLayout>
212 </androidx.coordinatorlayout.widget.CoordinatorLayout>