1 <?xml version="1.0" encoding="utf-8"?>
4 Copyright 2017-2022 Soren Stoutner <soren@stoutner.com>.
6 This file is part of Privacy Browser Android <https://www.stoutner.com/privacy-browser-android>.
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.
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.
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/>. -->
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">
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. -->
34 android:layout_height="match_parent"
35 android:layout_width="match_parent"
36 android:orientation="vertical"
37 app:layout_dodgeInsetEdges="bottom" >
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">
47 android:id="@+id/view_source_scrollview"
48 android:layout_height="wrap_content"
49 android:layout_width="match_parent" >
52 android:layout_height="wrap_content"
53 android:layout_width="match_parent"
54 android:orientation="vertical"
55 android:layout_margin="10dp" >
57 <!-- Request headers. -->
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" />
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" />
75 <!-- Response message. -->
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" />
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" />
93 <!-- Response headers. -->
94 <!-- The title text is set programatically. -->
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" />
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" />
111 <!-- Response body. -->
112 <!-- The title text is set programatically. -->
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" />
123 android:id="@+id/response_body_textview"
124 android:layout_height="wrap_content"
125 android:layout_width="match_parent"
126 android:textIsSelectable="true" />
129 </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
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" >
138 <!-- The frame layout allows the toolbar and the progress bar to occupy the same space. -->
140 android:layout_height="wrap_content"
141 android:layout_width="match_parent" >
143 <androidx.appcompat.widget.Toolbar
144 android:id="@+id/view_source_toolbar"
145 android:layout_height="wrap_content"
146 android:layout_width="match_parent" />
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. -->
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" />
161 </com.google.android.material.appbar.AppBarLayout>
163 </androidx.coordinatorlayout.widget.CoordinatorLayout>