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