henrytao-me / smooth-app-bar-layout

Smooth version of Google Support Design AppBarLayout
Apache License 2.0
1.77k stars 240 forks source link

downscroll in appbarlayout #217

Open vishal044 opened 6 years ago

vishal044 commented 6 years ago

Hi, i made collapsable layout, put frame in it and recycler below it. scrolling it up to collapse the frame is fine, but scrolling down isnt smooth. kindly help.

`<?xml version="1.0" encoding="utf-8"?> <LinearLayout 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:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:clickable="true" android:focusableInTouchMode="true">

<EditText

    android:id="@+id/location_id"
    android:hint="Enter location"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:inputType="textPersonName"
    android:text="chandigarh" />

<Button
    android:id="@+id/loc_button"
    android:textSize="10sp"
    android:text="Enter"
    android:textStyle="italic"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"/>

<android.support.design.widget.CoordinatorLayout
    android:id="@+id/coordinate"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <android.support.design.widget.AppBarLayout
        android:id="@+id/appbarlayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@android:color/transparent">

        <android.support.design.widget.CollapsingToolbarLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:layout_scrollFlags="scroll|exitUntilCollapsed">

            <FrameLayout
                android:id="@+id/frame"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="20dp"
                app:layout_collapseMode="parallax"
                ></FrameLayout>

            <!--<android.support.v7.widget.Toolbar-->
                <!--android:layout_width="match_parent"-->
                <!--android:layout_height="wrap_content"-->
                <!--app:layout_collapseMode="pin"></android.support.v7.widget.Toolbar>-->

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

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

    <android.support.v7.widget.RecyclerView
        android:id="@+id/recycle"
        android:layout_marginTop="10dp"
        android:layout_marginLeft="10dp"
        android:layout_marginRight="10dp"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior" />

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

`

vishal044 commented 6 years ago

hey. fixed the issue . xD

had to add custom class extending AppbarLayout.behavior .

karasekkarolina commented 6 years ago

Hi, I think I've got the same problem. Any hint how to set AppbarLayout.behaivour correctly? Thank for answer.

henrytao-me commented 6 years ago

Hi @vishal044 @klepackovakarolina, there are few things you can try: