takahirom / webview-in-coordinatorlayout

248 stars 71 forks source link

First scroll down doesn't work properly until a scroll up happens #4

Open Abdelhady opened 8 years ago

Abdelhady commented 8 years ago

The first continuous scroll down doesn't propagate the event as expected, I had to scroll 1 down then 1 up, then all is working fine,

I'm using a real device (LG G2) running KitKat 4.4.2, and here is the layout:

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    tools:context=".HomeActivity">

    <android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="@color/brand_color"
            android:elevation="4dp"
            android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
            app:layout_scrollFlags="scroll|enterAlways"
            app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />

    </android.support.design.widget.AppBarLayout>

    <net.begether.chaino.utils.NestedWebView
        android:id="@+id/webView"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_centerHorizontal="true"
        app:layout_behavior="@string/appbar_scrolling_view_behavior" />

</android.support.design.widget.CoordinatorLayout>
takahirom commented 8 years ago

Thank you for reporting! Can you prepare a sample project? And please tell me your tested device API Level.

Abdelhady commented 8 years ago

I've updated my original comment to include device info, I'm not sure I can prepare a sample project now, but after a little digging, I've fixed it and made a pull-request with the solution :)