2

I am using Circular Reveal Library (ttps://github.com/ozodrukh/CircularReveal) to reveal view in an activity containing web view, this animation works without any problem but it is drawing below the web view. The WebView does not revealed with its parent view, and when I add some animations to WebView then this cancels the circular reveal animation.

<?xml version="1.0" encoding="utf-8"?>
<io.codetail.widget.RevealFrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:id="@+id/myLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <android.support.v7.widget.CardView
            android:id="@+id/myCard"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:cardUseCompatPadding="true"
            app:contentPadding="5dp">

            <WebView
                android:id="@+id/myWeb"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />

        </android.support.v7.widget.CardView>

    </LinearLayout>

</io.codetail.widget.RevealFrameLayout>



<?xml version="1.0" encoding="utf-8"?>
<io.codetail.widget.RevealFrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:id="@+id/myLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <android.support.v7.widget.CardView
            android:id="@+id/myCard"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:cardUseCompatPadding="true"
            app:contentPadding="5dp">

            <WebView
                android:id="@+id/myWeb"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />

        </android.support.v7.widget.CardView>

    </LinearLayout>

</io.codetail.widget.RevealFrameLayout>
Darpan Kulkarni
  • 1,362
  • 1
  • 17
  • 36

1 Answers1

0

A possible workaround is using an AnimatorListener that toggles the visibility of the WebView:

WebView webView = ...

Animator circularReveal = ViewAnimationUtils.createCircularReveal( ... )
circularReveal.addListener(new Animator.AnimatorListener() {

    @Override
    public void onAnimationStart(Animator animator) {
        webView.setVisibility(View.INVISIBLE)
    }

    @Override
    public void onAnimationEnd(Animator animator) {
        webView.setVisibility(View.VISIBLE)
    }
}
Mehlyfication
  • 498
  • 5
  • 9