Skip to content

Instantly share code, notes, and snippets.

@rodrigomartind
Created June 16, 2020 16:22
Show Gist options
  • Save rodrigomartind/fc924fdafe7f7bebfc5188edccbd9293 to your computer and use it in GitHub Desktop.
Save rodrigomartind/fc924fdafe7f7bebfc5188edccbd9293 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8"?>
<MotionScene xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<Transition
app:constraintSetEnd="@+id/detail"
app:constraintSetStart="@id/start"
app:duration="500">
<OnClick
app:clickAction="toggle"
app:targetId="@id/detailButton" />
</Transition>
...
</MotionScene>
@nowiwr01w
Copy link

nowiwr01w commented Oct 25, 2020

Hello.
Please, can you explain, why if I change to and implement only detail info through dropDown, it doesn't work? (sharp animation even if the duration is 5000)

P.S. in my MotionLayout I have Toolbar, which should disappear when the card is expanded to full screen

@rodrigomartind
Copy link
Author

Hi, could you share your MotionLayout file and your Motion Scene

@nowiwr01w
Copy link

nowiwr01w commented Oct 26, 2020

Of course. MotionScene file and MotionLayout file. Or you can just clone my repo

There are two problems

  1. was described above (I set OnClick, but the problem is still relevant)
  2. I set the duration value of offScreen(Like/Dislike) Transition to 3500, but there are no visible changes as if he just misses this state (start -> like -> start, but cards are moving, then this state is taken into account, but for some reason, it is not displayed)

Сould you please help me in solving these problems? 😭
P.S. Links updated

@nowiwr01w
Copy link

UPD: Solved the second issue by replacing the current version of ConstraintLayout to 'androidx.constraintlayout:constraintlayout:2.0.0-beta4' lol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment