Skip to content

Instantly share code, notes, and snippets.

@RanjitPati
Last active January 18, 2019 11:19
Show Gist options
  • Save RanjitPati/b5dbfea7b29b0f0d3533fd3030a7bb59 to your computer and use it in GitHub Desktop.
Save RanjitPati/b5dbfea7b29b0f0d3533fd3030a7bb59 to your computer and use it in GitHub Desktop.
public class MainActivity extends AppCompactActivity{
private ShimmerFrameLayout mShimmerViewContainer;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.screen_businesslist);
//initialize the ShimmerLayout
mShimmerViewContainer = findViewById(R.id.shimmer_view_container);
//now start the Shimmer effect
mShimmerViewContainer.startShimmer();
}
public void stopShimmerWhenDataFatched(){
//suppose we have finished our server stuffs
//and now the data is ready to populate
//populate data
..............................
................................
//now stop the shimmer and also hide the shimmer layout
mShimmerViewContainer.stopShimmer();
mShimmerViewContainer.setVisibility(View.GONE);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment