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:id="@+id/view_source_scrollview"
75 android:layout_height="wrap_content"
76 android:layout_width="match_parent" >
79 android:layout_height="wrap_content"
80 android:layout_width="match_parent"
81 android:orientation="vertical"
82 android:layout_margin="10dp" >
84 <!-- Request headers. -->
86 android:layout_height="wrap_content"
87 android:layout_width="match_parent"
88 android:text="@string/request_headers"
89 android:textAlignment="center"
90 android:textSize="18sp"
91 android:textColor="?attr/blueTextColor"
92 android:textStyle="bold" />
95 android:id="@+id/request_headers"
96 android:layout_height="wrap_content"
97 android:layout_width="match_parent"
98 android:textIsSelectable="true"
99 android:layout_marginBottom="8dp" />
101 <!-- Response message. -->
103 android:layout_height="wrap_content"
104 android:layout_width="match_parent"
105 android:text="@string/response_message"
106 android:textAlignment="center"
107 android:textSize="18sp"
108 android:textColor="?attr/blueTextColor"
109 android:textStyle="bold" />
112 android:id="@+id/response_message"
113 android:layout_height="wrap_content"
114 android:layout_width="match_parent"
115 android:textIsSelectable="true"
116 android:layout_marginBottom="8dp" />
118 <!-- Response headers. -->
120 android:layout_height="wrap_content"
121 android:layout_width="match_parent"
122 android:text="@string/response_headers"
123 android:textAlignment="center"
124 android:textSize="18sp"
125 android:textColor="?attr/blueTextColor"
126 android:textStyle="bold" />
129 android:id="@+id/response_headers"
130 android:layout_height="wrap_content"
131 android:layout_width="match_parent"
132 android:textIsSelectable="true"
133 android:layout_marginBottom="8dp" />
135 <!-- Response body. -->
137 android:layout_height="wrap_content"
138 android:layout_width="match_parent"
139 android:text="@string/response_body"
140 android:textAlignment="center"
141 android:textSize="18sp"
142 android:textColor="?attr/blueTextColor"
143 android:textStyle="bold" />
146 android:id="@+id/response_body"
147 android:layout_height="wrap_content"
148 android:layout_width="match_parent"
149 android:textIsSelectable="true" />
152 </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
154 </androidx.coordinatorlayout.widget.CoordinatorLayout>