]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blob - app/src/main/res/layout/view_headers_top_appbar.xml
Display SSL information in View Headers. https://redmine.stoutner.com/issues/706
[PrivacyBrowserAndroid.git] / app / src / main / res / layout / view_headers_top_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:app="http://schemas.android.com/apk/res-auto"
26     xmlns:tools="http://schemas.android.com/tools"
27     android:layout_height="match_parent"
28     android:layout_width="match_parent"
29     android:focusable="true"
30     android:focusableInTouchMode="true" >
31
32     <!-- The linear layout with `orientation="vertical"` moves the content below the app bar layout. -->
33     <LinearLayout
34         android:layout_height="match_parent"
35         android:layout_width="match_parent"
36         android:orientation="vertical" >
37
38         <!-- The app bar theme must be specified here because the activity uses a `NoActionBar` theme. -->
39         <com.google.android.material.appbar.AppBarLayout
40             android:layout_height="wrap_content"
41             android:layout_width="match_parent"
42             android:background="?android:attr/colorBackground"
43             android:theme="@style/PrivacyBrowserAppBar" >
44
45             <!-- The frame layout allows the toolbar and the progress bar to occupy the same space. -->
46             <FrameLayout
47                 android:layout_height="wrap_content"
48                 android:layout_width="match_parent" >
49
50                 <androidx.appcompat.widget.Toolbar
51                     android:id="@+id/toolbar"
52                     android:layout_height="wrap_content"
53                     android:layout_width="match_parent" />
54
55                 <!-- Android automatically uses a different, skinnier drawable with padding for indeterminate horizontal progress bars in API >= 21.
56                     They make this very difficult to override.  https://redmine.stoutner.com/issues/241
57                     `tools:ignore="UnusedAttribute"` removes the lint warning about `progressTint` and `progressBackgroundTint` not applying to API < 21. -->
58                 <ProgressBar
59                     android:id="@+id/progress_bar"
60                     style="?android:attr/progressBarStyleHorizontal"
61                     android:layout_height="wrap_content"
62                     android:layout_width="match_parent"
63                     android:minHeight="3dp"
64                     android:layout_gravity="bottom"
65                     android:visibility="gone"
66                     tools:ignore="UnusedAttribute" />
67             </FrameLayout>
68         </com.google.android.material.appbar.AppBarLayout>
69
70         <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
71             android:id="@+id/swiperefreshlayout"
72             android:layout_height="match_parent"
73             android:layout_width="match_parent">
74
75             <ScrollView
76                 android:id="@+id/view_source_scrollview"
77                 android:layout_height="wrap_content"
78                 android:layout_width="match_parent" >
79
80                 <LinearLayout
81                     android:layout_height="wrap_content"
82                     android:layout_width="match_parent"
83                     android:orientation="vertical"
84                     android:layout_margin="10dp" >
85
86                     <!-- SSL information. -->
87                     <TextView
88                         android:id="@+id/ssl_information_title_textview"
89                         android:layout_height="wrap_content"
90                         android:layout_width="match_parent"
91                         android:text="@string/ssl_information"
92                         android:textAlignment="center"
93                         android:textSize="18sp"
94                         android:textColor="@color/blue_text"
95                         android:textStyle="bold" />
96
97                     <TextView
98                         android:id="@+id/ssl_information_textview"
99                         android:layout_height="wrap_content"
100                         android:layout_width="match_parent"
101                         android:textIsSelectable="true"
102                         android:layout_marginBottom="8dp" />
103
104                     <!-- Button row. -->
105                     <LinearLayout
106                         android:layout_height="wrap_content"
107                         android:layout_width="wrap_content"
108                         android:orientation="horizontal"
109                         android:layout_marginBottom="16dp"
110                         android:layout_gravity="center_horizontal" >
111
112                         <Button
113                             android:id="@+id/ciphers_button"
114                             android:layout_height="wrap_content"
115                             android:layout_width="wrap_content"
116                             android:text="@string/ciphers"
117                             android:layout_gravity="center_horizontal"
118                             android:layout_marginEnd="10dp"
119                             android:onClick="showCiphers"
120                             app:backgroundTint="@color/button_background_selector"
121                             android:textColor="@color/button_text_selector"
122                             tools:ignore="ButtonStyle" />
123
124                         <Button
125                             android:id="@+id/certificate_button"
126                             android:layout_height="wrap_content"
127                             android:layout_width="wrap_content"
128                             android:text="@string/certificate"
129                             android:onClick="showCertificate"
130                             app:backgroundTint="@color/button_background_selector"
131                             android:textColor="@color/button_text_selector"
132                             tools:ignore="ButtonStyle" />
133                     </LinearLayout>
134
135                     <!-- Request headers. -->
136                     <TextView
137                         android:id="@+id/request_headers_title_textview"
138                         android:layout_height="wrap_content"
139                         android:layout_width="match_parent"
140                         android:text="@string/request_headers"
141                         android:textAlignment="center"
142                         android:textSize="18sp"
143                         android:textColor="@color/blue_text"
144                         android:textStyle="bold" />
145
146                     <TextView
147                         android:id="@+id/request_headers_textview"
148                         android:layout_height="wrap_content"
149                         android:layout_width="match_parent"
150                         android:textIsSelectable="true"
151                         android:layout_marginBottom="8dp" />
152
153                     <!-- Response message. -->
154                     <TextView
155                         android:id="@+id/response_message_title_textview"
156                         android:layout_height="wrap_content"
157                         android:layout_width="match_parent"
158                         android:text="@string/response_message"
159                         android:textAlignment="center"
160                         android:textSize="18sp"
161                         android:textColor="@color/blue_text"
162                         android:textStyle="bold" />
163
164                     <TextView
165                         android:id="@+id/response_message_textview"
166                         android:layout_height="wrap_content"
167                         android:layout_width="match_parent"
168                         android:textIsSelectable="true"
169                         android:layout_marginBottom="8dp" />
170
171                     <!-- Response headers. -->
172                     <!-- The title text is set programatically. -->
173                     <TextView
174                         android:id="@+id/response_headers_title_textview"
175                         android:layout_height="wrap_content"
176                         android:layout_width="match_parent"
177                         android:textAlignment="center"
178                         android:textSize="18sp"
179                         android:textColor="@color/blue_text"
180                         android:textStyle="bold" />
181
182                     <TextView
183                         android:id="@+id/response_headers_textview"
184                         android:layout_height="wrap_content"
185                         android:layout_width="match_parent"
186                         android:textIsSelectable="true"
187                         android:layout_marginBottom="8dp" />
188
189                     <!-- Response body. -->
190                     <!-- The title text is set programatically. -->
191                     <TextView
192                         android:id="@+id/response_body_title_textview"
193                         android:layout_height="wrap_content"
194                         android:layout_width="match_parent"
195                         android:textAlignment="center"
196                         android:textSize="18sp"
197                         android:textColor="@color/blue_text"
198                         android:textStyle="bold" />
199
200                     <TextView
201                         android:id="@+id/response_body_textview"
202                         android:layout_height="wrap_content"
203                         android:layout_width="match_parent"
204                         android:textIsSelectable="true" />
205                 </LinearLayout>
206             </ScrollView>
207         </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
208     </LinearLayout>
209 </androidx.coordinatorlayout.widget.CoordinatorLayout>