1 <?xml version="1.0" encoding="utf-8"?>
4 Copyright © 2017-2020 Soren Stoutner <soren@stoutner.com>.
6 This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
8 Privacy Browser 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 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. 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 tools:context="com.stoutner.privacybrowser.activities.ViewSourceActivity"
27 android:layout_height="match_parent"
28 android:layout_width="match_parent"
29 android:focusable="true"
30 android:focusableInTouchMode="true" >
32 <!-- The linear layout with `orientation="vertical"` moves the content below the app bar layout. -->
34 android:layout_height="match_parent"
35 android:layout_width="match_parent"
36 android:orientation="vertical" >
38 <com.google.android.material.appbar.AppBarLayout
39 android:layout_height="wrap_content"
40 android:layout_width="match_parent"
41 android:background="?android:attr/colorBackground" >
43 <!-- The frame layout allows the toolbar and the progress bar to occupy the same space. -->
45 android:layout_height="wrap_content"
46 android:layout_width="match_parent" >
48 <androidx.appcompat.widget.Toolbar
49 android:id="@+id/view_source_toolbar"
50 android:layout_height="wrap_content"
51 android:layout_width="match_parent" />
53 <!-- Android automatically uses a different, skinnier drawable with padding for indeterminate horizontal progress bars in API >= 21.
54 They make this very difficult to override. https://redmine.stoutner.com/issues/241
55 `tools:ignore="UnusedAttribute"` removes the lint warning about `progressTint` and `progressBackgroundTint` not applying to API < 21. -->
57 android:id="@+id/progress_bar"
58 style="?android:attr/progressBarStyleHorizontal"
59 android:layout_height="wrap_content"
60 android:layout_width="match_parent"
61 android:minHeight="3dp"
62 android:layout_gravity="bottom"
63 android:visibility="gone"
64 tools:ignore="UnusedAttribute" />
66 </com.google.android.material.appbar.AppBarLayout>
68 <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
69 android:id="@+id/view_source_swiperefreshlayout"
70 android:layout_height="match_parent"
71 android:layout_width="match_parent">
74 android:layout_height="wrap_content"
75 android:layout_width="match_parent" >
78 android:layout_height="wrap_content"
79 android:layout_width="match_parent"
80 android:orientation="vertical"
81 android:layout_margin="10dp" >
83 <!-- Request headers. -->
85 android:layout_height="wrap_content"
86 android:layout_width="match_parent"
87 android:text="@string/request_headers"
88 android:textAlignment="center"
89 android:textSize="18sp"
90 android:textColor="@color/blue_600"
91 android:textStyle="bold" />
94 android:id="@+id/request_headers"
95 android:layout_height="wrap_content"
96 android:layout_width="match_parent"
97 android:textIsSelectable="true"
98 android:layout_marginBottom="8dp" />
100 <!-- Response message. -->
102 android:layout_height="wrap_content"
103 android:layout_width="match_parent"
104 android:text="@string/response_message"
105 android:textAlignment="center"
106 android:textSize="18sp"
107 android:textColor="@color/blue_600"
108 android:textStyle="bold" />
111 android:id="@+id/response_message"
112 android:layout_height="wrap_content"
113 android:layout_width="match_parent"
114 android:textIsSelectable="true"
115 android:layout_marginBottom="8dp" />
117 <!-- Response headers. -->
119 android:layout_height="wrap_content"
120 android:layout_width="match_parent"
121 android:text="@string/response_headers"
122 android:textAlignment="center"
123 android:textSize="18sp"
124 android:textColor="@color/blue_600"
125 android:textStyle="bold" />
128 android:id="@+id/response_headers"
129 android:layout_height="wrap_content"
130 android:layout_width="match_parent"
131 android:textIsSelectable="true"
132 android:layout_marginBottom="8dp" />
134 <!-- Response body. -->
136 android:layout_height="wrap_content"
137 android:layout_width="match_parent"
138 android:text="@string/response_body"
139 android:textAlignment="center"
140 android:textSize="18sp"
141 android:textColor="@color/blue_600"
142 android:textStyle="bold" />
145 android:id="@+id/response_body"
146 android:layout_height="wrap_content"
147 android:layout_width="match_parent"
148 android:textIsSelectable="true" />
151 </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
153 </androidx.coordinatorlayout.widget.CoordinatorLayout>