facebookarchive / shimmer-android

An easy, flexible way to add a shimmering effect to any view in an Android app.
http://facebook.github.io/shimmer-android/
Other
5.32k stars 695 forks source link

When the animation ends delay until it starts again #93

Closed billyjoker closed 4 years ago

billyjoker commented 4 years ago

Hi the animation works right, but i see that when the animation ends it has a significant delay until it starts again to animate. So it seems to be freezed for a time before it starts again.

I have not figured out yet how to start quickly again, i've tried to change the animation speed but is not the point to be faster.

xiphirx commented 4 years ago

There is the repeatDelay attribute/property that controls this. Another thing to look out for is views that have a large width that extend beyond the screen's dimensions. A shimmer will always cover the entire width of a view.

billyjoker commented 4 years ago

You were right, it was related with the size that the shimmer had to cover. I did some changes and it works as expected. Thanks!

pradeep-orbi commented 2 years ago

repeat_delay attribute is not working for me. Can you please help. The issue i'm facing is, when i add 'shimmer_repeat_delay' attribute, current animation speed is being affected instead of adding delay after current animation.

Following is the code i'm using

   <com.facebook.shimmer.ShimmerFrameLayout
    android:id="@+id/shimmer"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    app:shimmer_auto_start="true"
    app:shimmer_base_alpha="1"
    app:shimmer_base_color="@android:color/holo_orange_dark"
    app:shimmer_duration="1500"
    app:shimmer_highlight_alpha="0.6"
    app:shimmer_highlight_color="@color/white"
    app:shimmer_repeat_delay="3000"
    app:shimmer_repeat_mode="restart"
    app:shimmer_shape="linear"
    app:shimmer_tilt="-45">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@android:color/holo_orange_dark"
        android:padding="16dp"
        android:text="Pradeep Kumar Reddy"
        android:textColor="@color/white" />

</com.facebook.shimmer.ShimmerFrameLayout>