android layout - CollapsingToobarLayout not always responding to listView scroll event -
so i've got pretty standard xml layout(see below), except tried workaround , wrapped listview in framelayout in order set scroll behavior listview , make appbarlayout respond scroll events. in code, manually call
.setnestedscrollingenabled(true)
on wrapped listview.
in cases, works totally fine.
<?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" android:layout_width="match_parent" android:layout_height="match_parent" > <android.support.design.widget.appbarlayout android:layout_width="match_parent" android:layout_height="200dp" app:layout_scrollflags="scroll|exituntilcollapsed" android:fitssystemwindows="true"> <android.support.design.widget.collapsingtoolbarlayout android:layout_width="match_parent" android:layout_height="match_parent" app:contentscrim="?attr/colorprimary" app:layout_scrollflags="scroll|exituntilcollapsed"> <android.support.v4.view.viewpager android:layout_width="match_parent" android:layout_height="match_parent" android:fitssystemwindows="true" app:layout_collapsemode="parallax" /> <android.support.v7.widget.toolbar android:id="@+id/anim_toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionbarsize" android:layout_gravity="top" app:layout_collapsemode="pin" app:theme="?toolbartheme"> <textview android:id="@+id/title" android:layout_width="match_parent" android:layout_height="wrap_content" /> </android.support.v7.widget.toolbar> </android.support.design.widget.collapsingtoolbarlayout> </android.support.design.widget.appbarlayout> <framelayout android:id="@+id/list_container" android:layout_width="match_parent" android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior"> <com.app.android.ui.util.scrolltoloadlistview android:layout_width="match_parent" android:layout_height="match_parent"/> </framelayout> </android.support.design.widget.coordinatorlayout>
however, appbarlayout only collapses when fling listview upwards, or else listview scroll underneath appbarlayout(completely covered), weird visually. note when appbarlayout collapse , try scroll listview down, appbarlayout expands no issues.
i've spent time digging whether or not problem specific listview, seems case recyclerview. wondering if has seen issue , explain why 2 components behave independent of each other in non-flinging events.
thanks help!
Comments
Post a Comment