florent37 / ExpansionPanel

Android - Expansion panels contain creation flows and allow lightweight editing of an element.
https://material.io/guidelines/components/expansion-panels.html
Apache License 2.0
1.98k stars 239 forks source link

Header indicator not drawn when bound to ExpansionHeader #29

Closed roccadev closed 6 years ago

roccadev commented 6 years ago

I'm using an ImageView with a VectorDrawable; when expansion_headerIndicator attribute is not set, the image is shown, but whet it's set to the ImageView's id, the image is not shown anymore. I have minSdk=21, tried on Android 8.0.

<com.github.florent37.expansionpanel.ExpansionHeader
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:expansion_layout="@id/content"
                app:expansion_headerIndicator="@id/ivPanelIndicator"
                app:expansion_toggleOnClick="true">
    <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content">
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            tools:text="Text" />

        <ImageView
            android:id="@+id/ivPanelIndicator"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:scaleType="center"
            android:adjustViewBounds="true
            android:src="@drawable/ic_keyboard_arrow_down_24dp" />
    </LinearLayout>
</com.github.florent37.expansionpanel.ExpansionHeader>
florent37 commented 6 years ago

use AppCompatImageView and app:srcCompat

roccadev commented 6 years ago

Thanks. Since the app namespace is required and it won't work with android, no matter the sdk version, I suggest to highlight this info in the Readme.