Short description

This library makes it possible to display a progress bar like in “social media” stories with little effort.

Indicate the restoration of the support status with onSaveInstanceState

details

These attributes (app in your layout) you can optimize the behavior of the progress bar:

  1. lineColor (Color) standard: Color.GRAY
  2. progressColor (Color) standard: Color.WHITE
  3. progressSteps (Integer) Standard: 1
  4. progressPadding (Dimension) Standard: 8dp
  5. progressWidth (Dimension) Standard: 10F
  6. progressPercents (Integer) Standard: 100
  7. isNeedRestoreProgress (Boolean) standard: false
  8. singleDisplayedTime (float) default: 1F

You can also control the display of progress using the following API:

  1. start() – starts / continues and shows the progress
  2. pause() – pauses with progress indicators. The scale stops at the current position
  3. previous() – Go to the beginning of the previous progress block. When the progress starts, the show starts immediately. Otherwise it will stop at the beginning of the block.
  4. next() – Go to the beginning of the next progress block. When the progress starts, the show starts immediately. Otherwise it will stop at the beginning of the block.
  5. clear() – Deleting the current progress status and resetting the scale to the beginning
  6. setListener(listener: ProgressStepChangeListener) – puts the phone on ProgressStepChangeListener Switch progress blocks
  7. setProgressPercents(progress: Int – defines the percentage for calculating the progress scale
  8. setProgressStepsCount(stepsCount: Int) – Defines the total number of progress steps
  9. setSingleDisplayTime(singleDisplayedTime: Float) – Defines the display time of a cell. Can be used at runtime
interface ProgressStepChangeListener { fun onProgressStepChange(newStep: Int)
}

use

Artifact is published on 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 switched on app module

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.

LEAVE A REPLY

Please enter your comment!
Please enter your name here