bowyer-app / FabTransitionLayout

Deprecated
Other
464 stars 69 forks source link

FAB view is blinking on animation when the animateLayoutChanges is true #14

Open e16din opened 8 years ago

e16din commented 8 years ago

When I call expandFab/slideIn/slideOut functions, FAB view is blinking (android 5.0.2)

e16din commented 8 years ago

Bug with blinking appears when the animateLayoutChanges is true

for example:

<android.support.design.widget.CoordinatorLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:animateLayoutChanges="true"
        android:fitsSystemWindows="true"
        android:theme="@style/AppTheme.AppBarOverlay">

<android.support.design.widget.FloatingActionButton
            android:id="@+id/vAddComment"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom|right"
            android:layout_margin="16dp"
            android:src="@drawable/icn_add_comment"
            android:visibility="gone"
            app:backgroundTint="@color/btnBlue"
            app:theme="@style/Base.Widget.AppCompat.ImageButton"
            tools:visibility="visible"/>

    <com.bowyer.app.fabtransitionlayout.FooterLayout
            android:id="@+id/vFooterLayout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom"
            app:ft_color="@color/transparent">

        <include layout="@layout/view_message_field"/>

    </com.bowyer.app.fabtransitionlayout.FooterLayout>

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

Blink caused setVisibility animation when the fitsSystemWindows is true.

I refactored the project and added option ft_expand_with_alpha_anim to fix this issue.

Set ft_expand_with_alpha_anim to true to smooth animation if you need.

https://github.com/e16din/FabTransitionLayout