1 <?xml version="1.0" encoding="utf-8"?>
4 Copyright © 2015-2017,2019 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:android.support.design="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.
35 `android:fitsSystemWindows="true"` moves the toolbar below the system status bar but lets the drawers slide under the translucent status bar.
36 When it is specified, the theme should include `<item name="android:windowTranslucentStatus">true</item>`. -->
38 android:id="@+id/main_content_relativelayout"
39 android:layout_height="match_parent"
40 android:layout_width="match_parent"
41 android:fitsSystemWindows="true" >
43 <!-- Include the AdView. For the standard flavor, this just includes a TextView with `visibility="gone"`. -->
44 <include layout="@layout/adview" />
46 <!-- Setting the CoordinatorLayout to be `focusableInTouchMode` prevents the URL text box from stealing focus on launch and opening the keyboard. -->
47 <androidx.coordinatorlayout.widget.CoordinatorLayout
48 android:layout_height="match_parent"
49 android:layout_width="match_parent"
50 android:layout_above="@id/adview"
51 android:focusable="true"
52 android:focusableInTouchMode="true" >
54 <!-- The theme has to be defined here because the activity uses a `NoActionBar` theme. -->
55 <com.google.android.material.appbar.AppBarLayout
56 android:id="@+id/appbar_layout"
57 android:layout_height="wrap_content"
58 android:layout_width="match_parent"
59 android:theme="@style/PrivacyBrowserAppBarLight" >
61 <androidx.appcompat.widget.Toolbar
62 android:id="@+id/toolbar"
63 android:layout_height="wrap_content"
64 android:layout_width="match_parent"
65 android.support.design:layout_scrollFlags="scroll|enterAlways|snap" />
67 <!-- The find on page linear layout. It is initially `visibility="gone"`. -->
69 android:id="@+id/find_on_page_linearlayout"
70 android:layout_height="wrap_content"
71 android:layout_width="match_parent"
72 android:orientation="horizontal"
73 android:visibility="gone"
74 android.support.design:layout_scrollFlags="scroll|enterAlways|snap" >
76 <!-- `android:imeOptions="actionDone"` sets the keyboard to have a `check mark` key instead of a `new line` key. -->
78 android:id="@+id/find_on_page_edittext"
79 android:layout_height="wrap_content"
80 android:layout_width="0dp"
81 android:layout_weight="1"
82 android:layout_marginStart="8dp"
83 android:layout_marginEnd="4dp"
84 android:hint="@string/find_on_page"
86 android:imeOptions="actionDone"
87 android:inputType="text"
88 tools:ignore="Autofill" />
91 android:id="@+id/find_on_page_count_textview"
92 android:layout_height="wrap_content"
93 android:layout_width="wrap_content"
94 android:layout_marginStart="4dp"
95 android:layout_marginEnd="4dp"
96 android:text="@string/zero_of_zero" />
99 android:id="@+id/find_previous"
100 android:src="@drawable/previous"
101 android:layout_width="35dp"
102 android:layout_height="35dp"
103 android:layout_marginStart="4dp"
104 android:layout_marginEnd="4dp"
105 android:layout_gravity="center_vertical"
106 android:tint="?attr/findOnPageIconTintColor"
107 android:contentDescription="@string/previous"
108 android:onClick="findPreviousOnPage" />
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:tint="?attr/findOnPageIconTintColor"
119 android:contentDescription="@string/next"
120 android:onClick="findNextOnPage" />
123 android:id="@+id/close_find"
124 android:src="@drawable/close_light"
125 android:layout_width="35dp"
126 android:layout_height="35dp"
127 android:layout_marginStart="4dp"
128 android:layout_marginEnd="8dp"
129 android:layout_gravity="center_vertical"
130 android:tint="?attr/findOnPageIconTintColor"
131 android:contentDescription="@string/close"
132 android:onClick="closeFindOnPage" />
136 android:id="@+id/tabs_linearlayout"
137 android:layout_height="wrap_content"
138 android:layout_width="wrap_content"
139 android:orientation="horizontal"
140 android.support.design:layout_scrollFlags="scroll|enterAlways|snap" >
142 <com.google.android.material.tabs.TabLayout
143 android:id="@+id/tablayout"
144 android:layout_height="wrap_content"
145 android:layout_width="0dp"
146 android:layout_weight="1"
147 android.support.design:tabIndicatorGravity="top"
148 android.support.design:tabMode="scrollable" />
151 android:layout_height="wrap_content"
152 android:layout_width="wrap_content"
153 android:layout_gravity="center_vertical"
154 android:paddingStart="10dp"
155 android:paddingEnd="10dp"
156 android:src="@drawable/add_light"
157 android:tint="?attr/addTabIconTintColor"
158 android:onClick="addTab"
159 android:contentDescription="@string/add_tab" />
161 </com.google.android.material.appbar.AppBarLayout>
163 <!-- `app:layout_behavior="@string/appbar_scrolling_view_behavior"` must be set on the sibling of AppBarLayout. -->
164 <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
165 android:id="@+id/swiperefreshlayout"
166 android:layout_width="match_parent"
167 android:layout_height="match_parent"
168 android.support.design:layout_behavior="@string/appbar_scrolling_view_behavior" >
170 <androidx.viewpager.widget.ViewPager
171 android:id="@+id/webviewpager"
172 android:layout_width="match_parent"
173 android:layout_height="match_parent" />
174 </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
175 </androidx.coordinatorlayout.widget.CoordinatorLayout>
178 <!-- The navigation drawer. -->
179 <com.google.android.material.navigation.NavigationView
180 android:id="@+id/navigationview"
181 android:layout_height="match_parent"
182 android:layout_width="wrap_content"
183 android:layout_gravity="start"
184 android.support.design:headerLayout="@layout/navigation_header"
185 android.support.design:menu="@menu/webview_navigation_menu"
186 android.support.design:itemIconTint="?attr/navigationIconTintColor" />
188 <!-- Include the bookmarks drawer, which varies based on screen width. -->
189 <include layout="@layout/bookmarks_drawer" />
190 </androidx.drawerlayout.widget.DrawerLayout>
192 <!-- `The full screen video frame layout is used to display full screen videos. It is initially `android:visibility="gone"` to hide it from view. -->
194 android:id="@+id/full_screen_video_framelayout"
195 android:layout_height="match_parent"
196 android:layout_width="match_parent"
197 android:visibility="gone" />