1 <?xml version="1.0" encoding="utf-8"?>
4 Copyright © 2017-2021 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:id="@+id/request_headers_title_textview"
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="?attr/blueTextColor"
94 android:textStyle="bold" />
97 android:id="@+id/request_headers_textview"
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:id="@+id/response_message_title_textview"
106 android:layout_height="wrap_content"
107 android:layout_width="match_parent"
108 android:text="@string/response_message"
109 android:textAlignment="center"
110 android:textSize="18sp"
111 android:textColor="?attr/blueTextColor"
112 android:textStyle="bold" />
115 android:id="@+id/response_message_textview"
116 android:layout_height="wrap_content"
117 android:layout_width="match_parent"
118 android:textIsSelectable="true"
119 android:layout_marginBottom="8dp" />
121 <!-- Response headers. -->
122 <!-- The title text is set programatically. -->
124 android:id="@+id/response_headers_title_textivew"
125 android:layout_height="wrap_content"
126 android:layout_width="match_parent"
127 android:textAlignment="center"
128 android:textSize="18sp"
129 android:textColor="?attr/blueTextColor"
130 android:textStyle="bold" />
133 android:id="@+id/response_headers_textview"
134 android:layout_height="wrap_content"
135 android:layout_width="match_parent"
136 android:textIsSelectable="true"
137 android:layout_marginBottom="8dp" />
139 <!-- Response body. -->
140 <!-- The title text is set programatically. -->
142 android:id="@+id/response_body_title_textview"
143 android:layout_height="wrap_content"
144 android:layout_width="match_parent"
145 android:textAlignment="center"
146 android:textSize="18sp"
147 android:textColor="?attr/blueTextColor"
148 android:textStyle="bold" />
151 android:id="@+id/response_body_textview"
152 android:layout_height="wrap_content"
153 android:layout_width="match_parent"
154 android:textIsSelectable="true" />
157 </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
159 </androidx.coordinatorlayout.widget.CoordinatorLayout>