Coder Social home page Coder Social logo

sasanchezcastillo / multiprogressbar Goto Github PK

View Code? Open in Web Editor NEW

This project forked from geniusrus/multiprogressbar

0.0 0.0 0.0 175 KB

Android multiple progress bar like Instagram Stories

License: Apache License 2.0

Kotlin 96.49% Java 3.51%

multiprogressbar's Introduction

MultiProgressBar

Maven Central codebeat badge

Short description

This library makes it possible to display a progress bar, as in Instagram Stories, without much effort.

View support state recovery using onSaveInstanceState

Details

These attributes (app in your layout) allow you to fine-tune the behavior of the progress bar:

  1. lineColor (color) default: Color.GRAY
  2. progressColor (color) default: Color.WHITE
  3. progressSteps (integer) default: 1
  4. progressPadding (dimension) default: 8dp
  5. progressWidth (dimension) default: 10F
  6. progressPercents (integer) default: 100
  7. isNeedRestoreProgress (boolean) default: false
  8. singleDisplayedTime (float) default: 1F

Also the following api allows you to control the display of progress:

  1. start() - starts / resumes showing progress. Start from N position is also supported
  2. pause() - pauses showing progress. The scale stops at the current position
  3. previous() - move to the beginning of the previous block of progress. If progress is started, the show will start immediately. Otherwise, it will stop at the beginning of the block.
  4. next() - move to the beginning of the next block of progress. If progress is started, the show will start immediately. Otherwise, it will stop at the beginning of the block.
  5. clear() - clearing the current state of progress, resetting the scale to the very beginning
  6. setListener(listener: ProgressStepChangeListener) - sets the listener ProgressStepChangeListener to switch progress blocks
  7. setFinishListener(finishListener: ProgressFinishListener) - set the listener ProgressFinishListener that indicates end of progress
  8. setProgressPercents(progress: Int - sets the number of percent for calculating the progress scale
  9. setProgressStepsCount(stepsCount: Int) - sets the total number of progress steps
  10. setSingleDisplayTime(singleDisplayedTime: Float) - sets the display time of one cell. Can be used in runtime
interface ProgressStepChangeListener {
    fun onProgressStepChange(newStep: Int)
}

Usage

Artifact is publishing to Maven Central. You can add this repository to your project with:

repositories {
    mavenCentral()
}

Add to your .gradle file:

implementation "io.github.geniusrus:multiprogressbar:$latest_version"

Sample

The sample is on app module

Developers

  1. Viktor Likhanov

Yandex: [email protected]

License

Apache v2.0 License

Copyright (c) 2019 Viktor Likhanov

multiprogressbar's People

Contributors

geniusrus avatar volixanov 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.