Implement SwipeToRefresh for real this time.
[PrivacyBrowser.git] / app / src / main / res / layout / activity_webview.xml
1 <?xml version="1.0" encoding="utf-8"?>
2
3 <!--
4   Copyright 2015-2016 Soren Stoutner <soren@stoutner.com>.
5
6   This file is part of Privacy Browser <https://privacybrowser.stoutner.com/>.
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 <!-- Setting the layout root to be focusableInTouchMode prevents urlTextBox from stealing focus on launch and opening the keyboard. -->
22 <android.support.design.widget.CoordinatorLayout
23     android:id="@+id/rootCoordinatorLayout"
24     xmlns:android="http://schemas.android.com/apk/res/android"
25     xmlns:app="http://schemas.android.com/apk/res-auto"
26     xmlns:tools="http://schemas.android.com/tools"
27     tools:context="com.stoutner.privacybrowser.MainWebViewActivity"
28     android:layout_width="match_parent"
29     android:layout_height="match_parent"
30     android:focusable="true"
31     android:focusableInTouchMode="true" >
32
33     <android.support.design.widget.AppBarLayout
34         android:id="@+id/appBarLayout"
35         android:layout_width="match_parent"
36         android:layout_height="wrap_content"
37         android:theme="@style/AppTheme.AppBarOverlay" >
38
39         <android.support.v7.widget.Toolbar
40             android:id="@+id/appBar"
41             android:layout_width="match_parent"
42             android:layout_height="?attr/actionBarSize"
43             android:background="?attr/colorPrimary"
44             app:popupTheme="@style/AppTheme.PopupOverlay" />
45     </android.support.design.widget.AppBarLayout>
46
47     <!-- android:layout_martinTop="?attr/actionBarSize" moves the SwipeRefreshLayout below the AppBarLayout, which otherwise would cover the top of the WebView. -->
48     <android.support.v4.widget.SwipeRefreshLayout
49         android:id="@+id/swipeRefreshLayout"
50         android:layout_width="match_parent"
51         android:layout_height="match_parent"
52         android:layout_marginTop="?attr/actionBarSize">
53
54         <!-- Google does not currently want to support hiding the AppBar on scroll for a WebView child with the Support Toolbar.  https://code.google.com/p/android/issues/detail?id=200394 -->
55         <WebView
56             android:id="@+id/mainWebView"
57             android:layout_width="match_parent"
58             android:layout_height="match_parent"
59             android:focusable="true"
60             android:focusableInTouchMode="true"/>
61
62     </android.support.v4.widget.SwipeRefreshLayout>
63
64     <!-- fullScreenVideoFrameLayout is used to display full screen videos.  It is initially android:visibility="gone" to hide it from view. -->
65     <FrameLayout
66         android:id="@+id/fullScreenVideoFrameLayout"
67         android:layout_width="match_parent"
68         android:layout_height="match_parent"
69         android:visibility="gone"
70         android:background="@color/black" />
71 </android.support.design.widget.CoordinatorLayout>