KissLick
KissLick

Reputation: 37

How to animate drawable in Android Motion Layout

I am trying out the motion layout and I would like to have a floating action button with animated icon on it. I got all the motion layout stuff down and working. But I can't find a way to get the animated FAB icon to work.

// ic_menu_toggle_arrow_down is my Animated Vector Drawable    
<com.google.android.material.floatingactionbutton.FloatingActionButton
        android:id="@+id/menuToggle"
        android:clickable="true"
        android:src="@drawable/ic_menu_toggle_arrow_down"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent" />

Basically, I want to animate the FAB icon alongside the motion layout animation (back and forth). And I would like to do this in the motion layout scene preferably.

Thanks for any ideas guys

Upvotes: 1

Views: 347

Answers (0)

Related Questions