Jaouan / Revealator

An helper to circle reveal/unreveal a view easily, with translations and childs animations.
Apache License 2.0
448 stars 53 forks source link

Reveal animation starts too early #4

Closed denzerd closed 7 years ago

denzerd commented 7 years ago

Hi,

it's a very nice lib, very useful. But I realized that the reveal animation starts to early.

I try to translate a fab in a curve to reveal a LinearLayout. I have the following in XML `<android.support.design.widget.CoordinatorLayout android:id="@+id/main_content" 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" xmlns:tools="http://schemas.android.com/tools" tools:context="com.zombiebytestudios.learningapp.MainActivity">

    <include layout="@layout/toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/includedtoolbar"/>

    <ListView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
    <io.codetail.widget.RevealFrameLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"
        >
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="80dp"
                android:visibility="invisible"
                android:background="#FF0000"
                android:id="@+id/test">
                    <TextView
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:text="TEST"
                        android:layout_gravity="center"
                        android:gravity="center"/>
            </LinearLayout>
    </io.codetail.widget.RevealFrameLayout>

    <android.support.design.widget.FloatingActionButton
        android:id="@+id/addButton"
        android:src="@android:drawable/ic_menu_add"
        app:fabSize="normal"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginRight="16dp"
        android:layout_marginEnd="16dp"
        app:layout_anchor="@id/includedtoolbar"
        app:layout_anchorGravity="bottom|right|end"/>

</android.support.design.widget.CoordinatorLayout>`

And on click of the button I do: Revealator.reveal( test ) .from( addButton ) .withCurvedTranslation() //.withCurvedTranslation(curvePoint) .withChildsAnimation() //.withDelayBetweenChildAnimation(...) //.withChildAnimationDuration(...) //.withTranslateDuration(...) //.withHideFromViewAtTranslateInterpolatedTime(...) //.withRevealDuration(...) //.withEndAction(...) .withTranslateDuration(4000) .withRevealDuration(4000) .start();

Note, that I put the translate duration to 4000 in order to see it better. But it also happens if I put it to 400. The animation to reveal the linear layout already starts on the half way of the fab. Is that on purpose? I would expect the layout to be revealed when the fab arrives at it's center.

Thanks!

Greetings

Jaouan commented 7 years ago

Hi,

The only way I reproduce your issue is by changing the animator duration scale from developer options to 0.5x. capture

Can you check this setting ?

By the way this is an issue.

I've just pushed a fix, please try to update to release 1.2.1 and tell me if it's better.

Hope it helps you !