]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blob - app/src/main/res/layout/view_headers_top_appbar.xml
Add a flow layout to the Headers SSL buttons.
[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                     <!-- SSL Buttons. -->
105                     <androidx.constraintlayout.widget.ConstraintLayout
106                         android:id="@+id/ssl_buttons_constraintlayout"
107                         android:layout_height="wrap_content"
108                         android:layout_width="match_parent"
109                         android:layout_marginBottom="16dp"
110                         tools:ignore="MissingConstraints" >
111
112                         <androidx.constraintlayout.helper.widget.Flow
113                             android:layout_height="wrap_content"
114                             android:layout_width="match_parent"
115                             app:constraint_referenced_ids="ciphers_button,certificate_button"
116                             app:flow_wrapMode="chain"
117                             app:flow_firstHorizontalStyle="packed"
118                             app:flow_horizontalGap="15dp" />
119
120                         <androidx.appcompat.widget.AppCompatButton
121                             android:id="@+id/ciphers_button"
122                             android:layout_height="wrap_content"
123                             android:layout_width="wrap_content"
124                             android:text="@string/ciphers"
125                             android:onClick="showCiphers"
126                             app:backgroundTint="@color/button_background_selector"
127                             android:textColor="@color/button_text_selector"
128                             tools:ignore="ButtonStyle" />
129
130                         <androidx.appcompat.widget.AppCompatButton
131                             android:id="@+id/certificate_button"
132                             android:layout_height="wrap_content"
133                             android:layout_width="wrap_content"
134                             android:text="@string/certificate"
135                             android:onClick="showCertificate"
136                             app:backgroundTint="@color/button_background_selector"
137                             android:textColor="@color/button_text_selector"
138                             tools:ignore="ButtonStyle" />
139                     </androidx.constraintlayout.widget.ConstraintLayout>
140
141                     <!-- Request headers. -->
142                     <TextView
143                         android:id="@+id/request_headers_title_textview"
144                         android:layout_height="wrap_content"
145                         android:layout_width="match_parent"
146                         android:text="@string/request_headers"
147                         android:textAlignment="center"
148                         android:textSize="18sp"
149                         android:textColor="@color/blue_text"
150                         android:textStyle="bold" />
151
152                     <TextView
153                         android:id="@+id/request_headers_textview"
154                         android:layout_height="wrap_content"
155                         android:layout_width="match_parent"
156                         android:textIsSelectable="true"
157                         android:layout_marginBottom="8dp" />
158
159                     <!-- Response message. -->
160                     <TextView
161                         android:id="@+id/response_message_title_textview"
162                         android:layout_height="wrap_content"
163                         android:layout_width="match_parent"
164                         android:text="@string/response_message"
165                         android:textAlignment="center"
166                         android:textSize="18sp"
167                         android:textColor="@color/blue_text"
168                         android:textStyle="bold" />
169
170                     <TextView
171                         android:id="@+id/response_message_textview"
172                         android:layout_height="wrap_content"
173                         android:layout_width="match_parent"
174                         android:textIsSelectable="true"
175                         android:layout_marginBottom="8dp" />
176
177                     <!-- Response headers. -->
178                     <!-- The title text is set programatically. -->
179                     <TextView
180                         android:id="@+id/response_headers_title_textview"
181                         android:layout_height="wrap_content"
182                         android:layout_width="match_parent"
183                         android:textAlignment="center"
184                         android:textSize="18sp"
185                         android:textColor="@color/blue_text"
186                         android:textStyle="bold" />
187
188                     <TextView
189                         android:id="@+id/response_headers_textview"
190                         android:layout_height="wrap_content"
191                         android:layout_width="match_parent"
192                         android:textIsSelectable="true"
193                         android:layout_marginBottom="8dp" />
194
195                     <!-- Response body. -->
196                     <!-- The title text is set programatically. -->
197                     <TextView
198                         android:id="@+id/response_body_title_textview"
199                         android:layout_height="wrap_content"
200                         android:layout_width="match_parent"
201                         android:textAlignment="center"
202                         android:textSize="18sp"
203                         android:textColor="@color/blue_text"
204                         android:textStyle="bold" />
205
206                     <TextView
207                         android:id="@+id/response_body_textview"
208                         android:layout_height="wrap_content"
209                         android:layout_width="match_parent"
210                         android:textIsSelectable="true" />
211                 </LinearLayout>
212             </ScrollView>
213         </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
214     </LinearLayout>
215 </androidx.coordinatorlayout.widget.CoordinatorLayout>