android - ExpandableListView not working properly -


i implementing app expandablelistview, fragment, viewpager , collapsingtoolbarlayout.

but have problem. expandablelistview has wrong behavior. remaining items below cut. , when click on item below top item displayed behind tablayout.

what error in code? thank you

main.xml

<?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:fitssystemwindows="true" android:layout_width="match_parent" android:layout_height="match_parent">  <android.support.design.widget.appbarlayout     android:id="@+id/appbar"     android:layout_width="match_parent"     android:layout_height="wrap_content"     android:theme="@style/themeoverlay.appcompat.dark.actionbar"     android:fitssystemwindows="true">      <android.support.design.widget.collapsingtoolbarlayout         android:id="@+id/collapsing_toolbar"         android:layout_width="match_parent"         android:layout_height="match_parent"         android:fitssystemwindows="true"         app:expandedtitlemarginstart="30dp"         app:expandedtitlemarginend="25dp"         app:expandedtitletextappearance="@style/headertitlestyle"         app:contentscrim="?attr/colorprimary"         app:layout_scrollflags="scroll|exituntilcollapsed">          <imageview             android:id="@+id/background"             android:layout_width="match_parent"             android:layout_height="wrap_content"             android:adjustviewbounds="true"             android:fitssystemwindows="true"             app:layout_collapsemode="parallax"             android:src="@drawable/img_oficinas"/>          <android.support.v7.widget.toolbar             android:id="@+id/toolbar"             android:layout_width="match_parent"             android:layout_height="?attr/actionbarsize"             android:minheight="?attr/actionbarsize"             android:background="@android:color/transparent"             app:theme="@style/toolbarcoloredbackarrow"             app:layout_collapsemode="pin"/>      </android.support.design.widget.collapsingtoolbarlayout>      <android.support.design.widget.tablayout         android:id="@+id/tabs"         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:layout_gravity="bottom"         android:background="@color/coloraccent"         app:tabtextcolor="@color/tabs_text_selector"         app:tabindicatorheight="3dp"         app:tabindicatorcolor="@android:color/white"/>  </android.support.design.widget.appbarlayout>  <android.support.v4.view.viewpager     android:id="@+id/container"     android:layout_width="match_parent"     android:layout_height="match_parent"     app:layout_behavior="@string/appbar_scrolling_view_behavior"/>  </android.support.design.widget.coordinatorlayout> 

fragment.xml

<?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.nestedscrollview    xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" app:layout_behavior="@string/appbar_scrolling_view_behavior" android:layout_width="match_parent" android:layout_height="match_parent" android:fillviewport="true">  <linearlayout     android:layout_width="match_parent"     android:layout_height="match_parent"     android:orientation="vertical">      <expandablelistview         android:id="@+id/expandablelistview"         android:layout_width="match_parent"         android:layout_height="match_parent"         android:groupindicator="@null"         android:background="@android:color/white"         android:dividerheight="0dp"         android:divider="@android:color/white" />  </linearlayout> </android.support.v4.widget.nestedscrollview> 

coordinatorlayout's scrollingviewbehavior works views support nested scrolling (exp recyclerview). expandablelistview not support default, coordinatorlayout not handling position of expandablelistview correctly.

for api >21 can obtain behavior by:

if (build.version.sdk_int >= build.version_codes.lollipop) {        setnestedscrollingenabled(true); } 

otherwise can switch custom recyclerview or expandablerecyclerview.


Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -