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
0
votes
1 answer

Attempt to invoke virtual method 'int androidx.constraintlayout.motion.widget.MotionScene$Transition.getStartConstraintSetId()' on a null object refer

While I was working in motion layout. I got an error saying Attempt to invoke virtual method 'int androidx.constraintlayout.motion.widget.MotionScene$Transition.getStartConstraintSetId()' on a null object reference
0
votes
1 answer

MotionLayout rotate image and resetting rotation android

I'm rotating an imageview using MotionLayout. First click, image rotate clockwise, that's what i want. But second click, image rotate counterclockwise. I tried some way to reset state of image but it doesn't work. Can i have a advise???
0
votes
0 answers

HorizontalScrollView is jumping to the start on motion layout animation

When animating a motion layout(expand animation) inside a HorizontalScrollView at the end of the animation the scroll view jumps to the start(see attached video). Tried to use the following code to move scroll view back: …
0
votes
1 answer

Motionlayout two transitions not working properly

We are creating a transitions like youtube. We have exo player area and recyclerview underneath. When user drags top player area it should collapse and become mini player. When vertical video comes(9:16), scrolling recyclerview should minimise…
0
votes
0 answers

Changes after convert to MotionLayout not recorded in git

In a new fragment with a ConstraintLayout I convert it to MotionLayout by selecting the menu option "Convert to MotionLayout" The conversion completes successfully and the xml file with the MotionScene is created The problem is that none of these…
Dimitris
  • 725
  • 1
  • 10
  • 28
0
votes
1 answer

Android visibility not working for MotionLayout

I'm trying to make visibility changes for a view under MotionLayout using this answer https://stackoverflow.com/a/62658424/5412554 but for me, it's not working under observe. For eg: viewModel.messageLinkedList.observe(viewLifecycleOwner)…
0
votes
1 answer

Android OnClick on main layout does not work, is it because of MotionLayout?

I want to be able to perform onClickListner on root RelativeLayout called "rl". Not it does not work I suspect it can be because of MotionLayout as a children. How to solve that? Here is what I have done so far, my…
Qbi
  • 445
  • 4
  • 13
0
votes
1 answer

Is there a way to have multiple independent transitions in motion layout?

Let me explain the problem with an example. I wish to animate two (or more) "cubes" in motion layout. Cube:
GetLucky
  • 3
  • 1
0
votes
1 answer

Android my motionlayout constraints does not react to child views

I wonder if this is possible to modify child of direct view in MotionScene. I have FrameLayout with two views inside and one of them (iv_avatar) I want to make smaller width and height at the end of the animation but my motion scene does not work in…
Qbi
  • 445
  • 4
  • 13
0
votes
1 answer

Issue with preferedWrapContent and ConstraintLayout

I'm using a Composable which take a content @Composable in parameter, and it seems that with the final version of ConstraintLayout, there is no update. Here is the code @Composable fun Example( modifier : Modifier = Modifier, content :…
0
votes
1 answer

how can i create this horizontal recycler view(or view pager) in android?

when I scroll screen down the item of recycler view became collapse(when scroll down) and expand(when scroll up) this is expand mode of item and this is collapse mode of item of recycler view my question is how can I implement this view item in my…
0
votes
1 answer

Apply bezier curve to MotionLayout at runtime

I have used this article to create an expand/collapse cardview component. Right now, the expand/collapse animation is linear. I want to apply a bezier curve to the animation so that the animation will be ease-in-out. I have googled a lot and…
Jayesh Babu
  • 1,389
  • 2
  • 20
  • 34
0
votes
1 answer

MotionLayout not recyclable as a child of RecyclerView

i try to implement programmatically version of MotionLayout by extending it. And i have a base activity ayout using RecyclerView. However, when i add my motion layout as an item of the RecyclerView, the view is not recycled when i try to scrolling…
fanjavaid
  • 1,676
  • 8
  • 34
  • 65
0
votes
1 answer

Unwanted gap in MotionLayout after child-item collapse

Im studying how to work with MotionLayout right now and each project facing strange problem with unwanted white gap at the bottom of parent frame after my TextView (or TextView wrapped by other frame) collapsing. That gap could be bigger or smaller…