]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blob - app/src/main/res/layout/view_headers_top_appbar.xml
First wrong button text in View Headers in night theme. https://redmine.stoutner...
[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-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: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             <androidx.appcompat.widget.Toolbar
46                 android:id="@+id/toolbar"
47                 android:layout_height="wrap_content"
48                 android:layout_width="match_parent" />
49         </com.google.android.material.appbar.AppBarLayout>
50
51         <!-- The frame layout allows the progress bar and the swipe refresh layout to occupy the same space. -->
52         <FrameLayout
53             android:layout_height="wrap_content"
54             android:layout_width="match_parent" >
55
56             <!-- The progress bar looks best with a minimum height of 3dp for the top app bar and 4dp for the bottom app bar. -->
57             <ProgressBar
58                 android:id="@+id/progress_bar"
59                 style="?android:attr/progressBarStyleHorizontal"
60                 android:layout_height="wrap_content"
61                 android:layout_width="match_parent"
62                 android:layout_gravity="top"
63                 android:minHeight="3dp"
64                 android:progressTint="@color/blue_text"
65                 android:progressBackgroundTint="@color/transparent"
66                 android:visibility="gone" />
67
68             <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
69                 android:id="@+id/swiperefreshlayout"
70                 android:layout_height="match_parent"
71                 android:layout_width="match_parent">
72
73                 <ScrollView
74                     android:id="@+id/view_source_scrollview"
75                     android:layout_height="wrap_content"
76                     android:layout_width="match_parent" >
77
78                     <LinearLayout
79                         android:layout_height="wrap_content"
80                         android:layout_width="match_parent"
81                         android:orientation="vertical"
82                         android:layout_margin="10dp" >
83
84                         <!-- SSL information. -->
85                         <TextView
86                             android:id="@+id/ssl_information_title_textview"
87                             android:layout_height="wrap_content"
88                             android:layout_width="match_parent"
89                             android:text="@string/ssl_information"
90                             android:textAlignment="center"
91                             android:textSize="18sp"
92                             android:textColor="@color/blue_text"
93                             android:textStyle="bold" />
94
95                         <TextView
96                             android:id="@+id/ssl_information_textview"
97                             android:layout_height="wrap_content"
98                             android:layout_width="match_parent"
99                             android:textIsSelectable="true"
100                             android:layout_marginBottom="8dp" />
101
102                         <!-- SSL Buttons. -->
103                         <androidx.constraintlayout.widget.ConstraintLayout
104                             android:id="@+id/ssl_buttons_constraintlayout"
105                             android:layout_height="wrap_content"
106                             android:layout_width="match_parent"
107                             android:layout_marginBottom="16dp"
108                             tools:ignore="MissingConstraints" >
109
110                             <androidx.constraintlayout.helper.widget.Flow
111                                 android:layout_height="wrap_content"
112                                 android:layout_width="match_parent"
113                                 app:constraint_referenced_ids="ciphers_button,certificate_button"
114                                 app:flow_wrapMode="chain"
115                                 app:flow_firstHorizontalStyle="packed"
116                                 app:flow_horizontalGap="15dp" />
117
118                             <androidx.appcompat.widget.AppCompatButton
119                                 android:id="@+id/ciphers_button"
120                                 android:layout_height="wrap_content"
121                                 android:layout_width="wrap_content"
122                                 android:text="@string/ciphers"
123                                 android:onClick="showCiphers"
124                                 app:backgroundTint="@color/button_background_selector"
125                                 android:textColor="@color/white"
126                                 tools:ignore="ButtonStyle" />
127
128                             <androidx.appcompat.widget.AppCompatButton
129                                 android:id="@+id/certificate_button"
130                                 android:layout_height="wrap_content"
131                                 android:layout_width="wrap_content"
132                                 android:text="@string/certificate"
133                                 android:onClick="showCertificate"
134                                 app:backgroundTint="@color/button_background_selector"
135                                 android:textColor="@color/white"
136                                 tools:ignore="ButtonStyle" />
137                         </androidx.constraintlayout.widget.ConstraintLayout>
138
139                         <!-- Request headers. -->
140                         <TextView
141                             android:id="@+id/request_headers_title_textview"
142                             android:layout_height="wrap_content"
143                             android:layout_width="match_parent"
144                             android:text="@string/request_headers"
145                             android:textAlignment="center"
146                             android:textSize="18sp"
147                             android:textColor="@color/blue_text"
148                             android:textStyle="bold" />
149
150                         <TextView
151                             android:id="@+id/request_headers_textview"
152                             android:layout_height="wrap_content"
153                             android:layout_width="match_parent"
154                             android:textIsSelectable="true"
155                             android:layout_marginBottom="8dp" />
156
157                         <!-- Response message. -->
158                         <TextView
159                             android:id="@+id/response_message_title_textview"
160                             android:layout_height="wrap_content"
161                             android:layout_width="match_parent"
162                             android:text="@string/response_message"
163                             android:textAlignment="center"
164                             android:textSize="18sp"
165                             android:textColor="@color/blue_text"
166                             android:textStyle="bold" />
167
168                         <TextView
169                             android:id="@+id/response_message_textview"
170                             android:layout_height="wrap_content"
171                             android:layout_width="match_parent"
172                             android:textIsSelectable="true"
173                             android:layout_marginBottom="8dp" />
174
175                         <!-- Response headers. -->
176                         <!-- The title text is set programatically. -->
177                         <TextView
178                             android:id="@+id/response_headers_title_textview"
179                             android:layout_height="wrap_content"
180                             android:layout_width="match_parent"
181                             android:textAlignment="center"
182                             android:textSize="18sp"
183                             android:textColor="@color/blue_text"
184                             android:textStyle="bold" />
185
186                         <TextView
187                             android:id="@+id/response_headers_textview"
188                             android:layout_height="wrap_content"
189                             android:layout_width="match_parent"
190                             android:textIsSelectable="true"
191                             android:layout_marginBottom="8dp" />
192
193                         <!-- Response body. -->
194                         <!-- The title text is set programatically. -->
195                         <TextView
196                             android:id="@+id/response_body_title_textview"
197                             android:layout_height="wrap_content"
198                             android:layout_width="match_parent"
199                             android:textAlignment="center"
200                             android:textSize="18sp"
201                             android:textColor="@color/blue_text"
202                             android:textStyle="bold" />
203
204                         <TextView
205                             android:id="@+id/response_body_textview"
206                             android:layout_height="wrap_content"
207                             android:layout_width="match_parent"
208                             android:textIsSelectable="true" />
209                     </LinearLayout>
210                 </ScrollView>
211             </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
212         </FrameLayout>
213     </LinearLayout>
214 </androidx.coordinatorlayout.widget.CoordinatorLayout>