I have tried the demo of shimmer FrameLayout
but it goes very fast and I want to slow down the speed of this effect. How to slow down the speed of shimmer
effect and how to use the properties of this library?
About. Shimmer is an Android library that provides an easy way to add a shimmer effect to any view in your Android app. It is useful as an unobtrusive loading indicator that was originally developed for Facebook Home.
You need to use app:shimmer_duration="1500"
to set speed of animation in ShimmerFrameLayout
Try this
<com.facebook.shimmer.ShimmerFrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
app:shimmer_duration="1500">
<View
android:layout_width="100dp"
android:layout_height="8dp"
android:background="#dddddd" />
</com.facebook.shimmer.ShimmerFrameLayout>
Add app:duration="1500"
to shimmer FrameLayout
by default its duration is 1000 so to slow down i increase the duration
<com.facebook.shimmer.ShimmerFrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorAccent"
app:duration="1500"
android:id="@+id/shimmer">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#fff"
android:layout_gravity="center"
android:textSize="30dp"
android:text="Shimmer Effect"/>
</com.facebook.shimmer.ShimmerFrameLayout>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With