]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blob - app/src/main/res/layout/main_framelayout_bottom_appbar.xml
e78bcc306c7887c72bded25c077f8ea610e36114
[PrivacyBrowserAndroid.git] / app / src / main / res / layout / main_framelayout_bottom_appbar.xml
1 <?xml version="1.0" encoding="utf-8"?>
2
3 <!--
4   Copyright © 2015-2017,2019-2021 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     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" >
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         <!-- 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_below="@id/adview"
40             android:focusable="true"
41             android:focusableInTouchMode="true" >
42
43                 <!-- `app:layout_dodgeInsetEdges="bottom"` as a child of a coordinator layout moves the view above snackbars. -->
44                 <RelativeLayout
45                     android:layout_height="match_parent"
46                     android:layout_width="match_parent"
47                     app:layout_dodgeInsetEdges="bottom" >
48
49                     <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
50                         android:id="@+id/swiperefreshlayout"
51                         android:layout_width="match_parent"
52                         android:layout_height="match_parent"
53                         android:layout_above="@id/appbar_layout" >
54
55                         <com.stoutner.privacybrowser.views.NoSwipeViewPager
56                             android:id="@+id/webviewpager"
57                             android:layout_height="match_parent"
58                             android:layout_width="match_parent" />
59                     </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
60
61                     <!-- 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. -->
62                     <com.google.android.material.appbar.AppBarLayout
63                         android:id="@+id/appbar_layout"
64                         android:layout_height="wrap_content"
65                         android:layout_width="match_parent"
66                         android:theme="@style/PrivacyBrowserAppBar"
67                         android:layout_alignParentBottom="true" >
68
69                         <!-- The tab linear layout.  It sets the background to the right of the add tab button.
70                             It is initially `visibility="gone"` so it doesn't display while the blocklists are loading. -->
71                         <LinearLayout
72                             android:id="@+id/tabs_linearlayout"
73                             android:layout_height="wrap_content"
74                             android:layout_width="wrap_content"
75                             android:orientation="horizontal"
76                             android:visibility="gone" >
77
78                             <!-- `android:background="?attr/selectableItemBackground"` adds a ripple animation on touch. -->
79                             <ImageView
80                                 android:layout_height="match_parent"
81                                 android:layout_width="wrap_content"
82                                 android:layout_gravity="center_vertical"
83                                 android:paddingStart="10dp"
84                                 android:paddingEnd="10dp"
85                                 android:src="@drawable/close_day"
86                                 android:background="?attr/selectableItemBackground"
87                                 android:onClick="closeTab"
88                                 android:contentDescription="@string/close_tab"
89                                 app:tint="?attr/addTabIconTintColor" />
90
91                             <com.google.android.material.tabs.TabLayout
92                                 android:id="@+id/tablayout"
93                                 android:layout_height="wrap_content"
94                                 android:layout_width="0dp"
95                                 android:layout_weight="1"
96                                 app:tabMode="scrollable" />
97
98                             <!-- `android:background="?attr/selectableItemBackground"` adds a ripple animation on touch. -->
99                             <ImageView
100                                 android:layout_height="match_parent"
101                                 android:layout_width="wrap_content"
102                                 android:layout_gravity="center_vertical"
103                                 android:paddingStart="10dp"
104                                 android:paddingEnd="10dp"
105                                 android:src="@drawable/add"
106                                 android:background="?attr/selectableItemBackground"
107                                 android:onClick="addTab"
108                                 android:contentDescription="@string/add_tab"
109                                 app:tint="?attr/addTabIconTintColor" />
110                         </LinearLayout>
111
112                         <!-- The find on page linear layout.  It is initially `visibility="gone"` so it doesn't display while the blocklists are loading. -->
113                         <LinearLayout
114                             android:id="@+id/find_on_page_linearlayout"
115                             android:layout_height="wrap_content"
116                             android:layout_width="match_parent"
117                             android:orientation="horizontal"
118                             android:visibility="gone" >
119
120                             <!-- `android:imeOptions="actionDone"` sets the keyboard to have a `check mark` key instead of a `new line` key. -->
121                             <EditText
122                                 android:id="@+id/find_on_page_edittext"
123                                 android:layout_height="wrap_content"
124                                 android:layout_width="0dp"
125                                 android:layout_weight="1"
126                                 android:layout_marginStart="8dp"
127                                 android:layout_marginEnd="4dp"
128                                 android:hint="@string/find_on_page"
129                                 android:lines="1"
130                                 android:imeOptions="actionDone"
131                                 android:inputType="text"
132                                 tools:ignore="Autofill" />
133
134                             <TextView
135                                 android:id="@+id/find_on_page_count_textview"
136                                 android:layout_height="wrap_content"
137                                 android:layout_width="wrap_content"
138                                 android:layout_marginStart="4dp"
139                                 android:layout_marginEnd="4dp"
140                                 android:text="@string/zero_of_zero" />
141
142                             <!-- `android:background="?attr/selectableItemBackground"` adds a ripple animation on touch. -->
143                             <ImageView
144                                 android:id="@+id/find_previous"
145                                 android:src="@drawable/previous"
146                                 android:layout_width="35dp"
147                                 android:layout_height="35dp"
148                                 android:layout_marginStart="4dp"
149                                 android:layout_marginEnd="4dp"
150                                 android:layout_gravity="center_vertical"
151                                 android:background="?attr/selectableItemBackground"
152                                 android:contentDescription="@string/previous"
153                                 android:onClick="findPreviousOnPage"
154                                 app:tint="?attr/findOnPageIconTintColor" />
155
156                             <!-- `android:background="?attr/selectableItemBackground"` adds a ripple animation on touch. -->
157                             <ImageView
158                                 android:id="@+id/find_next"
159                                 android:src="@drawable/next"
160                                 android:layout_width="35dp"
161                                 android:layout_height="35dp"
162                                 android:layout_marginStart="4dp"
163                                 android:layout_marginEnd="4dp"
164                                 android:layout_gravity="center_vertical"
165                                 android:background="?attr/selectableItemBackground"
166                                 android:contentDescription="@string/next"
167                                 android:onClick="findNextOnPage"
168                                 app:tint="?attr/findOnPageIconTintColor" />
169
170                             <!-- `android:background="?attr/selectableItemBackground"` adds a ripple animation on touch. -->
171                             <ImageView
172                                 android:id="@+id/close_find"
173                                 android:src="@drawable/close_day"
174                                 android:layout_width="35dp"
175                                 android:layout_height="35dp"
176                                 android:layout_marginStart="4dp"
177                                 android:layout_marginEnd="8dp"
178                                 android:layout_gravity="center_vertical"
179                                 android:background="?attr/selectableItemBackground"
180                                 android:contentDescription="@string/close"
181                                 android:onClick="closeFindOnPage"
182                                 app:tint="?attr/findOnPageIconTintColor" />
183                         </LinearLayout>
184
185                         <!-- The toolbar.  It is initially `visibility="gone"` so it doesn't display while the blocklists are loading. -->
186                         <androidx.appcompat.widget.Toolbar
187                             android:id="@+id/toolbar"
188                             android:layout_height="wrap_content"
189                             android:layout_width="match_parent"
190                             android:visibility="gone" />
191                     </com.google.android.material.appbar.AppBarLayout>
192                 </RelativeLayout>
193         </androidx.coordinatorlayout.widget.CoordinatorLayout>
194
195         <!-- The navigation drawer. -->
196         <com.google.android.material.navigation.NavigationView
197             android:id="@+id/navigationview"
198             android:layout_height="match_parent"
199             android:layout_width="wrap_content"
200             android:layout_gravity="start"
201             app:menu="@menu/webview_navigation_menu_bottom_appbar"
202             app:itemIconTint="?attr/navigationIconTintColor" />
203
204         <!-- Include the bookmarks drawer, which varies based on screen width. -->
205         <include layout="@layout/bookmarks_drawer_bottom_appbar" />
206     </androidx.drawerlayout.widget.DrawerLayout>
207
208     <!-- The full screen video frame layout is used to display full screen videos.  It is initially `android:visibility="gone"` to hide it from view. -->
209     <FrameLayout
210         android:id="@+id/full_screen_video_framelayout"
211         android:layout_height="match_parent"
212         android:layout_width="match_parent"
213         android:visibility="gone" />
214
215     <!-- The loading blocklists relative layout displays when the app first starts.  It is hidden once the blocklists are populated. -->
216     <RelativeLayout
217         android:id="@+id/loading_blocklists_relativelayout"
218         android:layout_width="match_parent"
219         android:layout_height="match_parent">
220
221         <ImageView
222             android:id="@+id/privacy_browser_logo"
223             android:layout_height="256dp"
224             android:layout_width="256dp"
225             android:layout_centerInParent="true"
226             android:src="@drawable/privacy_browser_foreground"
227             tools:ignore="contentDescription" />
228
229         <TextView
230             android:id="@+id/loading_blocklist_textview"
231             android:layout_width="wrap_content"
232             android:layout_height="wrap_content"
233             android:layout_below="@id/privacy_browser_logo"
234             android:layout_centerHorizontal="true"
235             android:layout_margin="10dp"
236             android:textSize="16sp"
237             android:textAlignment="center"
238             android:textColor="?android:attr/textColorPrimary" />
239     </RelativeLayout>
240 </FrameLayout>