Make SSL errors tab aware.
[PrivacyBrowser.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:layout_height="wrap_content"
57                     android:layout_width="match_parent"
58                     android:theme="@style/PrivacyBrowserAppBarLight" >
59
60                     <androidx.appcompat.widget.Toolbar
61                         android:id="@+id/toolbar"
62                         android:layout_height="wrap_content"
63                         android:layout_width="match_parent"
64                         app:layout_scrollFlags="scroll|enterAlways|snap" />
65
66                     <HorizontalScrollView
67                         android:layout_height="wrap_content"
68                         android:layout_width="match_parent"
69                         app:layout_scrollFlags="scroll|enterAlways|snap" >
70
71                         <LinearLayout
72                             android:layout_height="wrap_content"
73                             android:layout_width="wrap_content"
74                             android:orientation="horizontal" >
75
76                             <com.google.android.material.tabs.TabLayout
77                                 android:id="@+id/tablayout"
78                                 android:layout_height="wrap_content"
79                                 android:layout_width="wrap_content"
80                                 app:tabIndicatorGravity="top"
81                                 app:tabMode="scrollable" />
82
83                             <!-- `style="?android:borderlessButtonStyle"` shows a visual indication when the image view is tapped. -->
84                             <ImageView
85                                 android:layout_height="wrap_content"
86                                 android:layout_width="wrap_content"
87                                 android:layout_gravity="center_vertical"
88                                 android:src="@drawable/add_light"
89                                 android:tint="?attr/addTabIconTintColor"
90                                 android:onClick="addTab"
91                                 android:contentDescription="@string/add_tab"
92                                 style="?android:attr/borderlessButtonStyle" />
93                         </LinearLayout>
94                     </HorizontalScrollView>
95
96                     <!-- The find on page linear layout.  It is initially `visibility="gone"`. -->
97                     <LinearLayout
98                         android:id="@+id/find_on_page_linearlayout"
99                         android:layout_height="wrap_content"
100                         android:layout_width="match_parent"
101                         android:orientation="horizontal"
102                         android:visibility="gone" >
103
104                         <!-- `android:imeOptions="actionDone"` sets the keyboard to have a `check mark` key instead of a `new line` key. -->
105                         <EditText
106                             android:id="@+id/find_on_page_edittext"
107                             android:layout_height="wrap_content"
108                             android:layout_width="0dp"
109                             android:layout_weight="1"
110                             android:layout_marginStart="8dp"
111                             android:layout_marginEnd="4dp"
112                             android:hint="@string/find_on_page"
113                             android:lines="1"
114                             android:imeOptions="actionDone"
115                             android:inputType="text"
116                             tools:ignore="Autofill" />
117
118                         <TextView
119                             android:id="@+id/find_on_page_count_textview"
120                             android:layout_height="wrap_content"
121                             android:layout_width="wrap_content"
122                             android:layout_marginStart="4dp"
123                             android:layout_marginEnd="4dp"
124                             android:text="@string/zero_of_zero" />
125
126                         <ImageView
127                             android:id="@+id/find_previous"
128                             android:src="@drawable/previous"
129                             android:layout_width="35dp"
130                             android:layout_height="35dp"
131                             android:layout_marginStart="4dp"
132                             android:layout_marginEnd="4dp"
133                             android:layout_gravity="center_vertical"
134                             android:tint="?attr/findOnPageIconTintColor"
135                             android:contentDescription="@string/previous"
136                             android:onClick="findPreviousOnPage" />
137
138                         <ImageView
139                             android:id="@+id/find_next"
140                             android:src="@drawable/next"
141                             android:layout_width="35dp"
142                             android:layout_height="35dp"
143                             android:layout_marginStart="4dp"
144                             android:layout_marginEnd="4dp"
145                             android:layout_gravity="center_vertical"
146                             android:tint="?attr/findOnPageIconTintColor"
147                             android:contentDescription="@string/next"
148                             android:onClick="findNextOnPage" />
149
150                         <ImageView
151                             android:id="@+id/close_find"
152                             android:src="@drawable/close_light"
153                             android:layout_width="35dp"
154                             android:layout_height="35dp"
155                             android:layout_marginStart="4dp"
156                             android:layout_marginEnd="8dp"
157                             android:layout_gravity="center_vertical"
158                             android:tint="?attr/findOnPageIconTintColor"
159                             android:contentDescription="@string/close"
160                             android:onClick="closeFindOnPage" />
161                     </LinearLayout>
162                 </com.google.android.material.appbar.AppBarLayout>
163
164                 <!-- `app:layout_behavior="@string/appbar_scrolling_view_behavior"` must be set on the sibling of AppBarLayout. -->
165                 <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
166                     android:id="@+id/swiperefreshlayout"
167                     android:layout_width="match_parent"
168                     android:layout_height="match_parent"
169                     app:layout_behavior="@string/appbar_scrolling_view_behavior" >
170
171                         <androidx.viewpager.widget.ViewPager
172                             android:id="@+id/webviewpager"
173                             android:layout_width="match_parent"
174                             android:layout_height="match_parent" />
175                 </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
176             </androidx.coordinatorlayout.widget.CoordinatorLayout>
177         </RelativeLayout>
178
179         <!-- The navigation drawer. -->
180         <com.google.android.material.navigation.NavigationView
181             android:id="@+id/navigationview"
182             android:layout_height="match_parent"
183             android:layout_width="wrap_content"
184             android:layout_gravity="start"
185             app:headerLayout="@layout/navigation_header"
186             app:menu="@menu/webview_navigation_menu"
187             app:itemIconTint="?attr/navigationIconTintColor" />
188
189         <!-- Include the bookmarks drawer, which varies based on screen width. -->
190         <include layout="@layout/bookmarks_drawer" />
191     </androidx.drawerlayout.widget.DrawerLayout>
192
193     <!-- `The full screen video frame layout is used to display full screen videos.  It is initially `android:visibility="gone"` to hide it from view. -->
194     <FrameLayout
195         android:id="@+id/full_screen_video_framelayout"
196         android:layout_height="match_parent"
197         android:layout_width="match_parent"
198         android:visibility="gone" />
199 </FrameLayout>