Create a circular opening for pre-cooled devices

Firstly, this is not a question that Create a circular display for devices with preliminary Lollipop (Android)

I use the library indicated there to create Circular Reveal, but it doesn't seem to work for me.

XML

<io.codetail.widget.RevealFrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <FrameLayout android:id="@+id/circBack" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#ff4081" android:visibility="invisible" ></FrameLayout> </io.codetail.widget.RevealFrameLayout> 

Java

  View myView = findViewById(R.id.circBack); // get the center for the clipping circle int cx = (myView.getLeft() + myView.getRight()) / 2; int cy = (myView.getTop() + myView.getBottom()) / 2; // get the final radius for the clipping circle int finalRadius = Math.max(myView.getWidth(), myView.getHeight()); SupportAnimator animator = ViewAnimationUtils.createCircularReveal(myView, cx, cy, 0, finalRadius); animator.setInterpolator(new AccelerateDecelerateInterpolator()); animator.setDuration(1000); myView.setVisibility(View.VISIBLE); animator.start(); 

Circular display does not appear. I mean, nothing happens when the code is executed.

Logcat shows it

 07-01 19:15:47.498 27556-27556/com.ledo.ledoapp I/art﹕ Rejecting re-init on previously-failed class java.lang.Class<io.codetail.animation.RevealAnimator$RevealRadius> 07-01 19:15:47.498 27556-27556/com.ledo.ledoapp I/art﹕ Rejecting re-init on previously-failed class java.lang.Class<io.codetail.animation.RevealAnimator$RevealRadius> 07-01 19:15:47.498 27556-27556/com.ledo.ledoapp I/art﹕ Rejecting re-init on previously-failed class java.lang.Class<io.codetail.animation.RevealAnimator$RevealRadius> 07-01 19:15:47.501 27556-27556/com.ledo.ledoapp I/art﹕ Rejecting re-init on previously-failed class java.lang.Class<io.codetail.animation.ViewAnimationUtils$SimpleAnimationListener> 07-01 19:15:47.501 27556-27556/com.ledo.ledoapp I/art﹕ Rejecting re-init on previously-failed class java.lang.Class<io.codetail.animation.ViewAnimationUtils$SimpleAnimationListener> 07-01 19:15:47.502 27556-27556/com.ledo.ledoapp I/art﹕ Rejecting re-init on previously-failed class java.lang.Class<io.codetail.animation.RevealAnimator$RevealFinishedGingerbread> 07-01 19:15:47.502 27556-27556/com.ledo.ledoapp I/art﹕ Rejecting re-init on previously-failed class java.lang.Class<io.codetail.animation.RevealAnimator$RevealFinishedGingerbread> 07-01 19:15:47.502 27556-27556/com.ledo.ledoapp I/art﹕ Rejecting re-init on previously-failed class java.lang.Class<io.codetail.animation.RevealAnimator$RevealFinishedIceCreamSandwich> 07-01 19:15:47.503 27556-27556/com.ledo.ledoapp I/art﹕ Rejecting re-init on previously-failed class java.lang.Class<io.codetail.animation.RevealAnimator$RevealFinishedIceCreamSandwich> 07-01 19:15:47.503 27556-27556/com.ledo.ledoapp I/art﹕ Rejecting re-init on previously-failed class java.lang.Class<io.codetail.animation.RevealAnimator$RevealFinishedJellyBeanMr2> 07-01 19:15:47.503 27556-27556/com.ledo.ledoapp I/art﹕ Rejecting re-init on previously-failed class java.lang.Class<io.codetail.animation.RevealAnimator$RevealFinishedJellyBeanMr2> 

However, the circular display works if the view is set to visible in XML files, but the problem is that I set the " circBack " view to visible in XML, it appears from when the application starts, which is usual.

Any solution to this problem?

+5
source share
2 answers

Well, that could be a Gradle dependency problem, since it worked when I added the library this way,

Wrong way

 dependencies { compile ('com.github.ozodrukh:CircularReveal: 2.0.1@aar ') { transitive = true; } } 

The right way

 dependencies { compile 'com.github.ozodrukh:CircularReveal:2.0.1' } 

I'm sorry for the late reply. Hope this helps someone in need.

+2
source

Looks like you are initializing this animation on the "Gone" screen?

Try to get visibility visibility and make sure you run it inside

 if (mView.getVisibility() == View.VISIBLE) { .. .. anim.start(); } 

code block.

+2
source

All Articles