Hello! I decided to make an application for one site, base - WebView. It was decided to use the QuickReturn Toolbar (which would be hidden when scrolling content).

Created this markup:

<?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/activity_toster" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="ru.SnowVolf.toster.TosterActivity" style="@style/AppTheme"> <android.support.design.widget.AppBarLayout android:id="@+id/appbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:fitsSystemWindows="true"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" app:layout_scrollFlags="scroll|enterAlways|snap" app:popupTheme="@style/AppTheme.AppBarOverlay"/> </android.support.design.widget.AppBarLayout> <android.support.v4.widget.NestedScrollView android:layout_width="match_parent" android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior"> <WebView android:id="@+id/webView" android:layout_width="match_parent" android:layout_height="match_parent"/> </android.support.v4.widget.NestedScrollView> </android.support.design.widget.CoordinatorLayout> 

It seems that I have achieved what I wanted, the toolbar is hidden and revealed when scrolling, but the WV itself is simply frisic, scrolling has lost its speed and smoothness, and the button presses on the page occur with a noticeable delay.

I suspect that this is due to NestedScrollView , since if you remove it, everything NestedScrollView to normal. Without it, I could not get the app:layout_behavior="@string/appbar_scrolling_view_behavior flag to work app:layout_behavior="@string/appbar_scrolling_view_behavior . If you register layout_behavior directly in WebView, the toolbar disappears when scrolling down, but does not appear when scrolling up (until the next restart). Maybe someone will send to the right one way? Thanks in advance.

  • Wrap the WebView in ScrollView - Flippy
  • The brakes are gone, but the Toolbar is no longer hidden - De-Bill
  • Did you add a behavior to ScrollView ? - Flippy
  • Of course. All the same. - De-Bill

0