Android:点击按钮后布局上的动画,最低SDK版本为14

在最低SDK版本14应用程序中,如何在 Android中完成与此相同的效果

enter image description here

>背景效果
>滑动切换按钮
>我的minSDKVersion是14

看起来像是在背景上放大动画的圆圈,还是有更具体的功能呢?

非常感谢…

解决方法

看看 Circular Reveal from touch point

@Override
public boolean onTouch(View view,MotionEvent motionEvent) {
    if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) {
        if (view.getId() == R.id.square_yellow) {
            revealFromCoordinates(motionEvent.getRawX(),motionEvent.getRawY());
        }
    }
    return false;
}

private Animator animateRevealColorFromCoordinates(int x,int y) {
    float finalRadius = (float) Math.hypot(viewRoot.getWidth(),viewRoot.getHeight());

    Animator anim = ViewAnimationUtils.createCircularReveal(viewRoot,x,y,finalRadius);
    viewRoot.setBackgroundColor(color);
    anim.start();
}

enter image description here

相关文章

Android性能优化——之控件的优化 前面讲了图像的优化,接下...
前言 上一篇已经讲了如何实现textView中粗字体效果,里面主要...
最近项目重构,涉及到了数据库和文件下载,发现GreenDao这个...
WebView加载页面的两种方式 一、加载网络页面 加载网络页面,...
给APP全局设置字体主要分为两个方面来介绍 一、给原生界面设...
前言 最近UI大牛出了一版新的效果图,按照IOS的效果做的,页...