I want to rotate the image inside the button on click of the button. I tried with just ImageView and it works but for accessibility purpose I need to use Button instead of ImageView.
Before click :
Here the down arrow is button background.
After Click :
Click of button displays extra data and background arrow is rotated. How can I animate and rotate button background on click?
Layout code for reference :
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical" >
<LinearLayout
android:id="@+id/cases_actions_row"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:orientation="horizontal" >
<Button
android:id="@+id/case_action_item_1"
style="@style/card_action_button"
android:layout_height="wrap_content"
android:layout_width="wrap_content" />
<Button
android:id="@+id/case_action_item_2"
style="@style/card_action_button"
android:layout_height="wrap_content"
android:layout_width="wrap_content" />
</LinearLayout>
<Button
android:id="@+id/cases_expand_button"
style="@style/card_action_button"
android:layout_height="20dp"
android:layout_width="20dp"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:background="@drawable/ic_arrow" />
</RelativeLayout>