Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/MackHartley/RoundedProgressBar
A customizable, animated progress bar that features rounded corners. This Android library is designed to look great and be simple to use π
https://github.com/MackHartley/RoundedProgressBar
android android-library animated progress-bar rounded-corners
Last synced: 3 days ago
JSON representation
A customizable, animated progress bar that features rounded corners. This Android library is designed to look great and be simple to use π
- Host: GitHub
- URL: https://github.com/MackHartley/RoundedProgressBar
- Owner: MackHartley
- License: apache-2.0
- Created: 2020-08-29T23:56:20.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-01-28T23:55:41.000Z (10 months ago)
- Last Synced: 2024-08-01T19:39:58.497Z (3 months ago)
- Topics: android, android-library, animated, progress-bar, rounded-corners
- Language: Kotlin
- Homepage:
- Size: 17.1 MB
- Stars: 765
- Watchers: 7
- Forks: 59
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-list - MackHartley/RoundedProgressBar - A customizable, animated progress bar that features rounded corners. This Android library is designed to look great and be simple to use π (Kotlin)
- awesome-android-ui - RoundedProgressBar - 2.0) | <img src="/art/roundedProgressBarDemo.gif" width="60%"> (Index)
README
RoundedProgressBar
Easy, Beautiful, Customizable
Using the `RoundedProgressBar` library you can easily create beautiful progress bars with individually rounded corners, animating progress text and more! Below are several examples of progress bars created with this library.
If youβd like to see if this library is right for your project then try downloading the demo app which is available on the [Google Play Store](https://play.google.com/store/apps/details?id=com.mackhartley.roundedprogressbarexample). There you can fully customize a `RoundedProgressBar` to see if youβre able to achieve the desired look and feel for your project.
Do you use `RoundedProgressBar` in your app? Consider adding a picture or GIF of your usage to [`who_uses_rpb.md`](https://github.com/MackHartley/RoundedProgressBar/blob/master/who_uses_rpb.md). This provides examples to developers on how the library is used and gives your app a bit of **free publicity!**
# Gradle Setup βοΈ
[![](https://jitpack.io/v/MackHartley/RoundedProgressBar.svg)](https://jitpack.io/#MackHartley/RoundedProgressBar)If you don't have this already, add it to your **root** build.gradle file:
```
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```Then you can add the dependency to your **app** build.gradle file:
```
dependencies {
...
implementation 'com.github.MackHartley:RoundedProgressBar:3.0.0'
}
```# Notable Features π
1) **Full Color Customization** - You can even specify what color the text is depending on which background it draws over. Transparent colors are also supported
2) **Complete Text Customization** - The text displayed on the progress bar can be customized to say whatever you want. Additionally you can add padding and even supply your own font for use with the progress bar (`.ttf` and `.otf` formats supported)
3) **Low Value Support** - The progress bar looks nice even at low values (This is a common issue when dealing with rounded progress bars)
4) **Any Corner Radius Allowed** - Individual corners can even have different radius values
5) **Modular** - The `RoundedProgressBar` library can be seamlessly included in custom layouts due to the fact that each corner can have a different radius
Click here or here to see code
**Additionally**, the `RoundedProgressBar` handles all internal state during configuration changes# Public Methods and Xml Attributes π»
These are the methods which can be called on the `RoundedProgressBar` class:```
setProgressPercentage(progressPercentage: Double, shouldAnimate: Boolean = true)
getProgressPercentage(): DoublesetProgressDrawableColor(@ColorInt newColor: Int) // Sets the color of the 'progress' part of the progress bar
setBackgroundDrawableColor(@ColorInt newColor: Int) // Sets the color of the 'background' part of the progress bar
setProgressTextColor(@ColorInt newColor: Int) // Sets text color for when it is drawn over the progress part of progress bar
setBackgroundTextColor(@ColorInt newColor: Int) // Sets text color for when it is drawn over the background part of progress barsetCornerRadius(
topLeftRadius: Float,
topRightRadius: Float,
bottomRightRadius: Float,
bottomLeftRadius: Float
)setTextSize(newTextSize: Float)
setTextPadding(newTextPadding: Float) // Sets the padding between the progress text and end (or start) of the progress bar
setAnimationLength(newAnimationLength: Long)showProgressText(shouldShowProgressText: Boolean)
setRadiusRestricted(isRestricted: Boolean)
```The `RoundedProgressBar` can also be configured via xml attributes. Below is the full list of attributes along with the methods they map to.
| Xml Attribute | Method |
|---|---|
| `rpbProgress` | `setProgressPercentage(...)` |
| `rpbProgressColor` | `setProgressDrawableColor(...)` |
| `rpbBackgroundColor` | `setBackgroundDrawableColor(...)` |
| `rpbProgressTextColor` | `setProgressTextColor(...)` |
| `rpbBackgroundTextColor` | `setBackgroundTextColor(...)` |
| `rpbCornerRadius` | `setCornerRadius(...)` |
| `rpbCornerRadiusTopLeft` | `setCornerRadius(...)` |
| `rpbCornerRadiusTopRight` | `setCornerRadius(...)` |
| `rpbCornerRadiusBottomRight` | `setCornerRadius(...)` |
| `rpbCornerRadiusBottomLeft` | `setCornerRadius(...)` |
| `rpbTextSize` | `setTextSize(...)` |
| `rpbTextPadding` | `setTextPadding(...)` |
| `rpbAnimationLength` | `setAnimationLength(...)` |
| `rpbShowProgressText` | `showProgressText(...)` |
| `rpbIsRadiusRestricted` | `setRadiusRestricted(...)` |# Contributing π€
Feel free to open up issues on this repo to report bugs or request features.Additionally if you'd like to contribute to the library please feel free to open up a pull request! Just give me a heads up first though (via issues or comments) so we don't overwrite each other in the event I am updating the project.
**Special thanks to all those who have supported this repo thus far!**
Featured in Android Weekly, Android Arsenal and Medium.# License π
```
Copyright 2021 Mack HartleyLicensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```