Skip to content

Instantly share code, notes, and snippets.

@gilgoldzweig
Last active January 7, 2020 07:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gilgoldzweig/3f7715ad47c63c2efbd90e8736597b13 to your computer and use it in GitHub Desktop.
Save gilgoldzweig/3f7715ad47c63c2efbd90e8736597b13 to your computer and use it in GitHub Desktop.
entire animation motion scene
<?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:motionInterpolator="easeInOut">
<OnSwipe
motion:dragDirection="dragUp"
motion:touchAnchorId="@id/scrollable_content" />
</Transition>
<ConstraintSet android:id="@+id/start">
<Constraint
android:id="@id/search_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:elevation="4dp"
motion:layout_constraintEnd_toEndOf="parent"
motion:layout_constraintStart_toStartOf="parent"
motion:layout_constraintTop_toBottomOf="@id/navigation_icon" />
<Constraint
android:id="@+id/toolbar_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:elevation="4dp"
motion:layout_constraintBottom_toBottomOf="@id/navigation_icon"
motion:layout_constraintStart_toEndOf="@id/navigation_icon"
motion:layout_constraintTop_toTopOf="@id/navigation_icon" />
<Constraint android:id="@id/navigation_icon">
<CustomAttribute
motion:attributeName="ColorFilter"
motion:customColorValue="#000000" />
</Constraint>
<Constraint android:id="@id/menu_icon">
<CustomAttribute
motion:attributeName="ColorFilter"
motion:customColorValue="#000000" />
</Constraint>
</ConstraintSet>
<ConstraintSet android:id="@+id/end">
<Constraint
android:id="@id/search_view"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="16dp"
android:layout_marginBottom="16dp"
android:elevation="4dp"
motion:layout_constraintBottom_toTopOf="@+id/guideline_toolbar"
motion:layout_constraintEnd_toStartOf="@id/menu_icon"
motion:layout_constraintStart_toEndOf="@id/navigation_icon"
motion:layout_constraintTop_toTopOf="parent" />
<Constraint
android:id="@+id/toolbar_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:elevation="4dp"
motion:layout_constraintBottom_toTopOf="parent"
motion:layout_constraintStart_toEndOf="@id/navigation_icon" />
<Constraint
android:id="@+id/guideline_toolbar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
motion:layout_constraintGuide_begin="65dp" />
<Constraint android:id="@id/navigation_icon">
<CustomAttribute
motion:attributeName="ColorFilter"
motion:customColorValue="#ffffff" />
</Constraint>
<Constraint android:id="@id/menu_icon">
<CustomAttribute
motion:attributeName="ColorFilter"
motion:customColorValue="#ffffff" />
</Constraint>
</ConstraintSet>
</MotionScene>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment