All Projects → skydoves → Androidveil

skydoves / Androidveil

Licence: apache-2.0
🎭 An easy, flexible way to implement veil skeletons and shimmering effect for Android.

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Androidveil

CeilingLayout
CeilingLayout用来控制子View的吸顶联滑,理论上支持实现了NestedScrollingChild的联滑控件,如NestedScrollView、RecyclerView、SmartRefreshLayout等;只需要在xml里配置需要吸顶子View的位置索引就能自动实现吸顶联滑效果。
Stars: ✭ 26 (-96.72%)
Mutual labels:  recyclerview, android-ui
Codeview Android
Display code with syntax highlighting ✨ in native way.
Stars: ✭ 748 (-5.56%)
Mutual labels:  recyclerview, android-ui
RecyclerELE
Android Library for easy addition of Empty, Loading and Error views in a RecyclerView
Stars: ✭ 27 (-96.59%)
Mutual labels:  recyclerview, android-ui
movie-booking
An example for booking movie seat, combined of Android Data Binding, State Design Pattern and Multibinding + Autofactory. iOS version is: https://github.com/lizhiquan/MovieBooking
Stars: ✭ 80 (-89.9%)
Mutual labels:  recyclerview, android-ui
Scrollingpagerindicator
Pager indicator inspired by Instagram. Lightweight and easy to set up.
Stars: ✭ 419 (-47.1%)
Mutual labels:  recyclerview, android-ui
recycler-adapter
RecyclerView-driven declarative UIs
Stars: ✭ 124 (-84.34%)
Mutual labels:  recyclerview, android-ui
Byrecyclerview
🔥 RecyclerView 下拉刷新、加载更多、item点击/长按、头布局/尾布局/状态布局、万能分割线、Skeleton骨架图、极简adapter(RV/LV)等
Stars: ✭ 290 (-63.38%)
Mutual labels:  skeleton, recyclerview
Notzz App
📝 A Simple Note-Taking App built to demonstrate the use of Modern Android development tools - (Kotlin, Coroutines, State Flow, Hilt-Dependency Injection, Jetpack DataStore, Architecture Components, MVVM, Room, Material Design Components).
Stars: ✭ 158 (-80.05%)
Mutual labels:  recyclerview, android-ui
Recyclerstickyheaderview
Sticky header view or suspending view for RecyclerView.
Stars: ✭ 347 (-56.19%)
Mutual labels:  recyclerview, android-ui
Stacklayoutmanager
customized layoutmanager,let item pile up like stackview/类似最美有物卡片堆叠效果
Stars: ✭ 343 (-56.69%)
Mutual labels:  recyclerview, android-ui
recyclerfragment
An Android Fragment that displays a set of items in a RecyclerView.
Stars: ✭ 16 (-97.98%)
Mutual labels:  recyclerview, android-ui
Zoomrecylerlayout
🎢 Zoom Recycler Layout Manager For Android Kotlin
Stars: ✭ 618 (-21.97%)
Mutual labels:  recyclerview, android-ui
Skeletonlayout
Skeleton view pattern for Android
Stars: ✭ 186 (-76.52%)
Mutual labels:  skeleton, recyclerview
android-tableview-kotlin
Android's missing TableView component.
Stars: ✭ 40 (-94.95%)
Mutual labels:  recyclerview, android-ui
Pageindicator
An Instagram like page indicator compatible with RecyclerView and ViewPager.
Stars: ✭ 236 (-70.2%)
Mutual labels:  recyclerview, android-ui
Tableview
TableView is a powerful Android library for displaying complex data structures and rendering tabular data composed of rows, columns and cells.
Stars: ✭ 2,928 (+269.7%)
Mutual labels:  recyclerview, android-ui
Easyadapter
Recyclerview adapter library- Create adapter in just 3 lines of code
Stars: ✭ 122 (-84.6%)
Mutual labels:  recyclerview, android-ui
Carouselrecyclerview
Carousel Recyclerview let's you create carousel layout with the power of recyclerview by creating custom layout manager.
Stars: ✭ 107 (-86.49%)
Mutual labels:  recyclerview, android-ui
Fastadapter
The bullet proof, fast and easy to use adapter library, which minimizes developing time to a fraction...
Stars: ✭ 3,512 (+343.43%)
Mutual labels:  recyclerview, android-ui
Androidribbon
🎀 The simple way to implement a beautiful ribbon with the shimmering on Android.
Stars: ✭ 502 (-36.62%)
Mutual labels:  recyclerview, android-ui

AndroidVeil

An easy, flexible way to implement veil skeletons and shimmering effect for Android.


License API Build Status Android Weekly Medium Android Weekly


Download

Download Maven Central Jitpack

Gradle

Add below codes to your root build.gradle file (not your module build.gradle file).

allprojects {
    repositories {
        mavenCentral()
    }
}

And add a dependency code to your module's build.gradle file.

dependencies {
    implementation "com.github.skydoves:androidveil:1.1.1"
}

Usage

First, add following XML namespace inside your XML layout file.

xmlns:app="http://schemas.android.com/apk/res-auto"

VeilLayout in layout

