Adding a blur effect at runtime

105 views Asked by At

I try to move my image one position to another with animation.Here is a my code

 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();
    });

this code working perfect.I have two questions 1) Is the any way to check view's x1 and y1 runtime? 2) Is a any way or any library to add blur effect in my view runtime? I would to increase blur effect when view starting moving. Thanks

0

There are 0 answers