3

So, I have a special case where the height of my appbarlayout fills the whole screen. I am using scroll|snap layout behavior for collapsingtoolbarlayout. The problem is that by default appbarlayout is collapsed when the user reaches more than 50 percent of the height of appbarlayout. For me, this behavior is not appropriate because with snap behavior this is difficult for the user to expand and collapse the appbarlayout.

I have already tried to expand or collapse it programmatically by putting checks on offset value in offset change listener but that doesn't help because the offset change listener gets called a lot of times and checks are not enough to serve the purpose.

<android.support.design.widget.AppBarLayout
        android:id="@+id/activity_campaign_details_app_bar_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:elevation="0dp">

    <android.support.design.widget.CollapsingToolbarLayout
            android:id="@+id/activity_campaign_details_collapsing_toolbar_bar_layout"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_scrollFlags="scroll|snap">


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

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

0 Answers0