Questions tagged [shimmer]

Shimmer for Android 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, and was originally developed for Facebook Home.

Shimmer for Android is implemented as a layout, which means that you can simply nest any view inside a ShimmerFrameLayout tag, and call to start the animation from your code. That's all that is required. The layout will use the values you specify either on the tag (using custom attributes) or programmatically in your code, and generate an animation on the fly.

The following snippet shows how you can use ShimmerFrameLayout

<com.facebook.shimmer.ShimmerFrameLayout
     android:id="@+id/shimmer_view_container"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
>
     ...(your complex view here)...
</com.facebook.shimmer.ShimmerFrameLayout>

And thats it! If you specify auto-start to be false, then you can start the animation in code:

ShimmerFrameLayout container =
  (ShimmerFrameLayout) findViewById(R.id.shimmer_view_container);
container.startShimmer(); // If auto-start is set to false

Attributes

You can control the look and pace of the effect using a number of custom attributes on the ShimmerFrameLayout tag. Alternatively, you can set these values on the layout object itself. For a comprehensive list, check out the API reference

Clip to Children - Whether to clip the shimmering effect to the children, or to opaquely draw the shimmer on top of the children. Use this if your overall layout contains transparency.

Colored - Whether you want the shimmer to affect just the alpha or draw colors on-top of the children.

Base Color - If colored is specified, the base color of the content.

Highlight Color - If colored is specified, the shimmer's highlight color.

Base Alpha - If colored is not specified, the alpha used to render the base view i.e. the unhighlighted view over which the highlight is drawn.

Highlight Alpha - If colored is not specified, the alpha of the shimmer highlight.

Auto Start - Whether to automatically start the animation when the view is shown, or not.

Duration - Time it takes for the highlight to move from one end of the layout to the other.

Repeat Count - Number of times of the current animation will repeat.

Repeat Delay - Delay after which the current animation will repeat.

Repeat Mode - What the animation should do after reaching the end, either restart from the beginning or reverse back towards it.

Direction - The travel direction of the shimmer highlight: left to right, top to bottom, right to left or bottom to top.

Dropoff - Controls the size of the fading edge of the highlight.

Intensity - Controls the brightness of the highlight at the center.

Shape - Shape of the highlight mask, either with a linear or a circular gradient.

Tilt - Angle at which the highlight is tilted, measured in degrees.

Fixed Width, Height - Fixed sized highlight mask, if set, overrides the relative size value.

Width, Height ratio - Size of the highlight mask, relative to the layout it is applied to.

Download

To include Shimmer in your android project, add the following dependency:

// Gradle dependency on Shimmer for Android
dependencies {
  implementation 'com.facebook.shimmer:shimmer:x.x.x'
}
//Replace xxx with version


<!-- Maven dependency on Shimmer for Android -->
<dependency>
  <groupId>com.facebook.shimmer</groupId>
  <artifactId>shimmer</artifactId>
  <version>x.x.x</version>
</dependency>
//Replace xxx with version

Note that you cannot use the custom attributes on the tag if you use the Jar file. You can instead download the AAR file and reference that locally in your project.

34 questions
1
vote
1 answer

How to implement MUI skeleton on API response data?

