Progress Bar in the shape of regular polygon.

Overview

N-SidedProgressBar

Platform GitHub GitHub

Progress Bar in the shape of regular polygon.

1 3 2

Download

The library is available on jcenter. Just add the dependency to your build.gradle file.

repositories {
    jcenter()
}
implementation 'com.kaishu.nspb:nsidedprogressbar:1.0.2'

Usage

To create NSidedProgressBar in xml :-

...
<com.iitr.kaishu.nsidedprogressbar.NSidedProgressBar
        android:id="@+id/NSidedProgressBar"
        android:layout_width="75dp"
        android:layout_height="75dp"
        android:layout_gravity="center"
        app:nsidedProg_baseSpeed="5"
        app:nsidedProg_sideCount="3"
        app:nsidedProg_clockwise="true"
        />
...

Don't forget to add xmlns:app="http://schemas.android.com/apk/res-auto"

Or in Java

....
NSidedProgressBar nSidedProgressBar  = new NSidedProgressBar(this, 3);
nSidedProgressBar.setBaseSpeed(5);
...

Properties

Properties which can be set from xml:-

  • nsidedProg_sideCount: set the number of sides.
  • nsidedProg_primaryColor: set the color of unmovable part.
  • nsidedProg_secondaryColor: set the colot of movable part.
  • nsidedProg_baseSpeed: set the speed(constant) of unaccelerated end.
  • nsidedProg_refreshRate: set the fps of animation.
  • nsidedProg_primaryRimWidth: set the width of unmovable part.
  • nsidedProg_secondaryRimWidth: set the width of movable part.
  • nsidedProg_clockwise: set the nature of rotation.
  • nsidedProg_determinate: set the nature of progress bar.
  • nsidedProg_startSide: set the starting point of determinate progress bar.

License

N-sidedProgressBar is licensed under MIT license. View license.

You might also like...
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:

MusicBar 2.1 0.0 Java view visualize progress bar for sound file like sound cloud
MusicBar 2.1 0.0 Java view visualize progress bar for sound file like sound cloud

