1 <?xml version="1.0" encoding="utf-8"?>
4 Copyright © 2015-2017,2019-2020 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 xmlns:android="http://schemas.android.com/apk/res/android"
23 xmlns:app="http://schemas.android.com/apk/res-auto"
24 xmlns:tools="http://schemas.android.com/tools"
25 android:id="@+id/root_framelayout"
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 <!-- The relative layout contains the AdView and the coordinator layout, which contains the rest of the views. -->
36 android:id="@+id/main_content_relativelayout"
37 android:layout_height="match_parent"
38 android:layout_width="match_parent" >
40 <!-- Include the AdView. For the standard flavor, this just includes a TextView with `visibility="gone"`. -->
41 <include layout="@layout/adview" />
43 <!-- Setting the CoordinatorLayout to be `focusableInTouchMode` prevents the URL text box from stealing focus on launch and opening the keyboard. -->
44 <androidx.coordinatorlayout.widget.CoordinatorLayout
45 android:layout_height="match_parent"
46 android:layout_width="match_parent"
47 android:layout_above="@id/adview"
48 android:focusable="true"
49 android:focusableInTouchMode="true" >
51 <com.google.android.material.appbar.AppBarLayout
52 android:id="@+id/appbar_layout"
53 android:layout_height="wrap_content"
54 android:layout_width="match_parent" >
56 <!-- The toolbar. It is initially `visibility="gone"` so it doesn't display while the blocklists are loading. -->
57 <androidx.appcompat.widget.Toolbar
58 android:id="@+id/toolbar"
59 android:layout_height="wrap_content"
60 android:layout_width="match_parent"
61 android:visibility="gone"
62 app:layout_scrollFlags="scroll|enterAlways|snap" />
64 <!-- The find on page linear layout. It is initially `visibility="gone"` so it doesn't display while the blocklists are loading. -->
66 android:id="@+id/find_on_page_linearlayout"
67 android:layout_height="wrap_content"
68 android:layout_width="match_parent"
69 android:orientation="horizontal"
70 android:visibility="gone"
71 app:layout_scrollFlags="scroll|enterAlways|snap" >
73 <!-- `android:imeOptions="actionDone"` sets the keyboard to have a `check mark` key instead of a `new line` key. -->
75 android:id="@+id/find_on_page_edittext"
76 android:layout_height="wrap_content"
77 android:layout_width="0dp"
78 android:layout_weight="1"
79 android:layout_marginStart="8dp"
80 android:layout_marginEnd="4dp"
81 android:hint="@string/find_on_page"
83 android:imeOptions="actionDone"
84 android:inputType="text"
85 tools:ignore="Autofill" />
88 android:id="@+id/find_on_page_count_textview"
89 android:layout_height="wrap_content"
90 android:layout_width="wrap_content"
91 android:layout_marginStart="4dp"
92 android:layout_marginEnd="4dp"
93 android:text="@string/zero_of_zero" />
95 <!-- `android:background="?attr/selectableItemBackground"` adds a ripple animation on touch. -->
97 android:id="@+id/find_previous"
98 android:src="@drawable/previous"
99 android:layout_width="35dp"
100 android:layout_height="35dp"
101 android:layout_marginStart="4dp"
102 android:layout_marginEnd="4dp"
103 android:layout_gravity="center_vertical"
104 android:background="?attr/selectableItemBackground"
105 android:contentDescription="@string/previous"
106 android:onClick="findPreviousOnPage"
107 app:tint="?attr/findOnPageIconTintColor" />
109 <!-- `android:background="?attr/selectableItemBackground"` adds a ripple animation on touch. -->
111 android:id="@+id/find_next"
112 android:src="@drawable/next"
113 android:layout_width="35dp"
114 android:layout_height="35dp"
115 android:layout_marginStart="4dp"
116 android:layout_marginEnd="4dp"
117 android:layout_gravity="center_vertical"
118 android:background="?attr/selectableItemBackground"
119 android:contentDescription="@string/next"
120 android:onClick="findNextOnPage"
121 app:tint="?attr/findOnPageIconTintColor" />
123 <!-- `android:background="?attr/selectableItemBackground"` adds a ripple animation on touch. -->
125 android:id="@+id/close_find"
126 android:src="@drawable/close_day"
127 android:layout_width="35dp"
128 android:layout_height="35dp"
129 android:layout_marginStart="4dp"
130 android:layout_marginEnd="8dp"
131 android:layout_gravity="center_vertical"
132 android:background="?attr/selectableItemBackground"
133 android:contentDescription="@string/close"
134 android:onClick="closeFindOnPage"
135 app:tint="?attr/findOnPageIconTintColor" />
138 <!-- 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. -->
140 android:id="@+id/tabs_linearlayout"
141 android:layout_height="wrap_content"
142 android:layout_width="wrap_content"
143 android:orientation="horizontal"
144 android:visibility="gone"
145 app:layout_scrollFlags="scroll|enterAlways|snap" >
147 <!-- `android:background="?attr/selectableItemBackground"` adds a ripple animation on touch. -->
149 android:layout_height="match_parent"
150 android:layout_width="wrap_content"
151 android:layout_gravity="center_vertical"
152 android:paddingStart="10dp"
153 android:paddingEnd="10dp"
154 android:src="@drawable/close_day"
155 android:background="?attr/selectableItemBackground"
156 android:onClick="closeTab"
157 android:contentDescription="@string/close_tab"
158 app:tint="?attr/addTabIconTintColor" />
160 <com.google.android.material.tabs.TabLayout
161 android:id="@+id/tablayout"
162 android:layout_height="wrap_content"
163 android:layout_width="0dp"
164 android:layout_weight="1"
165 app:tabIndicatorGravity="top"
166 app:tabMode="scrollable" />
168 <!-- `android:background="?attr/selectableItemBackground"` adds a ripple animation on touch. -->
170 android:layout_height="match_parent"
171 android:layout_width="wrap_content"
172 android:layout_gravity="center_vertical"
173 android:paddingStart="10dp"
174 android:paddingEnd="10dp"
175 android:src="@drawable/add"
176 android:background="?attr/selectableItemBackground"
177 android:onClick="addTab"
178 android:contentDescription="@string/add_tab"
179 app:tint="?attr/addTabIconTintColor" />
181 </com.google.android.material.appbar.AppBarLayout>
183 <!-- `app:layout_behavior="@string/appbar_scrolling_view_behavior"` must be set on the sibling of AppBarLayout. -->
184 <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
185 android:id="@+id/swiperefreshlayout"
186 android:layout_width="match_parent"
187 android:layout_height="match_parent"
188 app:layout_behavior="@string/appbar_scrolling_view_behavior" >
190 <com.stoutner.privacybrowser.views.NoSwipeViewPager
191 android:id="@+id/webviewpager"
192 android:layout_width="match_parent"
193 android:layout_height="match_parent" />
194 </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
195 </androidx.coordinatorlayout.widget.CoordinatorLayout>
198 <!-- The navigation drawer. -->
199 <com.google.android.material.navigation.NavigationView
200 android:id="@+id/navigationview"
201 android:layout_height="match_parent"
202 android:layout_width="wrap_content"
203 android:layout_gravity="start"
204 app:menu="@menu/webview_navigation_menu"
205 app:itemIconTint="?attr/navigationIconTintColor" />
207 <!-- Include the bookmarks drawer, which varies based on screen width. -->
208 <include layout="@layout/bookmarks_drawer" />
209 </androidx.drawerlayout.widget.DrawerLayout>
211 <!-- The full screen video frame layout is used to display full screen videos. It is initially `android:visibility="gone"` to hide it from view. -->
213 android:id="@+id/full_screen_video_framelayout"
214 android:layout_height="match_parent"
215 android:layout_width="match_parent"
216 android:visibility="gone" />
218 <!-- The loading blocklists relative layout displays when the app first starts. It is hidden once the blocklists are populated. -->
220 android:id="@+id/loading_blocklists_relativelayout"
221 android:layout_width="match_parent"
222 android:layout_height="match_parent">
225 android:id="@+id/privacy_browser_logo"
226 android:layout_height="256dp"
227 android:layout_width="256dp"
228 android:layout_centerInParent="true"
229 android:src="@drawable/privacy_browser_foreground"
230 tools:ignore="contentDescription" />
233 android:id="@+id/loading_blocklist_textview"
234 android:layout_width="wrap_content"
235 android:layout_height="wrap_content"
236 android:layout_below="@id/privacy_browser_logo"
237 android:layout_centerHorizontal="true"
238 android:layout_margin="10dp"
239 android:textSize="16sp"
240 android:textAlignment="center"
241 android:textColor="?android:attr/textColorPrimary" />