Fix find on page.
[PrivacyBrowser.git] / app / src / main / res / layout / main_framelayout.xml
1 <?xml version="1.0" encoding="utf-8"?>
2
3 <!--
4   Copyright © 2015-2017,2019 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 <FrameLayout
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" >
28
29     <androidx.drawerlayout.widget.DrawerLayout
30         android:id="@+id/drawerlayout"
31         android:layout_height="match_parent"
32         android:layout_width="match_parent" >
33
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>`. -->
37         <RelativeLayout
38             android:id="@+id/main_content_relativelayout"
39             android:layout_height="match_parent"
40             android:layout_width="match_parent"
41             android:fitsSystemWindows="true" >
42
43             <!-- Include the AdView.  For the standard flavor, this just includes a TextView with `visibility="gone"`. -->
44             <include layout="@layout/adview" />
45
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" >
53
54                 <!-- The theme has to be defined here because the activity uses a `NoActionBar` theme. -->
55                 <com.google.android.material.appbar.AppBarLayout
56                     android:layout_height="wrap_content"
57                     android:layout_width="match_parent"
58                     android:theme="@style/PrivacyBrowserAppBarLight" >
59
60                     <androidx.appcompat.widget.Toolbar
61                         android:id="@+id/toolbar"
62                         android:layout_height="wrap_content"
63                         android:layout_width="match_parent"
64                         android.support.design:layout_scrollFlags="scroll|enterAlways|snap" />
65
66                     <!-- The find on page linear layout.  It is initially `visibility="gone"`. -->
67                     <LinearLayout
68                         android:id="@+id/find_on_page_linearlayout"
69                         android:layout_height="wrap_content"
70                         android:layout_width="match_parent"
71                         android:orientation="horizontal"
72                         android:visibility="gone"
73                         android.support.design:layout_scrollFlags="scroll|enterAlways|snap" >
74
75                         <!-- `android:imeOptions="actionDone"` sets the keyboard to have a `check mark` key instead of a `new line` key. -->
76                         <EditText
77                             android:id="@+id/find_on_page_edittext"
78                             android:layout_height="wrap_content"
79                             android:layout_width="0dp"
80                             android:layout_weight="1"
81                             android:layout_marginStart="8dp"
82                             android:layout_marginEnd="4dp"
83                             android:hint="@string/find_on_page"
84                             android:lines="1"
85                             android:imeOptions="actionDone"
86                             android:inputType="text"
87                             tools:ignore="Autofill" />
88
89                         <TextView
90                             android:id="@+id/find_on_page_count_textview"
91                             android:layout_height="wrap_content"
92                             android:layout_width="wrap_content"
93                             android:layout_marginStart="4dp"
94                             android:layout_marginEnd="4dp"
95                             android:text="@string/zero_of_zero" />
96
97                         <ImageView
98                             android:id="@+id/find_previous"
99                             android:src="@drawable/previous"
100                             android:layout_width="35dp"
101                             android:layout_height="35dp"
102                             android:layout_marginStart="4dp"
103                             android:layout_marginEnd="4dp"
104                             android:layout_gravity="center_vertical"
105                             android:tint="?attr/findOnPageIconTintColor"
106                             android:contentDescription="@string/previous"
107                             android:onClick="findPreviousOnPage" />
108
109                         <ImageView
110                             android:id="@+id/find_next"
111                             android:src="@drawable/next"
112                             android:layout_width="35dp"
113                             android:layout_height="35dp"
114                             android:layout_marginStart="4dp"
115                             android:layout_marginEnd="4dp"
116                             android:layout_gravity="center_vertical"
117                             android:tint="?attr/findOnPageIconTintColor"
118                             android:contentDescription="@string/next"
119                             android:onClick="findNextOnPage" />
120
121                         <ImageView
122                             android:id="@+id/close_find"
123                             android:src="@drawable/close_light"
124                             android:layout_width="35dp"
125                             android:layout_height="35dp"
126                             android:layout_marginStart="4dp"
127                             android:layout_marginEnd="8dp"
128                             android:layout_gravity="center_vertical"
129                             android:tint="?attr/findOnPageIconTintColor"
130                             android:contentDescription="@string/close"
131                             android:onClick="closeFindOnPage" />
132                     </LinearLayout>
133
134                     <LinearLayout
135                         android:id="@+id/tabs_linearlayout"
136                         android:layout_height="wrap_content"
137                         android:layout_width="wrap_content"
138                         android:orientation="horizontal"
139                         android.support.design:layout_scrollFlags="scroll|enterAlways|snap" >
140
141                         <com.google.android.material.tabs.TabLayout
142                             android:id="@+id/tablayout"
143                             android:layout_height="wrap_content"
144                             android:layout_width="0dp"
145                             android:layout_weight="1"
146                             android.support.design:tabIndicatorGravity="top"
147                             android.support.design:tabMode="scrollable" />
148
149                         <ImageView
150                             android:layout_height="wrap_content"
151                             android:layout_width="wrap_content"
152                             android:layout_gravity="center_vertical"
153                             android:paddingStart="10dp"
154                             android:paddingEnd="10dp"
155                             android:src="@drawable/add_light"
156                             android:tint="?attr/addTabIconTintColor"
157                             android:onClick="addTab"
158                             android:contentDescription="@string/add_tab" />
159                     </LinearLayout>
160                 </com.google.android.material.appbar.AppBarLayout>
161
162                 <!-- `app:layout_behavior="@string/appbar_scrolling_view_behavior"` must be set on the sibling of AppBarLayout. -->
163                 <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
164                     android:id="@+id/swiperefreshlayout"
165                     android:layout_width="match_parent"
166                     android:layout_height="match_parent"
167                     android.support.design:layout_behavior="@string/appbar_scrolling_view_behavior" >
168
169                         <androidx.viewpager.widget.ViewPager
170                             android:id="@+id/webviewpager"
171                             android:layout_width="match_parent"
172                             android:layout_height="match_parent" />
173                 </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
174             </androidx.coordinatorlayout.widget.CoordinatorLayout>
175         </RelativeLayout>
176
177         <!-- The navigation drawer. -->
178         <com.google.android.material.navigation.NavigationView
179             android:id="@+id/navigationview"
180             android:layout_height="match_parent"
181             android:layout_width="wrap_content"
182             android:layout_gravity="start"
183             android.support.design:headerLayout="@layout/navigation_header"
184             android.support.design:menu="@menu/webview_navigation_menu"
185             android.support.design:itemIconTint="?attr/navigationIconTintColor" />
186
187         <!-- Include the bookmarks drawer, which varies based on screen width. -->
188         <include layout="@layout/bookmarks_drawer" />
189     </androidx.drawerlayout.widget.DrawerLayout>
190
191     <!-- `The full screen video frame layout is used to display full screen videos.  It is initially `android:visibility="gone"` to hide it from view. -->
192     <FrameLayout
193         android:id="@+id/full_screen_video_framelayout"
194         android:layout_height="match_parent"
195         android:layout_width="match_parent"
196         android:visibility="gone" />
197 </FrameLayout>