]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blob - app/src/main/res/layout/main_framelayout_top_appbar.xml
First wrong button text in View Headers in night theme. https://redmine.stoutner...
[PrivacyBrowserAndroid.git] / app / src / main / res / layout / main_framelayout_top_appbar.xml
1 <?xml version="1.0" encoding="utf-8"?>
2
3 <!--
4   Copyright 2015-2017, 2019-2024 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             <!-- 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. -->
43             <com.google.android.material.appbar.AppBarLayout
44                 android:id="@+id/appbar_layout"
45                 android:layout_height="wrap_content"
46                 android:layout_width="match_parent"
47                 android:theme="@style/PrivacyBrowserAppBar" >
48
49                 <!-- The toolbar. -->
50                 <androidx.appcompat.widget.Toolbar
51                     android:id="@+id/toolbar"
52                     android:layout_height="wrap_content"
53                     android:layout_width="match_parent"
54                     app:layout_scrollFlags="scroll|enterAlways|snap" />
55
56                 <!-- The find on page linear layout.  It is initially `visibility="gone"` and is only displayed when requested. -->
57                 <LinearLayout
58                     android:id="@+id/find_on_page_linearlayout"
59                     android:layout_height="wrap_content"
60                     android:layout_width="match_parent"
61                     android:orientation="horizontal"
62                     android:visibility="gone"
63                     app:layout_scrollFlags="scroll|enterAlways|snap" >
64
65                     <!-- `android:imeOptions="actionDone"` sets the keyboard to have a `check mark` key instead of a `new line` key. -->
66                     <EditText
67                         android:id="@+id/find_on_page_edittext"
68                         android:layout_height="wrap_content"
69                         android:layout_width="0dp"
70                         android:layout_weight="1"
71                         android:layout_marginStart="8dp"
72                         android:layout_marginEnd="4dp"
73                         android:hint="@string/find_on_page"
74                         android:lines="1"
75                         android:imeOptions="actionDone"
76                         android:inputType="text"
77                         tools:ignore="Autofill" />
78
79                     <TextView
80                         android:id="@+id/find_on_page_count_textview"
81                         android:layout_height="wrap_content"
82                         android:layout_width="wrap_content"
83                         android:layout_marginStart="4dp"
84                         android:layout_marginEnd="4dp"
85                         android:text="@string/zero_of_zero" />
86
87                     <!-- `android:background="?attr/selectableItemBackground"` adds a ripple animation on touch. -->
88                     <ImageView
89                         android:id="@+id/find_previous"
90                         android:layout_height="35dp"
91                         android:layout_width="35dp"
92                         android:layout_marginStart="4dp"
93                         android:layout_marginEnd="4dp"
94                         android:layout_gravity="center_vertical"
95                         android:src="@drawable/previous"
96                         android:background="?attr/selectableItemBackground"
97                         android:contentDescription="@string/previous"
98                         android:onClick="findPreviousOnPage"
99                         app:tint="@color/blue_icon" />
100
101                     <!-- `android:background="?attr/selectableItemBackground"` adds a ripple animation on touch. -->
102                     <ImageView
103                         android:id="@+id/find_next"
104                         android:layout_height="35dp"
105                         android:layout_width="35dp"
106                         android:layout_marginStart="4dp"
107                         android:layout_marginEnd="4dp"
108                         android:layout_gravity="center_vertical"
109                         android:src="@drawable/next"
110                         android:background="?attr/selectableItemBackground"
111                         android:contentDescription="@string/next"
112                         android:onClick="findNextOnPage"
113                         app:tint="@color/blue_icon" />
114
115                     <!-- `android:background="?attr/selectableItemBackground"` adds a ripple animation on touch. -->
116                     <ImageView
117                         android:id="@+id/close_find"
118                         android:layout_height="35dp"
119                         android:layout_width="35dp"
120                         android:layout_marginStart="4dp"
121                         android:layout_marginEnd="8dp"
122                         android:layout_gravity="center_vertical"
123                         android:src="@drawable/close"
124                         android:background="?attr/selectableItemBackground"
125                         android:contentDescription="@string/close"
126                         android:onClick="closeFindOnPage"
127                         app:tint="@color/blue_icon" />
128                 </LinearLayout>
129
130                 <!-- The tab linear layout.  It sets the background to the right of the add tab button. -->
131                 <LinearLayout
132                     android:id="@+id/tabs_linearlayout"
133                     android:layout_height="wrap_content"
134                     android:layout_width="wrap_content"
135                     android:orientation="horizontal"
136                     app:layout_scrollFlags="scroll|enterAlways|snap" >
137
138                     <!-- `android:background="?attr/selectableItemBackground"` adds a ripple animation on touch. -->
139                     <ImageView
140                         android:layout_height="match_parent"
141                         android:layout_width="wrap_content"
142                         android:layout_gravity="center_vertical"
143                         android:paddingStart="10dp"
144                         android:paddingEnd="10dp"
145                         android:src="@drawable/close"
146                         android:background="?attr/selectableItemBackground"
147                         android:onClick="closeTab"
148                         android:contentDescription="@string/close_tab" />
149
150                     <com.google.android.material.tabs.TabLayout
151                         android:id="@+id/tablayout"
152                         android:layout_height="wrap_content"
153                         android:layout_width="0dp"
154                         android:layout_weight="1"
155                         app:tabIndicatorGravity="top"
156                         app:tabMode="scrollable" />
157
158                     <!-- `android:background="?attr/selectableItemBackground"` adds a ripple animation on touch. -->
159                     <ImageView
160                         android:layout_height="match_parent"
161                         android:layout_width="wrap_content"
162                         android:layout_gravity="center_vertical"
163                         android:paddingStart="10dp"
164                         android:paddingEnd="10dp"
165                         android:src="@drawable/add"
166                         android:background="?attr/selectableItemBackground"
167                         android:onClick="addTab"
168                         android:contentDescription="@string/add_tab" />
169                 </LinearLayout>
170             </com.google.android.material.appbar.AppBarLayout>
171
172             <!-- `app:layout_behavior="@string/appbar_scrolling_view_behavior"` must be set on the sibling of AppBarLayout. -->
173             <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
174                 android:id="@+id/swiperefreshlayout"
175                 android:layout_height="match_parent"
176                 android:layout_width="match_parent"
177                 app:layout_behavior="@string/appbar_scrolling_view_behavior" >
178
179                     <androidx.viewpager2.widget.ViewPager2
180                         android:id="@+id/webview_viewpager2"
181                         android:layout_height="match_parent"
182                         android:layout_width="match_parent" />
183             </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
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_top_appbar"
193             app:itemIconTint="@color/blue_icon" />
194
195         <!-- Include the bookmarks drawer, which varies based on screen width. -->
196         <include layout="@layout/bookmarks_drawer_top_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 filter lists relative layout displays when the app first starts.  It is hidden once the filter lists are populated. -->
207     <RelativeLayout
208         android:id="@+id/loading_filterlists_relativelayout"
209         android:layout_height="match_parent"
210         android:layout_width="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_filterlist_textview"
222             android:layout_height="wrap_content"
223             android:layout_width="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>