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

MotionLayout - OnSwipe not working on clickable children

I am running into an issue using MotionLayout where a user cannot swipe up/down if they start their swipe on a clickable item. I want the user to be able to swipe over any part of the screen, and the swiping transition is triggered. Basically, the…
7
votes
1 answer

Bottom sheet + Android MotionLayout implementation

I am trying to implement Bottom sheet using MotionLayout. It works in a trivial case - when bottom sheet should be visible only in a half of screen (for example). But I can't make it work in a scenario when bottom sheet expands and fills whole…
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
3 answers

Fade in, fade out not working in MotionLayout

I'm trying to make an effect of fade in, fade out using alpha and motionLayout, but it seems that it's not working. This is the imageView that I want to fade.
7
votes
1 answer

Is it possible to animate groups visibility with MotionLayout?

I'm trying to make an animation with MotionLayout, and I need to hide some elements. I tested visibility attribute in an individual element and it works, but to make the XML shorter I would like to be able to specify just a group (from the…
Nicolás Vera
  • 177
  • 1
  • 9
7
votes
2 answers

Programmatically set margins in a MotionLayout

I have some views that need some margins set programmatically (from an applyWindowInsets listener), but the views seem to be ignoring any margins I set with my code, even though I am not animating the margins. I'm able to set padding just fine, but…
lbenedetto
  • 2,022
  • 1
  • 21
  • 39
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
  • 764
  • 1
  • 9
  • 24
6
votes
3 answers

MotionLayout breaks the redrawing of (nested) subviews

I'm having problems with views not refreshing in MotionLayout. Seems like at some point the refresh/redraw mechanism of MotionLayout becomes broken and the subviews (including the nested ones) are having random problems updating themselves on the…
frangulyan
  • 3,580
  • 4
  • 36
  • 64
6
votes
1 answer

KeyAttribute in MotionLayout is ignored on view "visibility" change

I'm using MotionLayout and to animate a bottomSheet View content, following swipe animation. Between start and end scenes I'd like to make appear a view view_player_status_margin using visibility from gone to visible (not using alpha…
smora
  • 717
  • 5
  • 18
6
votes
2 answers

How to smoothly change drawable resource during MotionLayout transition?

I want to change image in fab button during transition, but i haven't found how to do it with xml because CustomAttribute tag supports only drawable colors as values. My solution is to set TransitionAdapter to MotionLayout and change drawable in…
Shmuser
  • 202
  • 2
  • 10
6
votes
1 answer

Using MotionLayout and setting visibility using Databinding fails

I'm using implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta1', and have databinding enabled. When my view
6
votes
2 answers

MotionLayout onSwipe autocomplete speed

Is there any way I can speed up the animation that plays when I stop mid-swipe in a MotionLayout with an onSwipe transition? Currently it transitions very slowly to the start or end position.
sunilson
  • 1,449
  • 15
  • 31
6
votes
1 answer

Mimic Snackbar + CoordinatorLayout + FAB with new MotionLayout

Let's say we have a BottomNavigationBar with a FAB on top. When using this setup and showing a Snackbar, the Snackbar should appear above the BottomNavigationBar and push up/down the FAB while appearing/dismissing. This is a common scenario for the…
6
votes
1 answer

Android MotionLayout setGuidelinePercent not working on alpha4 release

I have a MotionLayout for a swipe transition in my app. Currently I just updated from 2.0.0-alpha3 to 2.0.0-alpha4 release and some things are not working as before. There is "myView" which is a layout that should expand from the bottom of the…
MihaiV
  • 695
  • 6
  • 14
6
votes
4 answers

How to use motion layout with recyclerview

trying to use MotionLayout with RecyclerView, when scrolling up, app is crashing with error: android.content.res.Resources$NotFoundException: Unable to find resource ID #0xffffffff fragment layout code is…
Asad
  • 1,241
  • 3
  • 19
  • 32
1 2
3
28 29