Beautiful progress bar with segments. Highly customizable. Fully written with Jetpack Compose

Overview

🚥 SegmentedProgressBar 🚥


Beautiful progress bar split into several segments. Highly customizable. Fully written with Jetpack Compose.

License License Build Status API



Why this library?

Have you ever needed to display a progression showing several completion steps? The Android SDK offers a ProgressBar component that comes with a single segment. When you want to give a compelling interface showing the actual progression of your users, it looks friendlier – and prettier! – to show a segmented progression rather than a linear progression partially filled.

This component allows you to split your progression into distinct segments. It goes even further by letting you customize its display with attributes such as spacing between segments as well as a bevel to embellish your design.

The sample speaks for itself

Including in your project

Because the library is written with Jetpack Compose, it requires your project to use Kotlin to inflate this component. You can safely insert it in a non-Compose project with a ComposeView as long as it uses Kotlin.

Add Jitpack (where the library is hosted) in your root build.gradle file:

allprojects {
  repositories {
    maven { url "https://jitpack.io" }
  }
}

Then in your build.gradle module file where you want to use this library:

dependencies {
  implementation "com.stephenvinouze:SegmentedProgressBar:{latest_version}"
}

How to use

Only the segmentCount is required to build the progress bar.

From Compose:

setContent {
  YourTheme {
    SegmentedProgressBar(
      segmentCount = 3,
    )
  }
}

Where YourTheme is the Theme you're using in your application.

From XML:

<androidx.compose.ui.platform.ComposeView
  android:id="@+id/segmented_progress_bar"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content" />

Then in your code:

findViewById<ComposeView>(R.id.segmented_progress_bar).setContent {
  YourTheme {
    Surface {
      SegmentedProgressBar(
        segmentCount = 3,
      )
    }
  }
}

If you'd like to discover what this component offers, here is an exhaustive description of what it's capable of.

SegmentedProgressBar(
  segmentCount = 3,
  modifier = Modifier,
  spacing = 10.dp,
  angle = 30f, // Can also be negative to invert the bevel side
  progress = 1,
  segmentColor = SegmentColor(
    color = Color.Gray,
    alpha = 0.3f,
  ),
  progressColor = SegmentColor(
    color = Color.Green,
    alpha = 1f,
  ),
  drawSegmentsBehindProgress = false, // See Javadoc for more explanation on this parameter
  progressAnimationSpec = tween( // You can give any animation spec you'd like
    durationMillis = 1000,
    easing = LinearEasing,
  ),
  onProgressChanged = { progress: Float, progressCoordinates: SegmentCoordinates ->
    // Get notified at each recomposition cycle when a progression occurs.
    // You can use the current progression or the coordinates the progress segment currently has.
  },
  onProgressFinished = {
    // Get notified when the progression animation ends.
  }
)

I encourage you to play around with the sample to get a better look and feel. It show cases advanced usage with custom animation based on the progression callbacks that aren't part of the library itself.

License

Copyright 2022 Stephen Vinouze

Licensed 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 at

   http://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.
You might also like...
PowerSpinner - 🌀 A lightweight dropdown popup spinner, fully customizable with an arrow and animations for Android.
PowerSpinner - 🌀 A lightweight dropdown popup spinner, fully customizable with an arrow and animations for Android.

PowerSpinner - 🌀 A lightweight dropdown popup spinner, fully customizable with an arrow and animations for Android.

Some beautiful android loading drawable, can be combined with any view as the LoadingView or the ProgressBar. Besides, some Drawable can customize the loading progress too.
Some beautiful android loading drawable, can be combined with any view as the LoadingView or the ProgressBar. Besides, some Drawable can customize the loading progress too.

LoadingDrawable: Android cool animation collection 前言 CircleRotate源码解析 Fish源码解析 LoadingDrawable is some android animations implement of drawable: a li

[Android] Round Corner Progress Bar Library for Android
[Android] Round Corner Progress Bar Library for Android

RoundCornerProgressBar Round corner is cool. Let's make your progress bar to round corner Colorful progress bar with round corner on progress which yo

[Android] Round Corner Progress Bar Library for Android
[Android] Round Corner Progress Bar Library for Android

