Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Shimmerrecyclerview | 3,458 | 3 years ago | 13 | other | Kotlin | |||||
All Base Adapter | 528 | 6 years ago | 5 | apache-2.0 | Java | |||||
Adapter terminator, including DataBinding, any ViewGroup, list(Rv, Lv ). Write Adapter, it is enough .Adapter终结者,包含DataBinding,任意ViewGroup,Rv、Lv列表。写Adapter,有它就够了 | ||||||||||
Adapterlayout | 57 | 3 years ago | 2 | apache-2.0 | Kotlin | |||||
ViewGroup backed by RecyclerView.Adapter = magic | ||||||||||
Universaladapter | 53 | 8 years ago | apache-2.0 | Java | ||||||
A single adapter implementation for any scrolling view or ViewGroup. | ||||||||||
Adapter Databinding | 11 | 3 years ago | apache-2.0 | Kotlin | ||||||
adapter-databinding | ||||||||||
Xebicon 2013__cc In Aa | 9 | 10 years ago | Java | |||||||
A demonstration of the "Custom ViewGroup" advice given during the Clean Code in Android Apps talk of XebiCon 2013. | ||||||||||
Listview | 3 | 7 years ago | Java | |||||||
a samples of ListView | ||||||||||
Android Stacklayout | 2 | 9 years ago | mit | Java | ||||||
Custom ViewGroup of which the top element can be swept away. | ||||||||||
Gsectioned Recyclerview | 2 | 4 years ago | mit | Kotlin | ||||||
Biblioteca criada de modo a facilitar a criação de um RecyclerView com seções, algo muito comum em diversas aplicações. | ||||||||||
Simplemvp_android | 2 | 5 years ago | Java | |||||||
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 -
There are two kinds of shimmer animation which you can see here:
List Demo | Grid Demo |
---|---|
![]() |
![]() |
List Demo | Grid Demo |
---|---|
![]() |
![]() |
As you can see the first demo examples show that the whole ViewHolder item is animated. To achieve the desired effect, the children of the ShimmerLayout should have a nontransparent background.
You can achieve the second kind of shimmer effect by adding only one ViewGroup child to the ShimmerLayout with a transparent background. This ViewGroup will have the other views with nontransparent backgrounds on which the effect will be seen.
You may wonder how can you add background to the root view of the ViewHolder, if you do not have direct access to the ShimmerLayout and the only child has a nontransparent background. The solution for this is to use the shimmer_demo_view_holder_item_background
attribute.
Following are the attributes and methods to initialise the demo views.
XML Attributes | Java Methods | Explanation |
---|---|---|
app:shimmer_demo_child_count |
setDemoChildCount(int) |
Integer value that sets the number of demo views should be present in shimmer adapter. |
app:shimmer_demo_layout |
setDemoLayoutReference(int) |
Layout reference to your demo view. Define your my_demo_view.xml and refer the layout reference here. |
app:shimmer_demo_layout_manager_type |
setDemoLayoutManager(LayoutManagerType) |
Layout manager of demo view. Can be one among linear_vertical or linear_horizontal or grid. |
app:shimmer_demo_shimmer_color |
- |
Color reference or value. It can be used to change the color of the shimmer line. |
app:shimmer_demo_angle |
- |
Integer value between 0 and 30 which can modify the angle of the shimmer line. The default value is zero. |
app:shimmer_demo_mask_width |
setDemoShimmerMaskWidth(float) |
Float value between 0 and 1 which can modify the width of the shimmer line. The default value is 0.5. |
app:shimmer_demo_view_holder_item_background |
- |
Color or an xml drawable for the ViewHolder background if you want to achieve the second type of shimmer effect. |
app:shimmer_demo_reverse_animation |
- |
Defines whether the animation should be reversed. If it is true, then the animation starts from the right side of the View. Default value is false. |
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:shimmer_demo_child_count="10"
app:shimmer_demo_grid_child_count="2"
app:shimmer_demo_layout="@layout/layout_demo_grid"
app:shimmer_demo_layout_manager_type="grid"
app:shimmer_demo_angle="20"
/>
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();
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
dependencies {
implementation 'com.github.sharish:ShimmerRecyclerView:v1.3'
}
The repo is released under following licenses
Apache License for ShimmerRecycler
Apache License for ShimmerLayout