GithubHelp home page GithubHelp logo

arifin123 / rubber-loader Goto Github PK

View Code? Open in Web Editor NEW

This project forked from greenfrvr/rubber-loader

0.0 2.0 0.0 812 KB

Android indeterminate loader widget with rubber shape and color transitions.

License: Apache License 2.0

Mathematica 57.45% Java 42.55%

rubber-loader's Introduction

RubberLoaderView

Version 1.1.2 available!

Join the chat at https://gitter.im/greenfrvr/rubber-loader

Android Arsenal Android Gems

Android indeterminate loader widget with rubber shape and color animations. Inspired by Dribbble

Click picture below to watch it in action.

Demo app

Demo

Downlaod latest demo app from Play Market:

Get it on Google Play

Gradle Dependency

Download

Easily reference the library in your Android projects using this dependency in your module's build.gradle file:

dependencies {
    compile 'com.github.greenfrvr:rubber-loader:1.1.2@aar'
}

Library available on both jCenter and Maven Central, but in case of any issues (library can't be resolved) use Bintray repo.

Add repository to your app's build.gradle file:

repositories {
    maven {
        url 'https://dl.bintray.com/greenfrvr/maven/'
    }
}

This will reference Bintray's Maven repository that contains hashtags widget directly, rather than going through jCenter first.

Customizing

All attributes can be defined in layout .xml file or programmatically. Below is a list of available attributes.

Loader modes

Different loader modes has different animation behaviour. Default mode is normal.

	<attr name="loaderMode" format="enum">
        <enum name="normal" value="0"/>
        <enum name="equal" value="1"/>
        <enum name="centered" value="2"/>
    </attr>
Size

Currently 6 pre-defined sizes are available. Loader with ripple need more space.

Value Sizes Sizes with ripples
EXTRA_TINY 27dp * 12dp 36dp * 36dp
TINY 54dp * 24dp 72dp * 72dp
SMALL (default) 81dp * 36dp 108dp * 108dp
NORMAL 108dp * 48dp 144dp * 144dp
MEDIUM 135dp * 60dp 180dp * 180dp
LARGE 162dp * 72dp 216dp * 216dp
    <attr name="loaderSize" format="enum">
        <enum name="extra_tiny" value="0"/>
        <enum name="tiny" value="1"/>
        <enum name="small" value="2"/>
        <enum name="normal" value="3"/>
        <enum name="medium" value="4"/>
        <enum name="large" value="5"/>
    </attr>
Color

Define 2 colors which will form smooth color transition.

    <attr name="loaderPrimeColor" format="color|reference"/>
    <attr name="loaderExtraColor" format="color|reference"/>
    <attr name="loaderRippleColor" format="color|reference"/>

If you set only loaderPrimeColor, its value will be set to loaderExtraColor, so loader will be filled with solid prime color.

Ripples

Select loaderRippleMode to add ripple animations effect. Default mode is none. Loaders with ripple will have bigger sizes than without them.

	<attr name="loaderRippleMode" format="enum">
        <enum name="none" value="0"/>
        <enum name="normal" value="1"/>
        <enum name="reverse" value="2"/>
        <enum name="cycle" value="3"/>
    </attr>

Usage

There are 2 methods which starts RubberLoaderView animation: RubberLoaderView.startLoading() and RubberLoaderView.startLoading(long delay). To stop RubberLoader animation call RubberLoaderView.stopLoading().

Also you can set different interpolation functions by calling RubberLoaderView.setInterpolator(TimeInterpolator interpolator). It's highly recommended to use following interpolators: PulseInterpolator, PulseInverseInterpolator and LinearInterpolator.

##License

 Copyright 2015 greenfrvr

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.

rubber-loader's People

Contributors

greenfrvr avatar gitter-badger avatar

Watchers

James Cloos avatar Arifin 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.