]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blob - app/src/main/res/layout/main_framelayout.xml
36dbf3654211f851d20aabc5b2255bb5badea83b
[PrivacyBrowserAndroid.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: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" >
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:id="@+id/appbar_layout"
57                     android:layout_height="wrap_content"
58                     android:layout_width="match_parent"
59                     android:theme="@style/PrivacyBrowserAppBarLight" >
60
61                     <androidx.appcompat.widget.Toolbar
62                         android:id="@+id/toolbar"
63                         android:layout_height="wrap_content"
64                         android:layout_width="match_parent"
65                         app:layout_scrollFlags="scroll|enterAlways|snap" />
66
67                     <!-- The find on page linear layout.  It is initially `visibility="gone"`. -->
68                     <LinearLayout
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                         app:layout_scrollFlags="scroll|enterAlways|snap" >
75
76                         <!-- `android:imeOptions="actionDone"` sets the keyboard to have a `check mark` key instead of a `new line` key. -->
77                         <EditText
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"
85                             android:lines="1"
86                             android:imeOptions="actionDone"
87                             android:inputType="text"
88                             tools:ignore="Autofill" />
89
90                         <TextView
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" />
97
98                         <ImageView
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" />
109
110                         <ImageView
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" />
121
122                         <ImageView
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" />
133                     </LinearLayout>
134
135                     <LinearLayout
136                         android:id="@+id/tabs_linearlayout"
137                         android:layout_height="wrap_content"
138                         android:layout_width="wrap_content"
139                         android:orientation="horizontal"
140                         app:layout_scrollFlags="scroll|enterAlways|snap" >
141
142                         <ImageView
143                             android:layout_height="wrap_content"
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_light"
149                             android:tint="?attr/addTabIconTintColor"
150                             android:onClick="closeTab"
151                             android:contentDescription="@string/close_tab" />
152
153                         <com.google.android.material.tabs.TabLayout
154                             android:id="@+id/tablayout"
155                             android:layout_height="wrap_content"
156                             android:layout_width="0dp"
157                             android:layout_weight="1"
158                             app:tabIndicatorGravity="top"
159                             app:tabMode="scrollable" />
160
161                         <ImageView
162                             android:layout_height="wrap_content"
163                             android:layout_width="wrap_content"
164                             android:layout_gravity="center_vertical"
165                             android:paddingStart="10dp"
166                             android:paddingEnd="10dp"
167                             android:src="@drawable/add_light"
168                             android:tint="?attr/addTabIconTintColor"
169                             android:onClick="addTab"
170                             android:contentDescription="@string/add_tab" />
171                     </LinearLayout>
172                 </com.google.android.material.appbar.AppBarLayout>
173
174                 <!-- `app:layout_behavior="@string/appbar_scrolling_view_behavior"` must be set on the sibling of AppBarLayout. -->
175                 <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
176                     android:id="@+id/swiperefreshlayout"
177                     android:layout_width="match_parent"
178                     android:layout_height="match_parent"
179                     app:layout_behavior="@string/appbar_scrolling_view_behavior" >
180
181                         <com.stoutner.privacybrowser.views.NoSwipeViewPager
182                             android:id="@+id/webviewpager"
183                             android:layout_width="match_parent"
184                             android:layout_height="match_parent" />
185                 </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
186             </androidx.coordinatorlayout.widget.CoordinatorLayout>
187         </RelativeLayout>
188
189         <!-- The navigation drawer. -->
190         <com.google.android.material.navigation.NavigationView
191             android:id="@+id/navigationview"
192             android:layout_height="match_parent"
193             android:layout_width="wrap_content"
194             android:layout_gravity="start"
195             app:headerLayout="@layout/navigation_header"
196             app:menu="@menu/webview_navigation_menu"
197             app:itemIconTint="?attr/navigationIconTintColor" />
198
199         <!-- Include the bookmarks drawer, which varies based on screen width. -->
200         <include layout="@layout/bookmarks_drawer" />
201     </androidx.drawerlayout.widget.DrawerLayout>
202
203     <!-- `The full screen video frame layout is used to display full screen videos.  It is initially `android:visibility="gone"` to hide it from view. -->
204     <FrameLayout
205         android:id="@+id/full_screen_video_framelayout"
206         android:layout_height="match_parent"
207         android:layout_width="match_parent"
208         android:visibility="gone" />
209 </FrameLayout>