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 android:layout_height="match_parent"
27 android:layout_width="match_parent"
28 android:focusable="true"
29 android:focusableInTouchMode="true" >
31 <!-- The linear layout with `orientation="vertical"` moves the content below the app bar layout. -->
33 android:layout_height="match_parent"
34 android:layout_width="match_parent"
35 android:orientation="vertical" >
37 <!-- The app bar theme must be specified here because the activity uses a `NoActionBar` theme. -->
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"
42 android:theme="@style/PrivacyBrowserAppBar" >
44 <!-- The frame layout allows the toolbar and the progress bar to occupy the same space. -->
46 android:layout_height="wrap_content"
47 android:layout_width="match_parent" >
49 <androidx.appcompat.widget.Toolbar
50 android:id="@+id/view_source_toolbar"
51 android:layout_height="wrap_content"
52 android:layout_width="match_parent" />
54 <!-- Android automatically uses a different, skinnier drawable with padding for indeterminate horizontal progress bars in API >= 21.
55 They make this very difficult to override. https://redmine.stoutner.com/issues/241
56 `tools:ignore="UnusedAttribute"` removes the lint warning about `progressTint` and `progressBackgroundTint` not applying to API < 21. -->
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:minHeight="3dp"
63 android:layout_gravity="bottom"
64 android:visibility="gone"
65 tools:ignore="UnusedAttribute" />
67 </com.google.android.material.appbar.AppBarLayout>
69 <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
70 android:id="@+id/view_source_swiperefreshlayout"
71 android:layout_height="match_parent"
72 android:layout_width="match_parent">
75 android:id="@+id/view_source_scrollview"
76 android:layout_height="wrap_content"
77 android:layout_width="match_parent" >
80 android:layout_height="wrap_content"
81 android:layout_width="match_parent"
82 android:orientation="vertical"
83 android:layout_margin="10dp" >
85 <!-- Request headers. -->
87 android:layout_height="wrap_content"
88 android:layout_width="match_parent"
89 android:text="@string/request_headers"
90 android:textAlignment="center"
91 android:textSize="18sp"
92 android:textColor="?attr/blueTextColor"
93 android:textStyle="bold" />
96 android:id="@+id/request_headers"
97 android:layout_height="wrap_content"
98 android:layout_width="match_parent"
99 android:textIsSelectable="true"
100 android:layout_marginBottom="8dp" />
102 <!-- Response message. -->
104 android:layout_height="wrap_content"
105 android:layout_width="match_parent"
106 android:text="@string/response_message"
107 android:textAlignment="center"
108 android:textSize="18sp"
109 android:textColor="?attr/blueTextColor"
110 android:textStyle="bold" />
113 android:id="@+id/response_message"
114 android:layout_height="wrap_content"
115 android:layout_width="match_parent"
116 android:textIsSelectable="true"
117 android:layout_marginBottom="8dp" />
119 <!-- Response headers. -->
121 android:layout_height="wrap_content"
122 android:layout_width="match_parent"
123 android:text="@string/response_headers"
124 android:textAlignment="center"
125 android:textSize="18sp"
126 android:textColor="?attr/blueTextColor"
127 android:textStyle="bold" />
130 android:id="@+id/response_headers"
131 android:layout_height="wrap_content"
132 android:layout_width="match_parent"
133 android:textIsSelectable="true"
134 android:layout_marginBottom="8dp" />
136 <!-- Response body. -->
138 android:layout_height="wrap_content"
139 android:layout_width="match_parent"
140 android:text="@string/response_body"
141 android:textAlignment="center"
142 android:textSize="18sp"
143 android:textColor="?attr/blueTextColor"
144 android:textStyle="bold" />
147 android:id="@+id/response_body"
148 android:layout_height="wrap_content"
149 android:layout_width="match_parent"
150 android:textIsSelectable="true" />
153 </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
155 </androidx.coordinatorlayout.widget.CoordinatorLayout>