ba9e972254088b775f2a29bd635335a7f0039330
[PrivacyBrowser.git] / app / src / main / res / layout / main_drawerlayout.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 <androidx.drawerlayout.widget.DrawerLayout
22     android:id="@+id/drawerlayout"
23     xmlns:android="http://schemas.android.com/apk/res/android"
24     xmlns:app="http://schemas.android.com/apk/res-auto"
25     android:layout_height="match_parent"
26     android:layout_width="match_parent" >
27
28     <!-- `android:fitsSystemWindows="true"` moves the toolbar below the system status bar.  When it is specified, the theme should include `<item name="android:windowTranslucentStatus">true</item>`.
29         Setting the CoordinatorLayout to be `focusableInTouchMode` prevents the URL text box from stealing focus on launch and opening the keyboard. -->
30     <androidx.coordinatorlayout.widget.CoordinatorLayout
31         android:id="@+id/coordinatorlayout"
32         xmlns:tools="http://schemas.android.com/tools"
33         tools:context="com.stoutner.privacybrowser.activities.MainWebViewActivity"
34         android:layout_height="match_parent"
35         android:layout_width="match_parent"
36         android:focusable="true"
37         android:focusableInTouchMode="true"
38         android:fitsSystemWindows="true" >
39
40         <!-- The `AppBarLayout` theme has to be defined here because the activity uses a `NoActionBar` theme. -->
41         <com.google.android.material.appbar.AppBarLayout
42             android:id="@+id/app_bar_layout"
43             android:layout_height="wrap_content"
44             android:layout_width="match_parent"
45             android:theme="@style/PrivacyBrowserAppBarLight" >
46
47             <androidx.appcompat.widget.Toolbar
48                 android:id="@+id/toolbar"
49                 android:layout_height="wrap_content"
50                 android:layout_width="match_parent"
51                 app:layout_scrollFlags="scroll|enterAlways|snap" />
52
53             <!-- The `FrameLayout` allows `appBar` and `find_on_page_app_bar` to occupy the same space. -->
54             <!-- <FrameLayout
55                 android:layout_height="wrap_content"
56                 android:layout_width="match_parent" >
57
58                 <android.support.v7.widget.Toolbar
59                     android:id="@+id/app_bar"
60                     android:layout_height="wrap_content"
61                     android:layout_width="match_parent"
62                     app:layout_scrollFlags="scroll|enterAlways|snap" /> -->
63
64                 <!-- `android:max` changes the maximum `ProgressBar` value from 10000 to 100 to match progress percentage.
65                     `android:layout_height="2dp"` works best for API >= 23, but `3dp` is required for visibility on API <= 22.
66                     `tools:ignore="UnusedAttribute"` removes the lint warning about `progressTint` and `progressBackgroundTint` not applying to API < 21. -->
67                 <!-- <ProgressBar
68                     android:id="@+id/progress_bar"
69                     style="?android:attr/progressBarStyleHorizontal"
70                     android:layout_height="3dp"
71                     android:layout_width="match_parent"
72                     android:layout_gravity="bottom"
73                     android:max="100"
74                     android:progressTint="?attr/progressTintColor"
75                     android:progressBackgroundTint="@color/transparent"
76                     android:visibility="gone"
77                     tools:ignore="UnusedAttribute" /> -->
78
79                 <!-- Include the Find on Page search bar. -->
80                 <!-- <include layout="@layout/find_on_page_app_bar" />
81             </FrameLayout> -->
82         </com.google.android.material.appbar.AppBarLayout>
83
84
85         <com.stoutner.privacybrowser.views.NestedScrollWebView
86             android:id="@+id/main_webview"
87             android:layout_height="match_parent"
88             android:layout_width="match_parent"
89             android:focusable="true"
90             android:focusableInTouchMode="true"
91             app:layout_behavior="@string/appbar_scrolling_view_behavior" />
92
93         <TextView
94             android:id="@+id/adview"
95             android:layout_height="wrap_content"
96             android:layout_width="wrap_content"
97             android:visibility="gone" />
98
99         <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
100             android:id="@+id/swiperefreshlayout"
101             android:layout_width="match_parent"
102             android:layout_height="match_parent" >
103         </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
104
105         <ProgressBar
106                     android:id="@+id/progress_bar"
107                     style="?android:attr/progressBarStyleHorizontal"
108                     android:layout_height="3dp"
109                     android:layout_width="match_parent"
110                     android:layout_gravity="bottom"
111                     android:max="100"
112                     android:progressTint="?attr/progressTintColor"
113                     android:progressBackgroundTint="@color/transparent"
114                     android:visibility="gone"
115                     tools:ignore="UnusedAttribute" />
116         <include layout="@layout/find_on_page_app_bar" />
117
118         <!-- Include the main `WebView`. -->
119         <!-- <include layout="@layout/main_webview" /> -->
120
121         <!-- `full_screen_video_framelayout` is used to display full screen videos.  It is initially `android:visibility="gone"` to hide it from view. -->
122         <FrameLayout
123             android:id="@+id/full_screen_video_framelayout"
124             android:layout_height="match_parent"
125             android:layout_width="match_parent"
126             android:visibility="gone"
127             android:background="@color/black" />
128     </androidx.coordinatorlayout.widget.CoordinatorLayout>
129
130     <!-- The navigation drawer. -->
131     <com.google.android.material.navigation.NavigationView
132         android:id="@+id/navigationview"
133         android:layout_height="match_parent"
134         android:layout_width="wrap_content"
135         android:layout_gravity="start"
136         app:headerLayout="@layout/navigation_header"
137         app:menu="@menu/webview_navigation_menu"
138         app:itemIconTint="?attr/navigationIconTintColor" />
139
140     <!-- Include the bookmarks drawer. -->
141     <include layout="@layout/bookmarks_drawer" />
142 </androidx.drawerlayout.widget.DrawerLayout>