All Projects → mike14u → Shimmer Recyclerview X

mike14u / Shimmer Recyclerview X

Licence: apache-2.0
🌀 ShimmerRecyclerViewX for AndroidX

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Shimmer Recyclerview X

Recyclerview Fastscroller
A fully customizable Fast Scroller for the RecyclerView in Android, written in Kotlin
Stars: ✭ 585 (+203.11%)
Mutual labels:  view, recyclerview
SlideTable
可以滑动 以表格形式展示数据
Stars: ✭ 14 (-92.75%)
Mutual labels:  view, recyclerview
TimelineView
A customizable and easy-to-use Timeline View library for Android. Works as a RecyclerView decorator (ItemDecoration)
Stars: ✭ 169 (-12.44%)
Mutual labels:  view, recyclerview
Imagezoom
An Android library that makes any view to be zoomable.
Stars: ✭ 118 (-38.86%)
Mutual labels:  view, recyclerview
Candyview
Implement any RecyclerView in just 1 Line. CandyView handles everything for you.
Stars: ✭ 15 (-92.23%)
Mutual labels:  view, recyclerview
Discretescrollview
A scrollable list of items that centers the current element and provides easy-to-use APIs for cool item animations.
Stars: ✭ 5,533 (+2766.84%)
Mutual labels:  view, recyclerview
recycler-adapter
RecyclerView-driven declarative UIs
Stars: ✭ 124 (-35.75%)
Mutual labels:  view, recyclerview
Windowimageview
An ImageView display in RecyclerView, looks like window.
Stars: ✭ 699 (+262.18%)
Mutual labels:  view, recyclerview
Inifiniterecyclerview
Library for implementing endless loading list easily in Android applications
Stars: ✭ 79 (-59.07%)
Mutual labels:  view, recyclerview
Snappyrecyclerview
An extension to RecyclerView which will snap to child Views to the specified anchor, START, CENTER or END.
Stars: ✭ 178 (-7.77%)
Mutual labels:  view, recyclerview
View Effects
Apply custom effects on view backgrounds
Stars: ✭ 176 (-8.81%)
Mutual labels:  view
Spannabletextview
SpannableTextView is a custom TextView which lets you customize the styling of slice of your text or statment via Spannables, but without the hassle of having to deal directly with Spannable themselves.
Stars: ✭ 177 (-8.29%)
Mutual labels:  view
Yii2 Minify View
Yii2 View component with minification css & js
Stars: ✭ 186 (-3.63%)
Mutual labels:  view
Stepviewandroid
An Android library (Step View) written in kotlin to display steps (without any max-min limits) along with the status/description using a single view. It also supports some really cool features.
Stars: ✭ 191 (-1.04%)
Mutual labels:  view
Guideview
A guideView implements using the DialogFragment
Stars: ✭ 176 (-8.81%)
Mutual labels:  view
Sherlockadapter
一个万能的封装了RecyclerView.Adapter的功能库。
Stars: ✭ 186 (-3.63%)
Mutual labels:  recyclerview
Youtubevideosample
YoutubeVideoSample
Stars: ✭ 176 (-8.81%)
Mutual labels:  view
Airbnb Android Google Map View
This is a sample Android Application which has Google Map view similar to what AirBnb Android Application. Moving Markers like Uber/Ola. Custom Google Search for places. Recycler view with Animations added.
Stars: ✭ 175 (-9.33%)
Mutual labels:  recyclerview
Transitioner
A library for dynamic view-to-view transitions
Stars: ✭ 2,049 (+961.66%)
Mutual labels:  view
Swiftconfettiview
Swift Confetti View ! Who doesn't like confetti? 🎉🎉
Stars: ✭ 193 (+0%)
Mutual labels:  view

ShimmerRecyclerViewX

A custom recycler view with shimmer views to indicate that views are loading for AndroidX. This will only work if you are using AndroidX RecyclerView as a dependency.

Android Arsenal Android Arsenal Android Arsenal

Getting Started

Make sure to have Android Studio

Gradle

repositories {
    maven { url "https://jitpack.io" }
}
implementation 'com.github.mike14u:shimmer-recyclerview-x:1.0.3'

Usage

  • 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

There are two kinds of shimmer animation which you can see here:

  1. This type of shimmer effect uses the whole ViewHolder item to animate on.
List Demo Grid Demo
  1. Here the shimmer effect only applied on for those views which background color is nontransparent.
List Demo Grid Demo

Shimmer effect types

  1. 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.

  2. 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.

Attributes and Methods

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.

XML

<com.mikelau.views.shimmer.ShimmerRecyclerViewX
        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:

ShimmerRecyclerViewX shimmerRecyclerX = findViewById(R.id.shimmer_recycler_view_x);
shimmerRecyclerX.showShimmerAdapter();

Credits

References

License

Copyright 2018 Mike Lau

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].