MultipleProgressBar
Introduction: Android library for multiple progress bar fan
Tags:
Short description
This library makes it possible to display a progress bar, as in "Social Media" 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:
lineColor
(color) default:Color.GRAY
progressColor
(color) default:Color.WHITE
progressSteps
(integer) default:1
progressPadding
(dimension) default:8dp
progressWidth
(dimension) default:10F
progressPercents
(integer) default:100
isNeedRestoreProgress
(boolean) default:false
singleDisplayedTime
(float) default:1F
Also the following api allows you to control the display of progress:
start()
- starts / resumes showing progresspause()
- pauses showing progress. The scale stops at the current positionprevious()
- 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.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.clear()
- clearing the current state of progress, resetting the scale to the very beginningsetListener(listener: ProgressStepChangeListener)
- sets the listenerProgressStepChangeListener
to switch progress blockssetProgressPercents(progress: Int
- sets the number of percent for calculating the progress scalesetProgressStepsCount(stepsCount: Int)
- sets the total number of progress stepssetSingleDisplayTime(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 Jitpack.io . You can add this repository to your project with:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
}
Add to your .gradle file:
dependencies {
implementation 'dependencies {
implementation 'com.github.salihselimsekerci:MultipleProgressBar:1.1.0'
}'
}
Sample
The sample is on app
module
License
MIT License
Copyright (c) 2021 Salih Selim ŞEKERCİ
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.