1 <?xml version="1.0" encoding="utf-8"?>
4 Copyright 2017-2023 Soren Stoutner <soren@stoutner.com>.
6 This file is part of Privacy Browser Android <https://www.stoutner.com/privacy-browser-android>.
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.
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.
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/>. -->
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">
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. -->
34 android:layout_height="match_parent"
35 android:layout_width="match_parent"
36 android:orientation="vertical"
37 app:layout_dodgeInsetEdges="bottom" >
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">
47 android:id="@+id/scrollview"
48 android:layout_height="wrap_content"
49 android:layout_width="match_parent" >
52 android:layout_height="wrap_content"
53 android:layout_width="match_parent"
54 android:orientation="vertical"
55 android:layout_margin="10dp" >
57 <!-- SSL information. -->
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" />
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" />
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" >
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" />
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" />
106 <!-- Request headers. -->
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" />
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" />
124 <!-- Response message. -->
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" />
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" />
142 <!-- Response headers. -->
143 <!-- The title text is set programatically. -->
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" />
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" />
160 <!-- Response body. -->
161 <!-- The title text is set programatically. -->
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" />
172 android:id="@+id/response_body_textview"
173 android:layout_height="wrap_content"
174 android:layout_width="match_parent"
175 android:textIsSelectable="true" />
178 </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
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" >
187 <!-- The frame layout allows the toolbar and the progress bar to occupy the same space. -->
189 android:layout_height="wrap_content"
190 android:layout_width="match_parent" >
192 <androidx.appcompat.widget.Toolbar
193 android:id="@+id/toolbar"
194 android:layout_height="wrap_content"
195 android:layout_width="match_parent" />
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. -->
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" />
210 </com.google.android.material.appbar.AppBarLayout>
212 </androidx.coordinatorlayout.widget.CoordinatorLayout>