Skip to content

Instantly share code, notes, and snippets.

View gilgoldzweig's full-sized avatar

Gil Goldzweig gilgoldzweig

View GitHub Profile
@gilgoldzweig
gilgoldzweig / sample_collapsing_animation_scene.xml
Last active December 27, 2019 10:53
start constraint set
<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"
@gilgoldzweig
gilgoldzweig / sample_collapsing_animation_scene.xml
Created December 27, 2019 10:47
toolbar icons start constraint
<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" />
@gilgoldzweig
gilgoldzweig / sample_collapsing_animation_scene.xml
Last active December 27, 2019 10:46
toolbar title start constraint
<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" />
@gilgoldzweig
gilgoldzweig / sample_collapsing_animation_scene.xml
Last active December 27, 2019 10:56
SearchView constraint
<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" />
@gilgoldzweig
gilgoldzweig / sample_collapsing_animation_scene.xml
Last active December 27, 2019 10:13
MotionScene constraint end|-|&tag=MotionLayout
<ConstraintSet android:id="@+id/end">
<Constraint
android:id="@id/search_view"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="16dp"
android:elevation="4dp"
motion:layout_constraintEnd_toStartOf="@id/menu_icon"
motion:layout_constraintStart_toEndOf="@id/navigation_icon"
motion:layout_constraintTop_toTopOf="parent"
@gilgoldzweig
gilgoldzweig / sample_collapsing_animation_scene.xml
Last active December 27, 2019 10:15
MotionScene transition
<Transition
motion:constraintSetEnd="@+id/end"
motion:constraintSetStart="@id/start"
motion:motionInterpolator="easeInOut">
<OnSwipe
motion:dragDirection="dragUp"
motion:moveWhenScrollAtTop="true"
motion:onTouchUp="stop"
motion:touchAnchorId="@id/scrollable_content"
@gilgoldzweig
gilgoldzweig / sample_collapsing_animation_scene.xml
Last active December 27, 2019 10:15
MotionScene triger|-|&tag=MotionLayout
<OnSwipe
motion:dragDirection="dragUp"
motion:moveWhenScrollAtTop="true"
motion:onTouchUp="stop"
motion:touchAnchorId="@id/scrollable_content"
motion:touchAnchorSide="top"
motion:dragScale="1"/>
@gilgoldzweig
gilgoldzweig / sample_collapsing_animation_scene.xml
Last active December 27, 2019 10:15
MotionScene constraint start|-|&tag=MotionLayout
<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"
@gilgoldzweig
gilgoldzweig / sample_collapsing_animation_scene.xml
Last active December 27, 2019 10:16
MotionScene root tag|-|&tag=MotionLayout
<MotionScene xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:motion="http://schemas.android.com/apk/res-auto">
</MotionScene>
@gilgoldzweig
gilgoldzweig / sample_collapsing_animation.xml
Last active December 27, 2019 10:18
MotionLayout layout recyclerview|-|&tag=MotionLayout
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/scrollable_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/guidline_toolbar" />