]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blob - app/src/main/res/layout/view_source_coordinatorlayout.xml
Fix the app bar and options menu icon colors. https://redmine.stoutner.com/issues/618
[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     android:layout_height="match_parent"
27     android:layout_width="match_parent"
28     android:focusable="true"
29     android:focusableInTouchMode="true" >
30
31     <!-- The linear layout with `orientation="vertical"` moves the content below the app bar layout. -->
32     <LinearLayout
33         android:layout_height="match_parent"
34         android:layout_width="match_parent"
35         android:orientation="vertical" >
36
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/ThemeOverlay.AppCompat.DayNight.ActionBar" >
43
44             <!-- The frame layout allows the toolbar and the progress bar to occupy the same space. -->
45             <FrameLayout
46                 android:layout_height="wrap_content"
47                 android:layout_width="match_parent" >
48
49                 <androidx.appcompat.widget.Toolbar
50                     android:id="@+id/view_source_toolbar"
51                     android:layout_height="wrap_content"
52                     android:layout_width="match_parent" />
53
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. -->
57                 <ProgressBar
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" />
66             </FrameLayout>
67         </com.google.android.material.appbar.AppBarLayout>
68
69         <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
70             android:id="@+id/view_source_swiperefreshlayout"
71             android:layout_height="match_parent"
72             android:layout_width="match_parent">
73
74             <ScrollView
75                 android:id="@+id/view_source_scrollview"
76                 android:layout_height="wrap_content"
77                 android:layout_width="match_parent" >
78
79                 <LinearLayout
80                     android:layout_height="wrap_content"
81                     android:layout_width="match_parent"
82                     android:orientation="vertical"
83                     android:layout_margin="10dp" >
84
85                     <!-- Request headers. -->
86                     <TextView
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" />
94
95                     <TextView
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" />
101
102                     <!-- Response message. -->
103                     <TextView
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" />
111
112                     <TextView
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" />
118
119                     <!-- Response headers. -->
120                     <TextView
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" />
128
129                     <TextView
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" />
135
136                     <!-- Response body. -->
137                     <TextView
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" />
145
146                     <TextView
147                         android:id="@+id/response_body"
148                         android:layout_height="wrap_content"
149                         android:layout_width="match_parent"
150                         android:textIsSelectable="true" />
151                 </LinearLayout>
152             </ScrollView>
153         </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
154     </LinearLayout>
155 </androidx.coordinatorlayout.widget.CoordinatorLayout>