<com.skydoves.androidveil.VeilLayout
      android:id="@+id/veilLayout"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      app:veilLayout_veiled="true" // shows veils initially
      app:veilLayout_shimmerEnable="true" // sets shimmer enable
      app:veilLayout_baseColor="@android:color/holo_green_dark" // sets shimmer base color
      app:veilLayout_highlightColor="@android:color/holo_green_light" // sets shimmer highlight color
      app:veilLayout_baseAlpha="0.6" // sets shimmer base alpha value
      app:veilLayout_highlightAlpha="1.0" // sets shimmer highlight alpha value
      app:veilLayout_dropOff="0.5"// sets how quickly the shimmer`s gradient drops-off
      app:veilLayout_radius="6dp" // sets a corner radius of the whole veiled items >

      <TextView
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:text="And now here is my secret, a very simple secret"
         android:textColor="@android:color/white"
         android:textSize="22sp"/>

      <!-- Skip -->    

</com.skydoves.androidveil.VeilLayout>

Veil and UnVeil

We can implement veiled skeletons using below methods.

veilLayout.veil()
veilLayout.unVeil()

Implement veils using layout resource

We can implement veiled skeletons using the layout resource.

veilLayout.layout = R.layout.layout_item_test

VeilRecyclerFrameView

VeilRecyclerFrameView implements veiled skeletons for RecyclerView with the shimmer effect.

VeilRecyclerFrameView in layout

<com.skydoves.androidveil.VeilRecyclerFrameView
        android:id="@+id/veilRecyclerView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:veilFrame_layout="@layout/item_profile" // sets to make veiling target layout
        app:veilFrame_veiled="true" // shows veils initially
        app:veilFrame_shimmerEnable="true" // sets shimmer enable
        app:veilFrame_baseColor="@android:color/holo_green_dark" // sets shimmer base color
        app:veilFrame_highlightColor="@android:color/holo_green_light" // sets shimmer highlight color
        app:veilFrame_baseAlpha="0.6" // sets shimmer base alpha value
        app:veilFrame_highlightAlpha="1.0" // sets shimmer highlight alpha value
        app:veilFrame_radius="8dp" // sets a corner radius of the whole veiled items />

And we should attach our own adapter and LayoutManager.

veilRecyclerView.setAdapter(adapter) // sets your own adapter
veilRecyclerView.setLayoutManager(LinearLayoutManager(this)) // sets LayoutManager
veilRecyclerView.addVeiledItems(15) // add veiled 15 items

Veil and UnVeil

We can implement veiled skeletons using below methods.

veilRecyclerView.veil() // shows veil skeletons
veilRecyclerView.unVeil() // disappear veils and shows your own recyclerView

RecyclerView

We can access our Recyclerview and veiledRecyclerView using the below methods.

veilRecyclerView.getRecyclerView() // veilRecyclerView.getRecyclerView().setHasFixedSize(true)
veilRecyclerView.getVeiledRecyclerView()

Shimmer

This library using shimmer-android by Facebook.
Here are the detail shimmer-instruction about shimmer or you can reference below examples.

create using Builder

This is how to create Shimmer's instance using Shimmer.Builder class.

val shimmer = Shimmer.ColorHighlightBuilder()
      .setBaseColor(ContextCompat.getColor(context, R.color.shimmerBase0))
      .setHighlightColor(ContextCompat.getColor(context, R.color.shimmerHighlight0))
      .setBaseAlpha(1f)
      .setHighlightAlpha(1f)
      .build()

veilLayout.shimmer = shimmer // sets shimmer to VeilLayout
veilRecyclerView.shimmer = shimmer // sets shimmer to VeilRecyclerView

create using kotlin dsl

This is how to create Shimmer's instance using kotlin dsl.

val shimmer_alpha = alphaShimmer {
      setBaseAlpha(1.0f)
      setHighlightAlpha(0.5f)
}
val shimmer_color = colorShimmer {
      setBaseAlpha(1.0f)
      setHighlightAlpha(0.5f)
      setBaseColor(ContextCompat.getColor(context, R.color.colorPrimary))
      setHighlightColor(ContextCompat.getColor(context, R.color.colorPrimaryDark))
}

AndroidVeil Attributes

Attributes Type Default Description
veiled Boolean false shows veils initially.
layout Int -1 implement veils using the layout resource.
radius dimension 8dp sets corner radius to the veil items.
drawable Drawable null sets background drawable to the veil items.
shimmerEnable Boolean true sets shimmer enable.
baseColor ColorInt Color.LTGRAY sets shimmer base color.
highlightColor ColorInt Color.DKGRAY sets shimmer highlight color.
baseAlpha Float 1.0f sets shimmer base alpha value.
highlightAlpha Float 1.0f sets shimmer highlight alpha value.
dropOff Float 0.5f sets how quickly the shimmer's gradient drops-off.
defaultChildVisible Boolean false sets the child view's visibility when called veil and unveil.

Find this library useful? ❤️

Support it by joining stargazers for this repository. ⭐️

Sponsor ☕️

If you feel like to sponsor me a coffee for my efforts, I would greatly appreciate it!

Buy Me A Coffee

License

Copyright 2018 skydoves

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