No description, website, or topics provided.
Java
Latest commit 1b770db Jan 4, 2017 @sharish committed on GitHub Update README.md
Permalink
Failed to load latest commit information.
app First Commit Jan 3, 2017
gradle/wrapper First Commit Jan 3, 2017
screenshots First Commit Jan 3, 2017
shimmer First Commit Jan 3, 2017
.gitignore First Commit Jan 3, 2017
FACEBOOK_LICENSE.md First Commit Jan 3, 2017
LICENSE.md First Commit Jan 3, 2017
README.md Update README.md Jan 4, 2017
build.gradle First Commit Jan 3, 2017
gradlew First Commit Jan 3, 2017
gradlew.bat First Commit Jan 3, 2017
settings.gradle First Commit Jan 3, 2017

README.md

ShimmerRecyclerView

Intro

A custom recycler view with shimmer views to indicate that views are loading. The recycler view has a built-in adapter to control the shimmer appearance and provide two methods -

  • showShimmerAdapter() - set up a demo adapter a predefined number of child demo views.
  • hideShimmerAdapter() - restores your adapter to show the actual child elements.

Demo Screen

List Demo Grid Demo

Attributes and Methods

Following are the attributes and methods to initialise the demo views.

XML Attributes Java Methods Explanation
app:demo_child_count setDemoChildCount(int) Integer value that sets the number of demo views should be present in shimmer adapter
app:demo_layout setDemoLayoutReference(int) Layout reference to your demo view. Define your my_demo_view.xml and refer the layout reference here.
app:demo_layout_manager_type setDemoLayoutManager(LayoutManagerType) Layout manager of demo view. Can be one among linear_veritical or linear_horizontal or grid.

Usage

Define your xml as:

<com.cooltechworks.views.shimmer.ShimmerRecyclerView
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/shimmer_recycler_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:demo_child_count="10"
        app:demo_grid_child_count="2"
        app:demo_layout="@layout/layout_demo_grid"
        app:demo_layout_manager_type="grid"
        />

where @layout/layout_demo_grid refers to your sample layout that should be shown during loading spinner. Now on your activity onCreate, initialize the shimmer as below:

ShimmerRecyclerView shimmerRecycler = (ShimmerRecyclerView) findViewById(R.id.shimmer_recycler_view);
shimmerRecycler.showShimmerAdapter();

Adding to your project

  • Add the following configuration in your build.gradle file.
repositories {
    jcenter()
    maven { url "https://jitpack.io" }
}

dependencies {
    compile 'com.github.sharish:ShimmerRecyclerView:v1.0'
}

Developed By

Acknowledgements

License

The repo is released under following licenses

Apache License for ShimmerRecycler
BSD License for Facebook's Shimmer-Android