I'm rotating an imageview using MotionLayout.
First click, image rotate clockwise, that's what i want.
But second click, image rotate counterclockwise. I tried some way to reset state of image but it doesn't work. Can i have a advise???
<MotionScene
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:motion="http://schemas.android.com/apk/res-auto">
<Transition
motion:constraintSetEnd="@+id/end"
motion:constraintSetStart="@id/start"
motion:duration="1500">
<OnClick motion:clickAction="toggle"
motion:targetId="@id/img_reload_cast_dialog"/>
</Transition>
<ConstraintSet android:id="@+id/start">
<Constraint
android:id="@+id/img_reload_cast_dialog"
motion:layout_constraintEnd_toStartOf="@id/img_help_cast_dialog"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/_20sdp"
motion:layout_constraintTop_toTopOf="parent" >
<Transform android:rotation="0" />
</Constraint>
</ConstraintSet>
<ConstraintSet android:id="@+id/end">
<Constraint
android:id="@+id/img_reload_cast_dialog"
motion:layout_constraintEnd_toStartOf="@id/img_help_cast_dialog"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/_20sdp"
motion:layout_constraintTop_toTopOf="parent" >
<Transform android:rotation="720" />
</Constraint>
</ConstraintSet>
</MotionScene>