Coder Social home page Coder Social logo

bkintanar / smoothprogressbar Goto Github PK

View Code? Open in Web Editor NEW

This project forked from castorflex/smoothprogressbar

0.0 1.0 0.0 214 KB

A small Android library allowing you to have a smooth and customizable horizontal indeterminate ProgressBar

License: Other

smoothprogressbar's Introduction

##Description

Small library allowing you to make a smooth indeterminate progress bar. You can either user your progress bars and set this drawable or use directly the SmoothProgressBarView.

Sample app available on the Play Store

##How does it work

I made a blog post about that.

##Integration

The lib is now on Maven Central. All you have to do is add it on your gradle build:

dependencies {
    compile 'com.github.castorflex.smoothprogressbar:library:0.3.X'
}

##Usage

  • Use directly SmoothProgressBar:
<fr.castorflex.android.smoothprogressbar.SmoothProgressBar
	xmlns:android="http://schemas.android.com/apk/res/android"
	xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:indeterminate="true"
    app:spb_sections_count="12"
    app:spb_color="#FF0000"
    app:spb_speed="2.0"
    app:spb_stroke_width="4dp"
    app:spb_stroke_separator_length="4dp"
    app:spb_reversed="false"
    app:spb_mirror_mode="false"
    />
  • Or instantiate a SmoothProgressDrawable and set it to your ProgressBar (do not forget to set the Horizontal Style)
mProgressBar.setIndeterminateDrawable(new SmoothProgressDrawable.Builder(context)
    .color(0xff0000)
    .interpolator(new DecelerateInterpolator())
    .sectionsCount(4)
    .separatorLength(8)     //You should use Resources#getDimensionPixelSize
    .strokeWidth(8f)         //You should use Resources#getDimension
    .speed(2.0)             //2 times faster
    .reversed(false)
    .mirrorMode(false)
    .build());

You can also set many colors for one bar (see G+ app)

  • via xml (use the app:spb_colors attribute with a integer-array reference for that)

  • programmatically (use SmoothProgressDrawable.Builder#colors(int[]) method).

##License

"THE BEER-WARE LICENSE" (Revision 42):
You can do whatever you want with this stuff.
If we meet some day, and you think this stuff is worth it, you can buy me a beer in return.

####Badges Travis master: Build Status Travis dev: Build Status Bitdeli: Bitdeli Badge

Analytics

smoothprogressbar's People

Contributors

castorflex avatar luciofm avatar intrications avatar

Watchers

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