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