0

I know how to use CircularReveal to reveal a view, so I'm looking for a way to do something like "CircularHide". In other words, I want to invisible a view by a circular animation (increasing radius) after making it visible. How can I do that?

I've written this to reveal:

private void startCircularReveal() {
        RelativeLayout changeableLayout = findViewById(R.id.layoutChangeable);
        int centerX = (likeButton.getRight() + likeButton.getLeft()) / 2;
        int centerY = (likeButton.getBottom() + likeButton.getTop()) / 2;
        float endRadius = (float) Math.hypot(changeableLayout.getWidth(), changeableLayout.getHeight());

        changeableLayout.setVisibility(View.VISIBLE);
        Animator revealAnimator = ViewAnimationUtils.createCircularReveal(changeableLayout,
                centerX, centerY, 0, endRadius);
        revealAnimator.setDuration(200).start();
}
Farid Rjb
  • 148
  • 7
  • 1
    use transition api for visibility change animations https://stackoverflow.com/a/55648103/1372866 – ashakirov Oct 17 '20 at 06:07
  • Well, I haven't found any answers to this question so far and I decided to change the design. Therefore, I changed "Circular Hide" (a circle that becomes bigger and makes the other views transparent) with "visibility change animations" as @ashakirov said. If you have any further tricks, please share with me. – Farid Rjb Oct 20 '20 at 15:50

0 Answers0