RoundCornerProgressBar Round corner is cool. Let's make your progress bar to round corner Colorful progress bar with round corner on progress which yo

A wave view of android,can be used as progress bar.
A wave view of android,can be used as progress bar.

WaveView ![Gitter](https://badges.gitter.im/Join Chat.svg) A wave view of android,can be used as progress bar. Screenshot APK demo.apk What can be use

DownloadProgressBar is an android library that delivers awesome custom progress bar. You can manipulate it's state in every way.
DownloadProgressBar is an android library that delivers awesome custom progress bar. You can manipulate it's state in every way.

Download Progress Bar Android progress bar with cool animation, inspired by : https://dribbble.com/shots/2012292-Download-Animation ###Attributes Attr

Android - An action bar item which acts both as a refresh button and as a progress indicator
Android - An action bar item which acts both as a refresh button and as a progress indicator

RefreshActionItem An action bar item that implements this common pattern: Initially it shows a refresh button. If the button is clicked, a background

Open source android library for different progress bar designs
Open source android library for different progress bar designs

MultiProgressBar A progress bar library for Android that provides customized progress bars. Built with ❤︎ by Aseem Khare 💻 Installation Add this in y

Arc pointer - simple customized progress bar in the form of an arch
Arc pointer - simple customized progress bar in the form of an arch

ArcPointer Simple customized progress bar in the form of an arch Demo Quick start Step 1 Gradle: compile 'io.github.dvegasa:arcpointer:1.0.2' Maven:

Releases(1.0.0)
Owner
Stephen Vinouze
Stephen Vinouze
Android library for showing progress in a highly customizable pie.

ProgressPieView Android library for showing progress in a highly customizable pie. Choose from the broad spectre of styleable elements: ppvStrokeWidth

Filip Puđak 399 Dec 29, 2022
This is beautiful color arc progress bar.

ColorArcProgressBar 中文版 This is a customizable circular progressbar.It can achieve the effect of the QQ health's arc progress with XML. What's more, w

PASSION 928 Dec 6, 2022
A progress wheel for android, intended for use instead of the standard progress bar.

Deprecation warning This project is no-longer maintained, and has not been maintained for a few years now. If you're looking for an alternative librar

Todd Davies 2.7k Dec 29, 2022
:barber: [Android Library] Stacked dual progress indicator progress-bar

StackedHorizontalProgressBar Specs Featured in Show some ❤️ Android library with ability to show two progress indicators in one horizontal progress ba

Nishant Srivastava 98 Nov 11, 2022
A customizable, animated progress bar that features rounded corners. This Android library is designed to look great and be simple to use 🎉

RoundedProgressBar Easy, Beautiful, Customizeable The RoundedProgressBar library gives you a wide range of customizable options for making progress ba

null 541 Jan 1, 2023
A customizable indeterminate progress bar

DilatingDotsProgressBar Installation compile 'com.github.justzak:dilatingdotsprogressbar:1.0.1' Usage <com.zl.reik.dilatingdotsprogressbar.DilatingDo

Zachary Reik 628 Sep 24, 2022
A highly configurable library to do loading progress with animated balls

Loading Balls A highly configurable library to do loading progress with animated balls for Android How to use Custom attributes lib:path="triangle" Th

Adrián Lomas 930 Dec 7, 2022
An android library to easily add circular progress bar into your Jetpack Compose apps.

CircularProgressBar for Jetpack Compose An android library to easily add circular progress bar into your Jetpack Compose apps. Have a Look Usage Circu

Hitanshu Dhawan 38 Oct 30, 2022
Completely customizable progress based loaders drawn using custom CGPaths written in Swift

FillableLoaders Completely customizable progress based loaders drawn using custom CGPaths written in Swift Waves Plain Spike Rounded Demo: Changelog:

Pol Quintana 2.1k Dec 31, 2022
Completely customizable progress based loaders drawn using custom CGPaths written in Swift

FillableLoaders Completely customizable progress based loaders drawn using custom CGPaths written in Swift Waves Plain Spike Rounded Demo: Changelog:

Pol Quintana 2.1k Dec 31, 2022