GithubHelp home page GithubHelp logo

aaaliua / circularprogressview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rahatarmanahmed/circularprogressview

0.0 2.0 0.0 465 KB

A Material style circular progress bar for Android

License: MIT License

Java 100.00%

circularprogressview's Introduction

Material CircularProgressView

Indeterminate Determinate
Sample Indeterminate GIF Sample Determinate GIF

Description

This CircularProgressView is a (surprisingly) circular progress bar Android View that is designed to imitate the Material versions of ProgressBar. These versions can be seen on this page of the Material design spec under Circular indicators.

Usage

To use CircularProgressView you must add it as a dependency in your Gradle build:

dependencies {
    compile 'com.github.rahatarmanahmed:circularprogressview:1.0.0'
}

Then add the view to your layout:

<com.github.rahatarmanahmed.cpv.CircularProgressView
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/progress_view"
    android:layout_width="40dp"
    android:layout_height="40dp"
    app:cpv_indeterminate="true"/>

XML attributes

Name Type Default Description
cpv_progress float 0 The current progress of the progress bar.
cpv_maxProgress float 100 The maximum progress of the progress bar; what's considered as 100% of the bar.
cpv_thickness dimension 4px The thickness of the progress bar.
cpv_color color Material Blue 500 (#2196F3) The color of the progress bar.
cpv_indeterminate boolean false Whether this progress bar is indeterminate or not. If indeterminate, the progress set on this view will not have any effect.
cpv_animDuration integer 4000 The duration of the progress bar animation in milliseconds. If the bar is determinate, it is the duration of the initial spin animation. If indeterminate, it is the duration of all "steps" of the indeterminate animation.
cpv_animSteps integer 3 The number of "steps" in the indeterminate animation (how many times it does the loopy thing before returning to its original position). It is recommended to use an odd number, as even numbers of steps look the same after half the number of steps.
cpv_animAutostart boolean false Whether this progress bar should automatically start animating once it is initialized.

Public Methods

Name Description
isIndeterminate() Returns true if the progress bar is indeterminate, false if determinate.
setIndeterminate(boolean) Set whether this progress bar is indeterminate or not. Will reset the animation if the value changes
getThickness() Gets the thickness of the progress bar.
setThickness(int) Sets thickness of the progress bar.
getColor() Gets the color of the progress bar.
setColor(int) Sets the color of the progress bar.
getMaxProgress() Gets the maximum progress of the progress bar.
setMaxProgress(float) Sets the maximum progress of the progress bar.
getProgress() Gets the current progress of the progress bar.
setProgress(float) Sets the current progress of the progress bar. (Will linearly animate the update.)
startAnimation() Starts the animation of the progress bar. (Alias of resetAnimation().)
resetAnimation() Resets the animation of the progress bar.

circularprogressview's People

Contributors

rahatarmanahmed avatar wolftein avatar

Watchers

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