Questions tagged [android-motionlayout]

MotionLayout is intended to move, resize, and animate UI elements with which users interact, such as buttons and title bars. Motion in your app should not be simply a gratuitous special effect in your application. It should be used to help users understand what your application is doing. For more information on designing your app with motion, see the Material Design section on

https://material.io/design/motion

Getting started with MotionLayout

Follow the steps described in the following link.

https://developer.android.com/training/constraint-layout/motion-layout#getting_started

349 questions
9
votes
2 answers

Android collapsing toolbar with MotionLayout - disable motion when RecyclerView is empty/not scrollable

I'm trying to use the MotionLayout View to get a collapsing toolbar behavior. My approach is similar to the example here: https://blog.stylingandroid.com/motionlayout-collapsing-toolbar-part-1/ This works fine, but the transition also starts on…
9
votes
1 answer

Programmatically change ConstraintSet attribute in motion scene of MotionLayout

I have a use case where I want to create Youtube like animation using MotionLayout. There is a sample for this animation in this repo. But the problem is that in this example they use static height for starting constraint like this which is…
8
votes
1 answer

MotionLayout's child ignores "setVisibility"

Let's say I have simple UI with motion layout: // activity_main.xml
Ivan Škugor
  • 317
  • 2
  • 12
8
votes
3 answers

slowing down motionLayout animation on swipe

I have motionLayout animation with the transition:
Rainmaker
  • 7,673
  • 4
  • 38
  • 63
8
votes
2 answers

Android MotionLayout state not updating when changing constraint programatically

I have a very simple MotionLayout and I'm trying to change the visibility of one of the constraints programatically and have the view reflect that change. However the change isn't reflected until I transition away from the current state and then…
odiggity
  • 1,039
  • 9
  • 22
8
votes
4 answers

Android MotionLayout crashes when migrating from alpha-2 to alpha-3

I'm playing with MotionLayout and got a strange issue When i changed used library version from com.android.support.constraint:constraint-layout:2.0.0-alpha2 to com.android.support.constraint:constraint-layout:2.0.0-alpha3 my app…
7
votes
1 answer

Android MotionLayout: How to handle both click and swipe events on same view? (video examples included)

I need to implement this in my app. It's best if you looked at the video examples because I can't explain it precisely with words: Drag motion : https://streamable.com/i0aen Click motion :https://streamable.com/7eahj I was able to implement them…
7
votes
2 answers

MotionLayout problems with children intercepting touch events

I have a motionLayout for the root container, in my main layout. Inside it, there are other views. One of them is a frameLayout, containing a fragment. The fragment is a page, consisting a NestedScrollView etc... MotionLayout has OnSwipe for only…
7
votes
1 answer

How to resize TextView using MotionLayout

I'm trying to create a CollapsingToolbar animation using MotionLayout. I've successfully animated everything to behave just like a CollapsingToolbar with a high level of flexibility, which means I can easily create awesome animations without…
7
votes
2 answers

MotionLayout in AndroidX does not exist

Android Studio cannot find MotionLayout in xml. I use the androidx.constraintlayout.motion.widget.MotionLayout tag and get a gray screen. I’m also implementing 'com.android.support.constraint:constraint-layout:2.0.0-alpha4' and changing to alpha02…
P1NG2WIN
  • 538
  • 4
  • 20
7
votes
3 answers

Android CustomAttribute in MotionLayout to change Text in TextView

Anyone can help me with the correct way to change TextView's text in MotionLayout... this is what I doing. I'm testing the MotionLayout on a Simple App... I reach the part on the Motion tutorials about CustomAttributes With them you can change the…
6
votes
2 answers

How to restore transition state of MotionLayout without auto-playing the transition?

My code Activity class SwipeHandlerActivity : AppCompatActivity(R.layout.activity_swipe_handler){ override fun onSaveInstanceState(outState: Bundle) { super.onSaveInstanceState(outState) outState.putBundle("Foo",…
A. Patrik
  • 812
  • 4
  • 12
6
votes
3 answers

Android MotionLayout OnSwipe not working when touch region contains a RecyclerView

I'm trying to implement this player animation I also want to be able to both swipe on songs while collapsed and while expanded. So the idea was to use a MotionLayout with a RecyclerView, and also have each item of the RecyclerView be a…
6
votes
5 answers

Motion Layout with swipe gesture + SwipeRefreshLayout + RecyclerView bug wrong behavior scrolling up

I'm using MotionLayout to build UI with 2 parts - top one with some view and bottom one with SwipeRefresh and RecyclerView inside. Also I have a single gesture for MotionLayout - SwipeRefresh moves up above top view on swipe up. The problem is when…
6
votes
5 answers

android:textSize change in MotionLayout

I am going to animate text size change using MotionLayout. I do the following for start state And the following for end state
Artyom
  • 1,089
  • 14
  • 20
1
2
3
23 24