Skip to content
Skeleton view pattern for Android
Kotlin Java
Branch: master
Clone or download
Latest commit 33f1864 Mar 20, 2019


Download API

Make your app feel faster

Users are time-sensitive and may skip an app due to long loading times and missing visual feedback. Instagram, Facebook, Google and other services tackled this problem with the so-called Skeleton View. This view is being displayed during the process of fetching or requesting data asynchronously which leads to a perceivedly more responsive app.

This library implements the Skeleton View pattern and provides an easy way for other developers to enable it in their apps.


Get it on Google Play


The SkeletonLayout mimics the design of established implementations per default, but you are free to get creative. Create your own skeleton view with custom shapes, colors and shimmers.


  • Make your app feel faster: Immediate visual feedback long before your data has been fetched or requested
  • Support any View: Apply to any type of View or ViewGroup
  • RecyclerView on speed: Convenience adapter for the RecyclerView, since it is the main use case
  • Customization: Adjust shimmer, color and shape of the skeleton to set you apart from other apps
  • Minimum effort: A fistful lines of code to use the SkeletonLayout
  • Minimum footprint: org.jetbrains.kotlin:kotlin-stdlib-jdk7 and androidx.recyclerview:recyclerview are the only dependencies

Getting Started

dependencies {
    implementation 'com.faltenreich:skeletonlayout:<version>'
    <!-- Views to mask -->
public class MainActivity extends AppCompatActivity {
    private Skeleton skeleton;
    public void onCreate(@Nullable Bundle savedInstanceState) {
        // Either use an existing Skeletonlayout
        skeleton = findViewById(;
        // or create a new SkeletonLayout from a given View
        skeleton = SkeletonLayoutUtils.createSkeleton(view);
        // or apply a new SkeletonLayout to a RecyclerView (showing 5 items)
        skeleton = SkeletonLayoutUtils.applySkeleton(recyclerView, R.layout.list_item, 5);
    // Example callback that hides skeleton
    private void onDataLoaded() {
class MainActivity : AppCompatActivity() {

    private lateinit var skeleton: Skeleton
    override fun onCreate(savedInstanceState: Bundle?) {
        // Either use an existing Skeletonlayout
        skeleton = findViewById(
        // or create a new SkeletonLayout from a given View
        skeleton = view.createSkeleton()
        // or apply a new SkeletonLayout to a RecyclerView (showing 5 items)
        skeleton = recyclerView.applySkeleton(R.layout.list_item, 5)
    // Example callback that hides skeleton
    private fun onDataLoaded() {


Property Type Description
maskColor color Color of the mask that fills the original view bounds (defaults to #E0E0E0)
maskCornerRadius dimension The x- and y-radius of the oval used to round the mask corners (defaults to 25)
showShimmer boolean Animate left-to-right shimmer, if set to true (defaults to true)
shimmerColor color Color of the animated shimmer (defaults to #d5d5d5)
shimmerDurationInMillis integer Duration in milliseconds for one shimmer animation interval (defaults to 2000)
itemCount integer Item count for Skeleton adapter (RecyclerView only, defaults to 3)


When and how is the skeleton created? The skeleton gets created after the original view's onLayout(), since we rely on it to be fully rendered in order to mask its bounds.

How does the masking work? The mask is drawn onto a single Bitmap by iterating once through the given Views and their bounds.

May properties of the SkeletonLayout be changed at runtime? Yes. Any change to the skeleton leads to a redraw, since the whole content of the SkeletonLayout gets drawn onto a single bitmap.

Will the shimmer eat my users' battery? The shimmer is a shader (LinearGradient) whose local matrix is updated according to the framerate of the target device, so no redrawing is required and processing time is kept to an absolute minimum. Additionally the shimmer gets inactive onWindowFocusChanged() and onDetachedFromWindow().


Copyright 2019 Philipp Fahlteich

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

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.

You can’t perform that action at this time.