Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NestedWebview's Scroll not same as in CollapsingToolbarLayout #16

Open
kelalaka153 opened this issue Jul 1, 2019 · 0 comments
Open

Comments

@kelalaka153
Copy link

kelalaka153 commented Jul 1, 2019

I've come into this library with stackoverflow suggestions to Android bug with Webview and NestedScrollView.

The replacement is very easy and I've got rid of the app crush on large web pages. However, the scrolling not same as the default CollapsingToolbarLayout.

  1. The webview scroll into the CollapsingToolbar as soon as scrolling started.
  2. The CollapsingToolbar coming down very fast on down scrool

I think the CollapsingToolbar and the webview scrolls together.

Can we solve this?

XML

<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.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:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    tools:context=".ArticleReaderActivity"
    >

<com.google.android.material.appbar.AppBarLayout
        android:id="@+id/app_bar_layout"
        android:layout_width="match_parent"
        android:layout_height="200dp"
        android:fitsSystemWindows="true"
        android:theme="@style/ThemeOverlay.MaterialComponents.ActionBar.Primary">

    <com.google.android.material.appbar.CollapsingToolbarLayout
            android:id="@+id/collapsing_toolbarLayout"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:contentScrim="?attr/colorPrimary"
            app:expandedTitleMarginEnd="64dp"
            app:expandedTitleMarginStart="48dp"
            app:expandedTitleTextAppearance="@style/ExpandedAppBar"
            app:collapsedTitleTextAppearance="@style/CollapsedAppBar"
            app:expandedTitleGravity="bottom|center_horizontal"
            app:layout_scrollFlags="scroll|exitUntilCollapsed">

        <ImageView
                android:id="@+id/imageview_section_reader"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:scaleType="fitXY"
                app:layout_collapseMode="parallax"
                android:contentDescription="@string/desc"
                />

        <include layout="@layout/toolbar"/>

    </com.google.android.material.appbar.CollapsingToolbarLayout>

</com.google.android.material.appbar.AppBarLayout>


<com.test.NestedWebView
        android:id="@+id/webviev_section_reader"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_margin="0dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"/>`

 </androidx.coordinatorlayout.widget.CoordinatorLayout>
@kelalaka153 kelalaka153 changed the title NestedWebview's Scrool not same as in CollapsingToolbarLayout NestedWebview's Scroll not same as in CollapsingToolbarLayout Jul 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant