AAkira/ExpandableLayout

Does ExplandableLayout still works when used via include?

sika78 opened this issue · 0 comments

I had to build a new layout then i've included into my fragment class xml.
In kotlin I've added the lister: accordian_header.setOnClickListener { content.toggle() }

The tap is recognized but it doesn't expand the view/layout

Then I saw that none of the samples have used the include method, therefore I ask you:

  • Did someone tried to include a layout successfully?
  • What is the suggested approach in this case?

Thanks!

Here is my layout:

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/accordian_header"
        android:clickable="true">

        <TextView
            android:id="@+id/advanced_options_title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:padding="16dp"
            android:textColor="@color/blue"
            android:textStyle="bold"
            android:textAllCaps="true"
            android:text="@string/advance_option_title" />

        <ImageButton
            android:id="@+id/down_btn"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentEnd="true"
            android:layout_margin="8dp"
            android:src="@android:drawable/arrow_down_float" />
    </RelativeLayout>

    <com.github.aakira.expandablelayout.ExpandableLinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingLeft="14dp"
        android:paddingRight="14dp"
        android:paddingBottom="14dp"
        android:orientation="vertical"
        android:id="@+id/content"
        app:ael_expanded="false"
        app:ael_interpolator="bounce"
        app:ael_duration="500"
        app:ael_orientation="vertical">
       
        <Switch
            android:id="@+id/taggy"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_marginEnd="24dp"
            android:layout_marginStart="24dp"
            android:paddingEnd="8dp"
            android:paddingStart="8dp"
            android:checked="true"
            android:textSize="16sp"
            android:textAlignment="textStart"
            android:text="@string/aor"
            android:theme="@style/SCBSwitch"
            android:layout_alignParentTop="true" />

    </com.github.aakira.expandablelayout.ExpandableLinearLayout>

</LinearLayout>