Giter VIP home page Giter VIP logo

shimmerlayout's Introduction

Android Arsenal Maven Central Android Weekly API Build Status

ShimmerLayout

ShimmerLayout can be used to add shimmer effect (like the one used at Facebook or at LinkedIn) to your Android application. Beside memory efficiency even animating a big layout, you can customize the behaviour and look of the animation. Check out the wiki for attributes!

Performance

When it comes to performance, ShimmerLayout is the best option available. Not only can you achieve high frame rate even in RecyclerViews, but it also animates views with insignificant memory footprint.

I conducted a benchmark to compare memory usages between different shimmer implementations. The test device I used is a HTC M8 phone. For the animations the sample application was used.

Library used Android Profiler result
Facebook shimmer library 0.1.0 ShimmerLayout
ShimmerLayout 1.2.0 ShimmerLayout
ShimmerLayout 2.0.0 ShimmerLayout

Download and usage

Get the latest artifact via gradle

implementation 'io.supercharge:shimmerlayout:2.1.0'

Create the layout on which you want to apply the effect and add as a child of a ShimmerLayout

<io.supercharge.shimmerlayout.ShimmerLayout
        android:id="@+id/shimmer_text"
        android:layout_width="wrap_content"
        android:layout_height="40dp"
        android:layout_gravity="center_horizontal"
        android:layout_marginTop="50dp"
        android:paddingLeft="30dp"
        android:paddingRight="30dp"
        app:shimmer_animation_duration="1200">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:gravity="center"
            android:text="ShimmerLayout"
            android:textColor="@color/shimmer_background_color"
            android:textSize="26sp"/>
    </io.supercharge.shimmerlayout.ShimmerLayout>

Last, but not least you have to start it from your Java code

ShimmerLayout shimmerText = (ShimmerLayout) findViewById(R.id.shimmer_text);
shimmerText.startShimmerAnimation();

Further reading

License

ShimmerLayout is opensource, contribution and feedback are welcome!

Apache Version 2.0

Copyright 2017 Supercharge

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.

Author

veghtomi

Supercharge

shimmerlayout's People

Contributors

veghtomi avatar szugyi avatar wondercsabo avatar tomkoptel avatar richardradics avatar danielkeresztes avatar

Watchers

James Cloos avatar Saad Bilal avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.