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

430 questions
70
votes
7 answers

android:visibility changes to children of MotionLayout

I must be missing something with android:visibility changes within a motion layout. Here’s a simplified version of my layout. Bunch of image views, Text views that are constrainted to…
scottyab
  • 23,621
  • 16
  • 94
  • 105
57
votes
8 answers

Start motion scene programmatically

I have a motion layout with this layoutDescription: app:layoutDescription="@xml/scene" scene.xml
Pablo Cegarra
  • 20,955
  • 12
  • 92
  • 110
25
votes
9 answers

MotionLayout: MotionScene OnClick overrides setOnClickListener

I'm just starting to play with MotionLayout. I have defined an activity layout using MotionLayout that uses a MotionScene to hide and show a view. The MotionScene transition looks like this:
MayNotBe
  • 2,110
  • 3
  • 32
  • 47
21
votes
5 answers

Problem with multiple Transitions in Android MotionLayout

I'm playing around with the MotionLayout in Android. I'm using the alpha 2 version. 'com.android.support.constraint:constraint-layout:2.0.0-alpha2' I want to react to two different button clicks and trigger an animation for each of them. My current…
aba
  • 233
  • 1
  • 2
  • 8
17
votes
15 answers

Is it possible to disable MotionLayout?

I'v got a Fragment that hosts a RecyclerView within a MotionLayout. On top of the recycler view I've got a view that collapses and expands, all done in my motion scene. It is triggered by a click as well as responding to dragging the recycler view.…
stephanmantel
  • 1,807
  • 4
  • 16
  • 26
14
votes
5 answers

Android Motionlayout: Android resource linking failed

I keep getting build errors after a refactor to motionlayout 2.0.0-beta1 (I know it's not the newest version - beta2 produces same errors). Here's the stacktrace: AAPT:…
Bohsen
  • 4,242
  • 4
  • 32
  • 58
13
votes
1 answer

MotionLayout's child ignores "setVisibility"

Let's say I have simple UI with motion layout: // activity_main.xml
Ivan Škugor
  • 558
  • 1
  • 6
  • 21
13
votes
1 answer

Motion Layout with EditText destroys animations

I created a simple MotionLayout which is almost similar to a coordinator layout (animations are slightly different). Something like this here: Using (a couple) EditText Views within the content area breaks the MotionLayout Animations once the…
0xPixelfrost
  • 10,244
  • 5
  • 39
  • 58
13
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…
13
votes
1 answer

MotionLayout and ConstraintLayout not animating around children height

While playing with MotionLayouts in a RecyclerView I noticed that the MotionLayouts would not animate the wrapping around their children if these happened to change in height. A simple way to reproduce that behaviour would be with the following…
12
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
  • 1,530
  • 9
  • 20
12
votes
3 answers

How to run particular transition in MotionLayout?

I have a MotionScene with 4 ConstraintSets representing 4 states of screen (loading states) and with 3 Transitions between them. When my app state changes from e.g. loading to processing, I want to run Transition 1 (set1 -> set2), when state changes…
12
votes
5 answers

Motion layout prevents update on recyclerview

I have started using motion layout for some top bar scrolling, and looks like there is an issue that prevents recycler view from showing updated data. Currently I am using 2.0.0-alpha3 of ConstraintLayout. In the view I have toolbar and 2 tabs that…
user2141889
  • 2,255
  • 5
  • 23
  • 25
11
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…
11
votes
2 answers

How to let NestedScrollView scroll in MotionLayout?

I have a NestedScrollView in MotionLayout once Motion Scene is ended then NestedScrollView is visible but when i try scrolling the view no event's are going to NestedScrollView. Video of Requirement Layout xml:
Anmol
  • 8,110
  • 9
  • 38
  • 63
1
2 3
28 29