1 <?xml version="1.0" encoding="utf-8"?>
4 Copyright © 2015-2017,2019-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/>. -->
22 android:id="@+id/root_framelayout"
23 xmlns:android="http://schemas.android.com/apk/res/android"
24 xmlns:app="http://schemas.android.com/apk/res-auto"
25 xmlns:tools="http://schemas.android.com/tools"
26 android:layout_height="match_parent"
27 android:layout_width="match_parent" >
29 <androidx.drawerlayout.widget.DrawerLayout
30 android:id="@+id/drawerlayout"
31 android:layout_height="match_parent"
32 android:layout_width="match_parent" >
34 <!-- Setting the CoordinatorLayout to be `focusableInTouchMode` prevents the URL text box from stealing focus on launch and opening the keyboard. -->
35 <androidx.coordinatorlayout.widget.CoordinatorLayout
36 android:id="@+id/coordinatorlayout"
37 android:layout_height="match_parent"
38 android:layout_width="match_parent"
39 android:layout_above="@id/adview"
40 android:focusable="true"
41 android:focusableInTouchMode="true" >
43 <!-- The app bar theme must be specified here because the activity uses a `NoActionBar` theme. The background is set programmatically based on the proxy status. -->
44 <com.google.android.material.appbar.AppBarLayout
45 android:id="@+id/appbar_layout"
46 android:layout_height="wrap_content"
47 android:layout_width="match_parent"
48 android:theme="@style/PrivacyBrowserAppBar" >
50 <!-- The toolbar. It is initially `visibility="gone"` so it doesn't display while the blocklists are loading. -->
51 <androidx.appcompat.widget.Toolbar
52 android:id="@+id/toolbar"
53 android:layout_height="wrap_content"
54 android:layout_width="match_parent"
55 android:visibility="gone"
56 app:layout_scrollFlags="scroll|enterAlways|snap" />
58 <!-- The find on page linear layout. It is initially `visibility="gone"` so it doesn't display while the blocklists are loading. -->
60 android:id="@+id/find_on_page_linearlayout"
61 android:layout_height="wrap_content"
62 android:layout_width="match_parent"
63 android:orientation="horizontal"
64 android:visibility="gone"
65 app:layout_scrollFlags="scroll|enterAlways|snap" >
67 <!-- `android:imeOptions="actionDone"` sets the keyboard to have a `check mark` key instead of a `new line` key. -->
69 android:id="@+id/find_on_page_edittext"
70 android:layout_height="wrap_content"
71 android:layout_width="0dp"
72 android:layout_weight="1"
73 android:layout_marginStart="8dp"
74 android:layout_marginEnd="4dp"
75 android:hint="@string/find_on_page"
77 android:imeOptions="actionDone"
78 android:inputType="text"
79 tools:ignore="Autofill" />
82 android:id="@+id/find_on_page_count_textview"
83 android:layout_height="wrap_content"
84 android:layout_width="wrap_content"
85 android:layout_marginStart="4dp"
86 android:layout_marginEnd="4dp"
87 android:text="@string/zero_of_zero" />
89 <!-- `android:background="?attr/selectableItemBackground"` adds a ripple animation on touch. -->
91 android:id="@+id/find_previous"
92 android:src="@drawable/previous"
93 android:layout_width="35dp"
94 android:layout_height="35dp"
95 android:layout_marginStart="4dp"
96 android:layout_marginEnd="4dp"
97 android:layout_gravity="center_vertical"
98 android:background="?attr/selectableItemBackground"
99 android:contentDescription="@string/previous"
100 android:onClick="findPreviousOnPage"
101 app:tint="?attr/findOnPageIconTintColor" />
103 <!-- `android:background="?attr/selectableItemBackground"` adds a ripple animation on touch. -->
105 android:id="@+id/find_next"
106 android:src="@drawable/next"
107 android:layout_width="35dp"
108 android:layout_height="35dp"
109 android:layout_marginStart="4dp"
110 android:layout_marginEnd="4dp"
111 android:layout_gravity="center_vertical"
112 android:background="?attr/selectableItemBackground"
113 android:contentDescription="@string/next"
114 android:onClick="findNextOnPage"
115 app:tint="?attr/findOnPageIconTintColor" />
117 <!-- `android:background="?attr/selectableItemBackground"` adds a ripple animation on touch. -->
119 android:id="@+id/close_find"
120 android:src="@drawable/close_day"
121 android:layout_width="35dp"
122 android:layout_height="35dp"
123 android:layout_marginStart="4dp"
124 android:layout_marginEnd="8dp"
125 android:layout_gravity="center_vertical"
126 android:background="?attr/selectableItemBackground"
127 android:contentDescription="@string/close"
128 android:onClick="closeFindOnPage"
129 app:tint="?attr/findOnPageIconTintColor" />
132 <!-- The tab linear layout. It sets the background to the right of the add tab button. It is initially `visibility="gone"` so it doesn't display while the blocklists are loading. -->
134 android:id="@+id/tabs_linearlayout"
135 android:layout_height="wrap_content"
136 android:layout_width="wrap_content"
137 android:orientation="horizontal"
138 android:visibility="gone"
139 app:layout_scrollFlags="scroll|enterAlways|snap" >
141 <!-- `android:background="?attr/selectableItemBackground"` adds a ripple animation on touch. -->
143 android:layout_height="match_parent"
144 android:layout_width="wrap_content"
145 android:layout_gravity="center_vertical"
146 android:paddingStart="10dp"
147 android:paddingEnd="10dp"
148 android:src="@drawable/close_day"
149 android:background="?attr/selectableItemBackground"
150 android:onClick="closeTab"
151 android:contentDescription="@string/close_tab"
152 app:tint="?attr/addTabIconTintColor" />
154 <com.google.android.material.tabs.TabLayout
155 android:id="@+id/tablayout"
156 android:layout_height="wrap_content"
157 android:layout_width="0dp"
158 android:layout_weight="1"
159 app:tabIndicatorGravity="top"
160 app:tabMode="scrollable" />
162 <!-- `android:background="?attr/selectableItemBackground"` adds a ripple animation on touch. -->
164 android:layout_height="match_parent"
165 android:layout_width="wrap_content"
166 android:layout_gravity="center_vertical"
167 android:paddingStart="10dp"
168 android:paddingEnd="10dp"
169 android:src="@drawable/add"
170 android:background="?attr/selectableItemBackground"
171 android:onClick="addTab"
172 android:contentDescription="@string/add_tab"
173 app:tint="?attr/addTabIconTintColor" />
175 </com.google.android.material.appbar.AppBarLayout>
177 <!-- `app:layout_behavior="@string/appbar_scrolling_view_behavior"` must be set on the sibling of AppBarLayout. -->
178 <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
179 android:id="@+id/swiperefreshlayout"
180 android:layout_width="match_parent"
181 android:layout_height="match_parent"
182 app:layout_behavior="@string/appbar_scrolling_view_behavior" >
184 <com.stoutner.privacybrowser.views.NoSwipeViewPager
185 android:id="@+id/webviewpager"
186 android:layout_height="match_parent"
187 android:layout_width="match_parent" />
188 </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
189 </androidx.coordinatorlayout.widget.CoordinatorLayout>
191 <!-- The navigation drawer. -->
192 <com.google.android.material.navigation.NavigationView
193 android:id="@+id/navigationview"
194 android:layout_height="match_parent"
195 android:layout_width="wrap_content"
196 android:layout_gravity="start"
197 app:menu="@menu/webview_navigation_menu_top_appbar"
198 app:itemIconTint="?attr/navigationIconTintColor" />
200 <!-- Include the bookmarks drawer, which varies based on screen width. -->
201 <include layout="@layout/bookmarks_drawer_top_appbar" />
202 </androidx.drawerlayout.widget.DrawerLayout>
204 <!-- The full screen video frame layout is used to display full screen videos. It is initially `android:visibility="gone"` to hide it from view. -->
206 android:id="@+id/full_screen_video_framelayout"
207 android:layout_height="match_parent"
208 android:layout_width="match_parent"
209 android:visibility="gone" />
211 <!-- The loading blocklists relative layout displays when the app first starts. It is hidden once the blocklists are populated. -->
213 android:id="@+id/loading_blocklists_relativelayout"
214 android:layout_width="match_parent"
215 android:layout_height="match_parent">
218 android:id="@+id/privacy_browser_logo"
219 android:layout_height="256dp"
220 android:layout_width="256dp"
221 android:layout_centerInParent="true"
222 android:src="@drawable/privacy_browser_foreground"
223 tools:ignore="contentDescription" />
226 android:id="@+id/loading_blocklist_textview"
227 android:layout_width="wrap_content"
228 android:layout_height="wrap_content"
229 android:layout_below="@id/privacy_browser_logo"
230 android:layout_centerHorizontal="true"
231 android:layout_margin="10dp"
232 android:textSize="16sp"
233 android:textAlignment="center"
234 android:textColor="?android:attr/textColorPrimary" />