MusicBar Setup dependencies { implementation 'com.oze.music:MusicBar:1.0.5' } Usage Function Description setAnimationChangeListener(OnMusicBarAn

a circle progress bar with effect
a circle progress bar with effect

RingProgress a circle progress bar with effect #Preview ##Usage xml com.ldoublem.ringPregressLibrary.RingProgress android:id="@+id/ring_prog

An android library to easily add circular progress bar into your Jetpack Compose apps.
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

An instagram-like segmented progress bar
An instagram-like segmented progress bar

An instagram-like segmented progress bar

A feature rich staged progress bar with modifiable steps in between its stages.
A feature rich staged progress bar with modifiable steps in between its stages.

StageStepBar A staged progressbar that you can use if you want finer control of the steps in between its stages. You can customize: Number of steps be

Custom Progress bar with stages developed in kotlin.
Custom Progress bar with stages developed in kotlin.

Custom-Progress-SeekBar A fully Customizable Semi Circle Arc Progress Bar. You can customize the the width and color of both progress and progress pla

Sector progress bar with kotlin
Sector progress bar with kotlin

SectorProgressBar Sector progress bar You can visually see the use of this libra

Comments
  • Crashing on Android 5.1

    Crashing on Android 5.1

    Process: in.co.erudition.paper, PID: 20212 java.lang.RuntimeException: Unable to start activity ComponentInfo{in.co.erudition.paper/in.co.erudition.paper.activity.MainActivity}: android.view.InflateException: Binary XML file line #66: Error inflating class com.erudition.polygonprogressbar.NSidedProgressBar at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2339) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2413) at android.app.ActivityThread.access$800(ActivityThread.java:155) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1317) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5343) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700) Caused by: android.view.InflateException: Binary XML file line #66: Error inflating class com.erudition.polygonprogressbar.NSidedProgressBar at android.view.LayoutInflater.createView(LayoutInflater.java:633) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743) at android.view.LayoutInflater.rInflate(LayoutInflater.java:806) at android.view.LayoutInflater.parseInclude(LayoutInflater.java:916) at android.view.LayoutInflater.rInflate(LayoutInflater.java:802) at android.view.LayoutInflater.parseInclude(LayoutInflater.java:916) at android.view.LayoutInflater.rInflate(LayoutInflater.java:802) at android.view.LayoutInflater.inflate(LayoutInflater.java:504) at android.view.LayoutInflater.inflate(LayoutInflater.java:414) at android.view.LayoutInflater.inflate(LayoutInflater.java:365) at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469) at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) at in.co.erudition.paper.activity.MainActivity.onCreate(MainActivity.java:103) at android.app.Activity.performCreate(Activity.java:6010) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1129) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2292) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2413)  at android.app.ActivityThread.access$800(ActivityThread.java:155)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1317)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:135)  at android.app.ActivityThread.main(ActivityThread.java:5343)  at java.lang.reflect.Method.invoke(Native Method)  at java.lang.reflect.Method.invoke(Method.java:372)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)  Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Constructor.newInstance(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:288) at android.view.LayoutInflater.createView(LayoutInflater.java:607) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)  at android.view.LayoutInflater.parseInclude(LayoutInflater.java:916)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:802)  at android.view.LayoutInflater.parseInclude(LayoutInflater.java:916)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:802)  at android.view.LayoutInflater.inflate(LayoutInflater.java:504)  at android.view.LayoutInflater.inflate(LayoutInflater.java:414)  at android.view.LayoutInflater.inflate(LayoutInflater.java:365)  at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)  at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)  at in.co.erudition.paper.activity.MainActivity.onCreate(MainActivity.java:103)  at android.app.Activity.performCreate(Activity.java:6010)  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1129)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2292)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2413)  at android.app.ActivityThread.access$800(ActivityThread.java:155)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1317)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:135)  at android.app.ActivityThread.main(ActivityThread.java:5343)  at java.lang.reflect.Method.invoke(Native Method)  at java.lang.reflect.Method.invoke(Method.java:372)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)  Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void java.util.Timer.cancel()' on a null object reference at com.erudition.polygonprogressbar.NSidedProgressBar.onVisibilityChanged(NSidedProgressBar.java:424) at android.view.View.dispatchVisibilityChanged(View.java:8736) at android.view.View.setFlags(View.java:9779) at android.view.View.(View.java:4164) at android.view.View.(View.java:3650) at android.view.View.(View.java:3629) at com.erudition.polygonprogressbar.NSidedProgressBar.(NSidedProgressBar.java:97) at java.lang.reflect.Constructor.newInstance(Native Method)  at java.lang.reflect.Constructor.newInstance(Constructor.java:288)  at android.view.LayoutInflater.createView(LayoutInflater.java:607)  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)  at android.view.LayoutInflater.parseInclude(LayoutInflater.java:916)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:802)  at android.view.LayoutInflater.parseInclude(LayoutInflater.java:916)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:802)  at android.view.LayoutInflater.inflate(LayoutInflater.java:504)  at android.view.LayoutInflater.inflate(LayoutInflater.java:414)  at android.view.LayoutInflater.inflate(LayoutInflater.java:365)  at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)  at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)  at in.co.erudition.paper.activity.MainActivity.onCreate(MainActivity.java:103)  at android.app.Activity.performCreate(Activity.java:6010)  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1129)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2292)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2413)  at android.app.ActivityThread.access$800(ActivityThread.java:155)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1317)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:135)  at android.app.ActivityThread.main(ActivityThread.java:5343)  at java.lang.reflect.Method.invoke(Native Method)  at java.lang.reflect.Method.invoke(Method.java:372)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700) 

    This method is causing problem @Override protected void onVisibilityChanged(@NonNull View changedView, int visibility) { super.onVisibilityChanged(changedView, visibility);

        if (visibility == View.INVISIBLE) {
            timer.cancel();
        } else {
            timer = new Timer();
            timer.scheduleAtFixedRate(new TimerTask() {
                @Override
                public void run() {
                    ((Activity) context).runOnUiThread(new Runnable() {
                        @Override
                        public void run() {
                            NSidedProgressBar.this.invalidate();
                        }
                    });
                }
            }, 0, 1000 / refreshRate);
        }
    }
    

    It works seemlessly on above android 6

    bug 
    opened by arunavo4 2
  • Rectangle shape

    Rectangle shape

    Thanks for this Progress bar, it's really awesome!

    One question though, if I wanted to make a rectangular progress bar, instead of the square one, for instance, around the borders of a button. would that be possible?

    opened by premacck 0
  • Crash in BottomSheet

    Crash in BottomSheet

    when i use library in BottomSheetDialogFragment crash with this error

    java.lang.ClassCastException: android.view.ContextThemeWrapper cannot be cast to android.app.Activity

    opened by oneHamidreza 0
  • N-SidedProgressBar context memory leak

    N-SidedProgressBar context memory leak

    Good day. In the process of using leakCanary detects a leak. Refers to the context of the N-SidedProgressBar.

    I use the progress bar in the Fragment. It is likely that the fragment can not be destroyed, because the progress bar keeps the weak to activity. It is probably necessary to free the context in the onDetachedFromWindow () method.

    photo_2019-01-14_10-21-52

    opened by BoldakovAlex 1
Owner
Kaishu Sahu
GSoC'19 @LibreOffice, Undergrad at IIT Roorkee.
Kaishu Sahu
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
[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

Akexorcist 2.3k Dec 31, 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 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
[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

Akexorcist 2.3k Jan 7, 2023
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

Kai Wang 1.3k Dec 28, 2022
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

Mariusz Brona 978 Nov 10, 2022
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

Manuel Peinado Gallego 655 Nov 10, 2022
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