Open Abhiseshan opened 9 years ago
Had the same problem too - not sure what is wrong. The only thing that worked for me was to use the source directly rather than gradle.
Try changing this
expandable:el_headerLayout="@layout/view_header" expandable:el_contentLayout="@layout/view_content"
to
app:el_headerLayout="@layout/view_header" app:el_contentLayout="@layout/view_content"
I fix by adding this declaration in project attrs.xml
file:
<declare-styleable name="ExpandableLayout">
<attr name="headerLayout" format="reference"/>
<attr name="contentLayout" format="reference" />
<attr name="duration" format="integer" />
</declare-styleable>
You can see I renamed the attributes name so in fragment xml file you can use expandable
namespace with attributes headerLayout
and contentLayout
like this:
<com.andexert.expandablelayout.library.ExpandableLayout
android:id="@+id/first"
android:layout_width="match_parent"
android:layout_height="wrap_content"
expandable:headerLayout="@layout/layout_accordion_header"
expandable:contentLayout="@layout/layout_accordion_content"
android:background="#e74c3c"/>
java.lang.IllegalArgumentException: HeaderLayout and ContentLayout cannot be null!
I have tried everything. Even copying the whole code.