I am using material-ui skeleton (Shimmer effect) on data which is coming from API. { accountData.usersAccountData.map((userData, index) => ( // ...UI code ) ) } Output is given below : As you can see, I received 3 objects from API. So…
Abhishek kamal
  • 432
  • 1
  • 5
  • 13
1
vote
1 answer

How to change the Color of SwiftUI redacted shimmer effect

I added a shimmer effect for my home screen like the code below. VStack{ TopView() HomeView() } .redacted(.placeholder) I got the output like the below image. https://ibb.co/xFXQ2sk the shimmer view showing color for the colored view but the…
Maharajan S
  • 93
  • 10
1
vote
1 answer

CSS keyframe shimmer effect working in Chrome but not Firefox?

I have the following HTML:
CSS: .shimmer img{ color: grey; display:inline-block; …
Adehmar
  • 11
  • 3
1
vote
1 answer
1
vote
1 answer

How to add coulmn of 3 in shimmerframelayout

Hello im trying to add shimmereffect on a imageview in a coulmn of 3 but the issue is the shimmer effetc shows only in one coulmn and not in 3 and also there is another issue where in one my physical device the shimmer effect looks stuck even the…
Vasant Raval
  • 257
  • 1
  • 12
  • 31
1
vote
0 answers

KeyError: Shimmer3 EXG

I try to connect my Shimmer3 (http://www.shimmersensing.com/products/shimmer3-imu-sensor) with my Linux Mint Computer and try to stream the data with bluetooth. For that i use the git hub Code: https://github.com/seemoo-lab/pyshimmer. I did…
1
vote
2 answers

How to Apply Shimmer Effect android swipeProgress?

How to connect my rssfragment to Apply Shimmer Effect swipeProgress. I need to show you a shimmer layout when rssfragment is in progress. I tried and lyt_shimmer did not show me swipeRefreshLayout.setOnRefreshListener(new…
atozcodes
  • 1
  • 2
  • 13
1
vote
2 answers

How to get period when data is loaded to stop shimmer?

I am using Volley for requests and want to add shimmer while data is loading. I can perform it with Handler but I don't know when data will come and can't set exact time. Here is code in my Fragment. I want to set value false to variable isShimmer…
Akram Baratov
  • 143
  • 1
  • 3
  • 13
1
vote
1 answer

Xamarin.Forms.Skeleton - What make animation and BackgroundColor of the plugin doesn't appears?

I have implemented the Skeleton plugin in my xamarin.form app. It's working fine in my listview page. Then I try it in my listView item detail, the animation and skeleton backgroundColor doesn't work. The function working fine and no error in my…
Machtal
  • 27
  • 1
  • 8
0
votes
1 answer

shimmer effect while loading images from firebase

I have a flutter app that display some data stored in Firebase realtime database. I am using getx for state management. the text data loads fast but the images take more time. I want to display a shimmer effect on the images only while they are…
Roj ALi
  • 37
  • 6
0
votes
0 answers

KaustubhPatange's ImageLoaderView is always dark grey. How to change it background and shimmer color?

I've tried to use KaustubhPatange's ImageLoaderView but faced with a impossibility to change colors. Yes, there aren't any instructions and explanations. I've set various overlay parameters but there was not any changes.
0
votes
2 answers

How to show empty state in listview while using shimmer in flutter

I have a list view and its fetching from api service. I need to show a shimmer till api response come and show listview if there is data form api and show an empty state message if no data. Please check my below code that what i have implemented. …
Vivek P Pillai
  • 243
  • 4
  • 14
0
votes
0 answers

Could not GET 'https://repo.spring.io/plugins-release/com/facebook/shimmer/shimmer/null/shimmer-null.pom'. Received status code 401 from server:

I am facing below error while running the expresso test. Could not GET 'https://repo.spring.io/plugins-release/com/facebook/shimmer/shimmer/null/shimmer-null.pom'. Received status code 401 from server: Unauthorized Disable Gradle 'offline mode' and…
0
votes
2 answers

stop shimmer is not working Facebook shimmer

For old version I am able to stop the shimmer, new version am not able to stop the shimmer, Old Version Details implementation 'com.facebook.shimmer:shimmer:0.1.0@aar'//using aar implementation 'com.facebook.shimmer:shimmer:0.1.0' //using…
pavani
  • 41
  • 3
0
votes
1 answer

How to animate gradient colors in Android like Facebook Shimmer effect

I am trying to add a loading placeholder (just a linear layout) until I get a response from the API. I want to add a Shimmer like effect to the placeholder without using an external library. I tried using a GradientDrawable with a ValueAnimator from…