]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blob - app/src/main/res/layout/view_source_bottom_appbar.xml
First wrong button text in View Headers in night theme. https://redmine.stoutner...
[PrivacyBrowserAndroid.git] / app / src / main / res / layout / view_source_bottom_appbar.xml
1 <?xml version="1.0" encoding="utf-8"?>
2
3 <!--
4   Copyright 2017-2022 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/view_source_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         <!-- `android:layout_weight="1"` causes the swipe refresh layout to fill all the remaining space. -->
40         <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
41             android:id="@+id/view_source_swiperefreshlayout"
42             android:layout_height="0dp"
43             android:layout_width="match_parent"
44             android:layout_weight="1">
45
46             <ScrollView
47                 android:id="@+id/view_source_scrollview"
48                 android:layout_height="wrap_content"
49                 android:layout_width="match_parent" >
50
51                 <LinearLayout
52                     android:layout_height="wrap_content"
53                     android:layout_width="match_parent"
54                     android:orientation="vertical"
55                     android:layout_margin="10dp" >
56
57                     <!-- Request headers. -->
58                     <TextView
59                         android:id="@+id/request_headers_title_textview"
60                         android:layout_height="wrap_content"
61                         android:layout_width="match_parent"
62                         android:text="@string/request_headers"
63                         android:textAlignment="center"
64                         android:textSize="18sp"
65                         android:textColor="@color/blue_text"
66                         android:textStyle="bold" />
67
68                     <TextView
69                         android:id="@+id/request_headers_textview"
70                         android:layout_height="wrap_content"
71                         android:layout_width="match_parent"
72                         android:textIsSelectable="true"
73                         android:layout_marginBottom="8dp" />
74
75                     <!-- Response message. -->
76                     <TextView
77                         android:id="@+id/response_message_title_textview"
78                         android:layout_height="wrap_content"
79                         android:layout_width="match_parent"
80                         android:text="@string/response_message"
81                         android:textAlignment="center"
82                         android:textSize="18sp"
83                         android:textColor="@color/blue_text"
84                         android:textStyle="bold" />
85
86                     <TextView
87                         android:id="@+id/response_message_textview"
88                         android:layout_height="wrap_content"
89                         android:layout_width="match_parent"
90                         android:textIsSelectable="true"
91                         android:layout_marginBottom="8dp" />
92
93                     <!-- Response headers. -->
94                     <!-- The title text is set programatically. -->
95                     <TextView
96                         android:id="@+id/response_headers_title_textview"
97                         android:layout_height="wrap_content"
98                         android:layout_width="match_parent"
99                         android:textAlignment="center"
100                         android:textSize="18sp"
101                         android:textColor="@color/blue_text"
102                         android:textStyle="bold" />
103
104                     <TextView
105                         android:id="@+id/response_headers_textview"
106                         android:layout_height="wrap_content"
107                         android:layout_width="match_parent"
108                         android:textIsSelectable="true"
109                         android:layout_marginBottom="8dp" />
110
111                     <!-- Response body. -->
112                     <!-- The title text is set programatically. -->
113                     <TextView
114                         android:id="@+id/response_body_title_textview"
115                         android:layout_height="wrap_content"
116                         android:layout_width="match_parent"
117                         android:textAlignment="center"
118                         android:textSize="18sp"
119                         android:textColor="@color/blue_text"
120                         android:textStyle="bold" />
121
122                     <TextView
123                         android:id="@+id/response_body_textview"
124                         android:layout_height="wrap_content"
125                         android:layout_width="match_parent"
126                         android:textIsSelectable="true" />
127                 </LinearLayout>
128             </ScrollView>
129         </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
130
131         <!-- The app bar theme must be specified here because the activity uses a `NoActionBar` theme. -->
132         <com.google.android.material.appbar.AppBarLayout
133             android:layout_height="wrap_content"
134             android:layout_width="match_parent"
135             android:background="?android:attr/colorBackground"
136             android:theme="@style/PrivacyBrowserAppBar" >
137
138             <!-- The frame layout allows the toolbar and the progress bar to occupy the same space. -->
139             <FrameLayout
140                 android:layout_height="wrap_content"
141                 android:layout_width="match_parent" >
142
143                 <androidx.appcompat.widget.Toolbar
144                     android:id="@+id/view_source_toolbar"
145                     android:layout_height="wrap_content"
146                     android:layout_width="match_parent" />
147
148                 <!-- Android automatically uses a different, skinnier drawable with padding for indeterminate horizontal progress bars in API >= 21.
149                     They make this very difficult to override.  https://redmine.stoutner.com/issues/241
150                     `tools:ignore="UnusedAttribute"` removes the lint warning about `progressTint` and `progressBackgroundTint` not applying to API < 21. -->
151                 <ProgressBar
152                     android:id="@+id/progress_bar"
153                     style="?android:attr/progressBarStyleHorizontal"
154                     android:layout_height="wrap_content"
155                     android:layout_width="match_parent"
156                     android:minHeight="3dp"
157                     android:layout_gravity="bottom"
158                     android:visibility="gone"
159                     tools:ignore="UnusedAttribute" />
160             </FrameLayout>
161         </com.google.android.material.appbar.AppBarLayout>
162     </LinearLayout>
163 </androidx.coordinatorlayout.widget.CoordinatorLayout>