facebook / fresco

An Android library for managing images and the memory they use.
https://frescolib.org/
MIT License
17.07k stars 3.75k forks source link

how to animate from circle to normal draweeview in share element transition? #1441

Closed anlijiu closed 6 years ago

anlijiu commented 8 years ago

I use https://github.com/facebook/fresco/samples/transition for example. add 'fresco:roundAsCircle="true"' to SimpleDraweeView of drawee_source.xml the shape doesn't change smoothly

kirwan commented 8 years ago

I don't believe that will work.

fresco:roundAsCircle is a boolean and you can't really animate a boolean. What could work but doesn't right now is to animate specified corner radius values.

If you'd be interested in providing a pull request, I believe that could be achieved by adding another transition to DraweeTransition.createTransitionSet(ScaleType, ScaleType). That works with numerical values and they are very well suited to transitions.

oprisnik commented 6 years ago

You can also manually add a circular reveal animation to your transition, which could give you the effect that you want, see https://github.com/facebook/fresco/issues/992

We're not going to implement a custom transition. However, if you want to add an example to the Showcase sample app, feel free to submit a pull request.