![android studio 3.0.1 tutorial change background android studio 3.0.1 tutorial change background](https://i.stack.imgur.com/62zHo.png)
When the user performs a dragUp gesture on the specified touchAnchorId , the MotionScene will start interpolating between the two states defined (start and end). This indicates to the MotionLayout that it should monitor the layout for a swipe movement.
#Android studio 3.0.1 tutorial change background code
The next step, that can be seen in the code snippet above, is to create the OnSwipe declaration. We can also set the duration of the transition. We set the reference to the start and end ConstraintSets on the Transition object. The first thing that we will do, is define the Transition for this MotionScene. To do this, create an XML file in the xml folder of your application.
![android studio 3.0.1 tutorial change background android studio 3.0.1 tutorial change background](https://www.codingdemos.com/wp-content/uploads/2018/05/android-border-textview.png)
In order to animate this layout we need to describe how views should animate in the layout. The XML behind the following layout should look similar to this: Make sure the RecyclerView is constrained to the bottom of the ImageView. Add a RecyclerView and an ImageView to your layout. To get started, open up your editor and change the root element of your layout to use MotionLayout. Everything you’ve previously learnt about ConstraintLayout (ie barriers, chains etc) is applicable to layouts that we build with MotionLayout. The great part about MotionLayout is that it uses the same constructs as ConstraintLayout. (Note: MotionLayout is still in alpha at the time of writing) implementation 'nstraintlayout:constraintlayout:2.0.0-alpha3' Create your layout XML as per usual To get started with MotionLayout, you need to make sure we have the latest version in your adlefile. In this article, we will be looking at implementing a simple swipe action on a RecyclerView and how we can achieve the scaling animation with MotionLayout.