1 <?xml version="1.0" encoding="utf-8"?>
4 Copyright © 2017-2019 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 <!-- `android:fitsSystemWindows="true"` moves the AppBar below the status bar. When it is specified the theme should include `<item name="android:windowTranslucentStatus">true</item>` to make the status bar a transparent, darkened overlay.
22 Setting the layout root to be `focusableInTouchMode` prevents the URL toolbar from stealing focus on launch and opening the keyboard. -->
23 <androidx.coordinatorlayout.widget.CoordinatorLayout
24 android:id="@+id/view_source_coordinatorlayout"
25 xmlns:android="http://schemas.android.com/apk/res/android"
26 xmlns:tools="http://schemas.android.com/tools"
27 tools:context="com.stoutner.privacybrowser.activities.ViewSourceActivity"
28 android:layout_height="match_parent"
29 android:layout_width="match_parent"
30 android:fitsSystemWindows="true"
31 android:focusable="true"
32 android:focusableInTouchMode="true" >
34 <!-- The `LinearLayout` with `orientation="vertical"` moves the content below the app bar layout. -->
36 android:layout_height="match_parent"
37 android:layout_width="match_parent"
38 android:orientation="vertical" >
40 <!-- The `AppBarLayout` theme has to be defined here because the activity uses a `NoActionBar` theme. -->
41 <com.google.android.material.appbar.AppBarLayout
42 android:layout_height="wrap_content"
43 android:layout_width="match_parent"
44 android:theme="@style/PrivacyBrowserAppBarLight" >
46 <!-- The `FrameLayout` allows the toolbar and the progress bar to occupy the same space. -->
48 android:layout_height="wrap_content"
49 android:layout_width="match_parent" >
51 <androidx.appcompat.widget.Toolbar
52 android:id="@+id/view_source_toolbar"
53 android:layout_height="wrap_content"
54 android:layout_width="match_parent" />
56 <!-- Android automatically uses a different, skinnier drawable with padding for indeterminate horizontal progress bars in API >= 21.
57 They make this very difficult to override. https://redmine.stoutner.com/issues/241
58 `tools:ignore="UnusedAttribute"` removes the lint warning about `progressTint` and `progressBackgroundTint` not applying to API < 21. -->
60 android:id="@+id/progress_bar"
61 style="?android:attr/progressBarStyleHorizontal"
62 android:layout_height="wrap_content"
63 android:layout_width="match_parent"
64 android:minHeight="3dp"
65 android:layout_gravity="bottom"
66 android:visibility="gone"
67 tools:ignore="UnusedAttribute" />
69 </com.google.android.material.appbar.AppBarLayout>
71 <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
72 android:id="@+id/view_source_swiperefreshlayout"
73 android:layout_height="match_parent"
74 android:layout_width="match_parent">
77 android:layout_height="wrap_content"
78 android:layout_width="match_parent" >
81 android:layout_height="wrap_content"
82 android:layout_width="match_parent"
83 android:orientation="vertical"
84 android:layout_margin="10dp" >
86 <!-- Request headers. -->
88 android:layout_height="wrap_content"
89 android:layout_width="match_parent"
90 android:text="@string/request_headers"
91 android:textAlignment="center"
92 android:textSize="18sp"
93 android:textColor="@color/blue_600"
94 android:textStyle="bold" />
97 android:id="@+id/request_headers"
98 android:layout_height="wrap_content"
99 android:layout_width="match_parent"
100 android:textIsSelectable="true"
101 android:layout_marginBottom="8dp" />
103 <!-- Response message. -->
105 android:layout_height="wrap_content"
106 android:layout_width="match_parent"
107 android:text="@string/response_message"
108 android:textAlignment="center"
109 android:textSize="18sp"
110 android:textColor="@color/blue_600"
111 android:textStyle="bold" />
114 android:id="@+id/response_message"
115 android:layout_height="wrap_content"
116 android:layout_width="match_parent"
117 android:textIsSelectable="true"
118 android:layout_marginBottom="8dp" />
120 <!-- Response headers. -->
122 android:layout_height="wrap_content"
123 android:layout_width="match_parent"
124 android:text="@string/response_headers"
125 android:textAlignment="center"
126 android:textSize="18sp"
127 android:textColor="@color/blue_600"
128 android:textStyle="bold" />
131 android:id="@+id/response_headers"
132 android:layout_height="wrap_content"
133 android:layout_width="match_parent"
134 android:textIsSelectable="true"
135 android:layout_marginBottom="8dp" />
137 <!-- Response body. -->
139 android:layout_height="wrap_content"
140 android:layout_width="match_parent"
141 android:text="@string/response_body"
142 android:textAlignment="center"
143 android:textSize="18sp"
144 android:textColor="@color/blue_600"
145 android:textStyle="bold" />
148 android:id="@+id/response_body"
149 android:layout_height="wrap_content"
150 android:layout_width="match_parent"
151 android:textIsSelectable="true" />
154 </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
156 </androidx.coordinatorlayout.widget.CoordinatorLayout>