Skip to content

Instantly share code, notes, and snippets.

View rodrigomartind's full-sized avatar
🏠
Working from home

Rodrigo Dominguez rodrigomartind

🏠
Working from home
View GitHub Profile
<androidx.constraintlayout.motion.widget.MotionLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
app:showPaths="true"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layoutDescription="@xml/tinder_scene1"
tools:context=".scenes.TinderScene1Activity">
<com.google.android.material.card.MaterialCardView
<?xml version="1.0" encoding="utf-8"?>
<MotionScene xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<ConstraintSet android:id="@+id/start">
<Constraint android:id="@id/cardOne">
<Layout
android:layout_width="270dp"
android:layout_height="424dp"
app:layout_constraintBottom_toBottomOf="parent"
<ConstraintSet android:id="@+id/unlike">
<Constraint android:id="@id/cardOne">
<Layout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginStart="50dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="200dp"
android:layout_marginBottom="80dp"
app:layout_constraintEnd_toEndOf="parent"
<Transition
android:id="@+id/startToUnlike"
app:constraintSetEnd="@+id/unlike"
app:constraintSetStart="@+id/start">
<OnSwipe
app:dragDirection="dragLeft"
app:onTouchUp="autoComplete"
app:touchAnchorSide="left"
app:touchRegionId="@id/cardOne" />
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.motion.widget.MotionLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:showPaths="true"
app:layoutDescription="@xml/tinder_scene5"
tools:context=".scenes.TinderScene5Activity">
<ConstraintSet android:id="@+id/start">
...
<Constraint android:id="@id/cardTwo">
<Layout
android:layout_width="270dp"
android:layout_height="424dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
<ConstraintSet android:id="@+id/unlike">
...
<Constraint android:id="@id/cardTwo">
<Transform
android:scaleX="1"
android:scaleY="1" />
</Constraint>
</ConstraintSet>
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.motion.widget.MotionLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:showPaths="true"
android:id="@+id/motionLayout"
app:layoutDescription="@xml/tinder_scene6"
tools:context=".scenes.TinderScene5Activity">
<?xml version="1.0" encoding="utf-8"?>
<MotionScene xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<Transition
app:constraintSetEnd="@+id/detail"
app:constraintSetStart="@id/start"
app:duration="500">
<OnClick
app:clickAction="toggle"
<?xml version="1.0" encoding="utf-8"?>
<MotionScene xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
...
<ConstraintSet android:id="@+id/start">
...
<Constraint android:id="@id/detailButton">
<Layout