I am currently trying to create a circular transition between my FAB and another Activity.
From what I understodd in the documentation, I should use makeSceneTransitionAnimation in a similar way to this:
public void onFabClicked(View v){
try {
Intent intent = new Intent(this, SearchActivity.class);
ActivityOptions options = ActivityOptions
.makeSceneTransitionAnimation(this, v, "reveal");
startActivity(intent, options.toBundle());
} catch (Exception e) {
// makeSceneTransitionAnimation not supported, maybe a check of SDK level is enough to avoid catching an error?
Intent intent = new Intent(this, SearchActivity.class);
startActivity(intent);
e.printStackTrace();
}
}
Unfortunately, the current animation displays a rectangle during the animation.
How is it possible to turn this into the beautiful circular reveal that we love in Lollipop?
Thanks.
EDIT:
I am trying to achieve this (except that the color should be fullscreen, but you got the point..)):
What I actually get:
OK, I used this as an example: it's working fine:
Code on Github from saulmm
But.... Yes, that's simple and works fine, but this is not really the most efficient way to achieve the effect, I guess. Adding an extra view to your layout and playing with visibility is maybe not the optimal way.
It had a lot of trouble implemented George Mount's solution. But as this solution is written by a Software Engineer at Google, working in the Android UI Toolkit team, and suggested by Alex, an other Google engineer, I guess that I should spend more time with it as it doesn't require an extra view in my layout...
The second one is a little bit harder for me, but will work on it.
In any way, the problem is solved.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With