]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blob - app/src/main/res/layout/view_headers_bottom_appbar.xml
0219c09a1c2f667a348683c45fbab8d671600354
[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-2024 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         <!-- The frame layout allows the swipe refresh layout and the progress bar to occupy the same space. -->
40         <FrameLayout
41             android:layout_height="0dp"
42             android:layout_width="match_parent"
43             android:layout_weight="1" >
44
45             <!-- `android:layout_weight="1"` causes the swipe refresh layout to fill all the remaining space. -->
46             <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
47                 android:id="@+id/swiperefreshlayout"
48                 android:layout_height="match_parent"
49                 android:layout_width="match_parent" >
50
51                 <ScrollView
52                     android:id="@+id/scrollview"
53                     android:layout_height="wrap_content"
54                     android:layout_width="match_parent" >
55
56                     <LinearLayout
57                         android:layout_height="wrap_content"
58                         android:layout_width="match_parent"
59                         android:orientation="vertical"
60                         android:layout_margin="10dp" >
61
62                         <!-- SSL information. -->
63                         <TextView
64                             android:id="@+id/ssl_information_title_textview"
65                             android:layout_height="wrap_content"
66                             android:layout_width="match_parent"
67                             android:text="@string/ssl_information"
68                             android:textAlignment="center"
69                             android:textSize="18sp"
70                             android:textColor="@color/blue_text"
71                             android:textStyle="bold" />
72
73                         <TextView
74                             android:id="@+id/ssl_information_textview"
75                             android:layout_height="wrap_content"
76                             android:layout_width="match_parent"
77                             android:textIsSelectable="true"
78                             android:layout_marginBottom="8dp" />
79
80                         <!-- SSL Buttons. -->
81                         <androidx.constraintlayout.widget.ConstraintLayout
82                             android:id="@+id/ssl_buttons_constraintlayout"
83                             android:layout_height="wrap_content"
84                             android:layout_width="match_parent"
85                             android:layout_marginBottom="16dp"
86                             tools:ignore="MissingConstraints" >
87
88                             <androidx.constraintlayout.helper.widget.Flow
89                                 android:layout_height="wrap_content"
90                                 android:layout_width="match_parent"
91                                 app:constraint_referenced_ids="ciphers_button,certificate_button"
92                                 app:flow_wrapMode="chain"
93                                 app:flow_firstHorizontalStyle="packed"
94                                 app:flow_horizontalGap="15dp" />
95
96                             <androidx.appcompat.widget.AppCompatButton
97                                 android:id="@+id/ciphers_button"
98                                 android:layout_height="wrap_content"
99                                 android:layout_width="wrap_content"
100                                 android:text="@string/ciphers"
101                                 android:onClick="showCiphers"
102                                 app:backgroundTint="@color/button_background_selector"
103                                 android:textColor="@color/button_text_selector"
104                                 tools:ignore="ButtonStyle" />
105
106                             <androidx.appcompat.widget.AppCompatButton
107                                 android:id="@+id/certificate_button"
108                                 android:layout_height="wrap_content"
109                                 android:layout_width="wrap_content"
110                                 android:text="@string/certificate"
111                                 android:onClick="showCertificate"
112                                 app:backgroundTint="@color/button_background_selector"
113                                 android:textColor="@color/button_text_selector"
114                                 tools:ignore="ButtonStyle" />
115                         </androidx.constraintlayout.widget.ConstraintLayout>
116
117                         <!-- Request headers. -->
118                         <TextView
119                             android:id="@+id/request_headers_title_textview"
120                             android:layout_height="wrap_content"
121                             android:layout_width="match_parent"
122                             android:text="@string/request_headers"
123                             android:textAlignment="center"
124                             android:textSize="18sp"
125                             android:textColor="@color/blue_text"
126                             android:textStyle="bold" />
127
128                         <TextView
129                             android:id="@+id/request_headers_textview"
130                             android:layout_height="wrap_content"
131                             android:layout_width="match_parent"
132                             android:textIsSelectable="true"
133                             android:layout_marginBottom="8dp" />
134
135                         <!-- Response message. -->
136                         <TextView
137                             android:id="@+id/response_message_title_textview"
138                             android:layout_height="wrap_content"
139                             android:layout_width="match_parent"
140                             android:text="@string/response_message"
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/response_message_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 headers. -->
154                         <!-- The title text is set programatically. -->
155                         <TextView
156                             android:id="@+id/response_headers_title_textview"
157                             android:layout_height="wrap_content"
158                             android:layout_width="match_parent"
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_headers_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 body. -->
172                         <!-- The title text is set programatically. -->
173                         <TextView
174                             android:id="@+id/response_body_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_body_textview"
184                             android:layout_height="wrap_content"
185                             android:layout_width="match_parent"
186                             android:textIsSelectable="true" />
187                     </LinearLayout>
188                 </ScrollView>
189             </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
190
191             <!-- The progress bar looks best with a minimum height of 3dp for the top app bar and 4dp for the bottom app bar. -->
192             <ProgressBar
193                 android:id="@+id/progress_bar"
194                 style="?android:attr/progressBarStyleHorizontal"
195                 android:layout_height="wrap_content"
196                 android:layout_width="match_parent"
197                 android:layout_gravity="bottom"
198                 android:minHeight="4dp"
199                 android:progressTint="@color/blue_text"
200                 android:progressBackgroundTint="@color/transparent"
201                 android:background="?android:attr/colorBackground"
202                 android:visibility="gone" />
203         </FrameLayout>
204
205         <!-- The app bar theme must be specified here because the activity uses a `NoActionBar` theme. -->
206         <com.google.android.material.appbar.AppBarLayout
207             android:layout_height="wrap_content"
208             android:layout_width="match_parent"
209             android:background="?android:attr/colorBackground"
210             android:theme="@style/PrivacyBrowserAppBar" >
211
212             <androidx.appcompat.widget.Toolbar
213                 android:id="@+id/toolbar"
214                 android:layout_height="wrap_content"
215                 android:layout_width="match_parent" />
216         </com.google.android.material.appbar.AppBarLayout>
217     </LinearLayout>
218 </androidx.coordinatorlayout.widget.CoordinatorLayout>