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