MultiProgressBar

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

View support state recovery using onSaveInstanceState

MultiProgressBar

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
  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. setProgressPercents(progress: Int - sets the number of percent for calculating the progress scale
  8. setProgressStepsCount(stepsCount: Int) - sets the total number of progress steps
  9. setSingleDisplayTime(singleDisplayedTime: Float) - sets the display time of one cell. Can be used in run time
interface ProgressStepChangeListener {
    fun onProgressStepChange(newStep: Int)
}

Usage

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

		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}

Add to your .gradle file:

dependencies {
	        implementation 'com.github.salihselimsekerci:MultiProgressBar:Tag'
	}

Sample

The sample is on app module

GitHub