Skip to content

Instantly share code, notes, and snippets.

@yashwantGowla
Created March 12, 2021 10:20
Show Gist options
  • Save yashwantGowla/d2a79e54a5dc7c585618c3d59bef7daf to your computer and use it in GitHub Desktop.
Save yashwantGowla/d2a79e54a5dc7c585618c3d59bef7daf to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8"?>
<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="500">
<OnSwipe
motion:dragDirection="dragRight"
motion:touchAnchorId="@id/button"
motion:touchAnchorSide="right" />
</Transition>
<ConstraintSet android:id="@+id/start">
<Constraint android:id="@id/button">
<Layout
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_marginStart="10dp"
motion:layout_constraintBottom_toBottomOf="parent"
motion:layout_constraintStart_toStartOf="parent"
motion:layout_constraintTop_toTopOf="parent" />
</Constraint>
</ConstraintSet>
<ConstraintSet
android:id="@+id/end"
motion:deriveConstraintsFrom="@id/start">
<Constraint android:id="@id/button">
<Layout
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_marginEnd="10dp"
motion:layout_constraintEnd_toEndOf="parent" />
</Constraint>
</ConstraintSet>
</MotionScene>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment