Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
203 views
in Technique[技术] by (71.8m points)

Feature discovery animations for Android

Since May, Google has updated their Material Design guidelines on their website. I have seen an interesting and cool design pattern in one of the new sections named Feature discovery.

I would like to implement the animation for 'discovering' the Navigation Drawer button. There is a similar animation in the last update of Google Fit, for the navigation drawer and floating action button.

As often, for Android animations, Google provide a nice and awesome UI guideline, but we don't have any further information for developing it for our own apps.

Do you know if there are native solutions with Android libraries to implement these kind of animations? If yes, is it available for below Android 5.0 (API 21) - it can be above Android 4.1+?

Edit : I made a Github project to realise the same animation. You can find it here : https://github.com/Guimareshh/Feature-discovery-animations

Thanks !

question from:https://stackoverflow.com/questions/37466174/feature-discovery-animations-for-android

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You need to make custom animation or else you can use Ripple Effect + Reveal and set it to navigation drawer icon,

Circular Reveal Animation

void enterReveal() {
    // previously invisible view
    final View myView = findViewById(R.id.my_view);

    // get the center for the clipping circle
    int cx = myView.getMeasuredWidth() / 2;
    int cy = myView.getMeasuredHeight() / 2;

    // get the final radius for the clipping circle
    int finalRadius = Math.max(myView.getWidth(), myView.getHeight()) / 2;

    // create the animator for this view (the start radius is zero)
    Animator anim =
        ViewAnimationUtils.createCircularReveal(myView, cx, cy, 0, finalRadius);

    // make the view visible and start the animation
    myView.setVisibility(View.VISIBLE);
    anim.start();
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...