在运行时添加模糊效果

时间:2019-01-10 06:49:01

标签: android android-layout android-animation android-blur-effect

我尝试通过动画将图像从一个位置移动到另一个位置。这是我的代码

 int[] locationTo = new int[2];
    secondView.getLocationOnScreen(locationTo);
    int x1 = locationTo[0];
    int y1 = locationTo[1];


    logo.post(() -> {
        float height = logo.getHeight();
        logo.animate()
                .x(x1)
                .y(y1 - (height * 2))
                .setDuration(5000)
                .setListener(new Animator.AnimatorListener() {
                    @Override
                    public void onAnimationStart(Animator animator) {

                    }

                    @Override
                    public void onAnimationEnd(Animator animator) {

                    }

                    @Override
                    public void onAnimationCancel(Animator animator) {

                    }

                    @Override
                    public void onAnimationRepeat(Animator animator) {

                    }
                })
                .start();
    });

此代码运行完美。我有两个问题 1)有什么方法可以检查视图的x1和y1运行时吗? 2)是否有任何方法或库在我的视图运行时中添加模糊效果?当视图开始移动时,我会增加模糊效果。 谢谢

0 个答案:

没有答案
相关问题