]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blob - app/src/main/res/layout/view_source_coordinatorlayout.xml
Change the night access color to light violet. https://redmine.stoutner.com/issues/572
[PrivacyBrowserAndroid.git] / app / src / main / res / layout / view_source_coordinatorlayout.xml
1 <?xml version="1.0" encoding="utf-8"?>
2
3 <!--
4   Copyright © 2017-2020 Soren Stoutner <soren@stoutner.com>.
5
6   This file is part of Privacy Browser <https://www.stoutner.com/privacy-browser>.
7
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.
12
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.
17
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/>. -->
20
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" >
31
32     <!-- The linear layout with `orientation="vertical"` moves the content below the app bar layout. -->
33     <LinearLayout
34         android:layout_height="match_parent"
35         android:layout_width="match_parent"
36         android:orientation="vertical" >
37
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
43             <!-- The frame layout allows the toolbar and the progress bar to occupy the same space. -->
44             <FrameLayout
45                 android:layout_height="wrap_content"
46                 android:layout_width="match_parent" >
47
48                 <androidx.appcompat.widget.Toolbar
49                     android:id="@+id/view_source_toolbar"
50                     android:layout_height="wrap_content"
51                     android:layout_width="match_parent" />
52
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. -->
56                 <ProgressBar
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" />
65             </FrameLayout>
66         </com.google.android.material.appbar.AppBarLayout>
67
68         <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
69             android:id="@+id/view_source_swiperefreshlayout"
70             android:layout_height="match_parent"
71             android:layout_width="match_parent">
72
73             <ScrollView
74                 android:layout_height="wrap_content"
75                 android:layout_width="match_parent" >
76
77                 <LinearLayout
78                     android:layout_height="wrap_content"
79                     android:layout_width="match_parent"
80                     android:orientation="vertical"
81                     android:layout_margin="10dp" >
82
83                     <!-- Request headers. -->
84                     <TextView
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="?attr/blueTextColor"
91                         android:textStyle="bold" />
92
93                     <TextView
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" />
99
100                     <!-- Response message. -->
101                     <TextView
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="?attr/blueTextColor"
108                         android:textStyle="bold" />
109
110                     <TextView
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" />
116
117                     <!-- Response headers. -->
118                     <TextView
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="?attr/blueTextColor"
125                         android:textStyle="bold" />
126
127                     <TextView
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" />
133
134                     <!-- Response body. -->
135                     <TextView
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="?attr/blueTextColor"
142                         android:textStyle="bold" />
143
144                     <TextView
145                         android:id="@+id/response_body"
146                         android:layout_height="wrap_content"
147                         android:layout_width="match_parent"
148                         android:textIsSelectable="true" />
149                 </LinearLayout>
150             </ScrollView>
151         </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
152     </LinearLayout>
153 </androidx.coordinatorlayout.widget.CoordinatorLayout>