-1

Is there a way to draw in MotionLayout a view path without canvas.drawPath(path, p) ?

example1

example2

Filburt
  • 17,626
  • 12
  • 64
  • 115
cooper_so
  • 1
  • 1
  • 2

1 Answers1

0

MotionLayout does not provide a drawing API. There are many solutions to this. The simplest no code solution is to Use Lottie (Medium on Lottie animations in MotionLayout) Put a LottieAnimationView in the MotionLayout and drive the progress.

https://airbnb.io/lottie/#/android?id=core-classes The advantage is no code. The disadvantage is it would not be dynamic to the shape of the phone/language

Building your own CustomView that is driven from MotionLayout is also very simple.

hoford
  • 4,918
  • 2
  • 19
  • 19