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

Overview

ArcPointer

Simple customized progress bar in the form of an arch

Thumbnail

Demo

Demo gif animation

Quick start

Step 1

Gradle:

compile 'io.github.dvegasa:arcpointer:1.0.2'

Maven:

<dependency>
  <groupId>io.github.dvegasa</groupId>
  <artifactId>arcpointer</artifactId>
  <version>1.0.2</version>
  <type>pom</type>
</dependency>

Step 2

XML:

<io.github.dvegasa.arcpointer.ArcPointer
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:radius="150dp"
        android:padding="8dp"
        android:id="@+id/arcpointer"/>

Java:

        ArcPointer arcPointer = findViewById(R.id.arcpointer);
        arcPointer.setValue(0.5f);
        arcPointer.setNotches(9);
        [...]

android:layout_width and android:layout_height should be set "wrap_content". To specify the size of View, use the radius.

Documentation

Definitions

XML attributes and Java methods

radius (dp) int getRadius() void setRadius(int radius)

The radius of arc


value (float) float getValue() void setValue(float value)

The pointer positon. Value is a float between 0 and 1 (see image above for more understanding)

     0f = left border
   0.5f = mid of arc
     1f = right border

workAngle (int) [degrees] int getWorkAngle() void setWorkAngle(int workAngle)

The value of the angle of the arch in degrees


notches (Only Java) float[] getNotches() void setNotches(int n) void setNotches (float[] notches)

The position of notches on the arch.

  • If you use (int n) overload, the n notches will be located evenly
  • If you use (float[] notches) overload, the notches will be located on the coordinates you specify

setNotches(new float[]{0.1f, 0.2f, 0.5f});

setNotches(3); setValue(0.625f);


isAnimated (boolean) boolean isAnimated() void setAnimated(boolean animated)

If true, then the value change occurs with animation.


animationVelocity (int in XML) long getAnimationVelocity() void setAnimationVelocity(long animationVelocity)

Animation speed. The smaller, the faster. Default value is 1500L

{!} Calling setAnimationVelocity doesn't cause the redraw of View


lineLengthRatio (float) float getLineLengthRatio() void setLineLengthRatio(float lineLengthRatio)

Indicates the length of the line relative to the radius of the arc.

lineLength = radius * lineLengthRatio


lineStrokeWidth (float) float getLineStrokeWidth() void setLineStrokeWidth(float lineStrokeWidth)

Line width. Default value is 2f


markerLengthRatio (float) float getMarkerLengthRatio() void setMarkerLengthRatio(float markerLengthRatio)

Indicates the length of the marker relative to the length of line


markerStrokeWidth (float) float getMarkerStrokeWidth() void setMarkerStrokeWidth(float markerStrokeWidth)

Marker width. Default value is 3f


notchesLengthRatio (float) Use setNotchesLengthRatio instead float getNotchLengthRatio() void setNotchLengthRatio(float notchLengthRatio);

Indicates the length of the notch relative to the radius of arc


notchStrokeWidth (float) Use setNotchesStrokeWidth instead float getNotchStrokeWidth() void setNotchStrokeWidth(float notchStrokeWidth)

Notch width. Default value is 1.5f


colorBackground (int) int getColorBackground() void setColorBackground(int colorBackground)

Color of the background


colorLine (int) int getColorLine() void setColorLine(int colorLine)

Color of the line


colorMarker (int) int getColorMarker() void setColorMarker(int colorMarker)

Color of the marker


colorNotches (int) Use setNotchesColors instead int getColorNotches() void setColorNotches(int colorNotches)

Color of the notches


notchesColors (only Java) int[] getNotchesColors() void setNotchesColors(int color) void setNotchesColors(int[] colors)

Color of the notches.

Overload (int color) will set color for all notches

Overload (int[] colors) will set colors[i] color to notch[i]


notchesLengthRatio float[] getNotchesLengthRatio() void setNotchesLengthRatio(float ratio) void setNotchesLengthRatio(float[] ratios)

Indicates the length of the notch relative to the radius of arc

Overload (float ratio) will set length ratio for all notches.

Overload (float[] ratios) will set ratio[i] length ratio to notch[i]


notchesStrokeWidth float[] getNotchesStrokeWidth() void setNotchesStrokeWidth(float stroke) void setNotchesStrokeWidth(float[] stroke)

Notch width. Default value is 1.5f

Overload (float stroke) will set stroke width for all notches.

Overload (float[] stroke) will set stroke[i] stroke width to notch[i]


ChangeLog

1.0.2

27 June, 2018

  • Added customization of single notch:
    • Individual length
    • Individual color
    • Individual strokeWidth
  • Old methods for working with notches have become deprecated

Sample java class with 1.0.2 features

1.0.1

June, 2018

Bug fix

1.0.0

June, 2018

Release


LICENSE

   Copyright 2018 Eduard Khalturin

   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...
[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

A customizable indeterminate progress bar
A customizable indeterminate progress bar

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

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

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

Progress Bar in the shape of regular polygon.
Progress Bar in the shape of regular polygon.

N-SidedProgressBar Progress Bar in the shape of regular polygon. Download The library is available on jcenter. Just add the dependency to your build.g

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

Comments
  • How to change partial Notch Colors and Drawable

    How to change partial Notch Colors and Drawable

    I want to change colors specific notches. How to do it ? Say, I want to show percentage. Show if Percentage is 49 then 49 Notches should be of color red and rest should be of color black. How to achieve this. I tried changing color of notches but it changes color of the all the notches.

    See image attached below for reference.

    Thanks.

    I want to do this snap 2018-06-24 at 12 59 11

    I am able to do this much only : snap 2018-06-24 at 13 03 05

    enhancement 
    opened by pravingaikwad07 2
Owner
Ed Khalturin
Android native & Flutter dev
Ed Khalturin
IOSProgressBar is a progress-bar lib for android. And the progress-bar looks like iOS system style

IOSProgressBar is a progress-bar lib for android. And the progress-bar looks like iOS system style

heyangyang 6 Aug 25, 2022
A circular android ProgressBar library which extends View, and the usage same as ProgressBar, It has solid,line and solid_line three styles. Besides, progress value can be freely customized.

CircleProgressBar δΈ­ζ–‡η‰ˆζ–‡ζ‘£ The CircleProgressBar extends View, It has both solid and line two styles. Besides, progress value can be freely customized. I

dinus_developer 1.2k Jan 3, 2023
Present your progress bars in arc mode with information and total control.

ArcProgressStackView Present your progress bars in arc mode with information and total control. You can check the sample app here. Warn This library i

Basil Miller 249 Sep 10, 2022
Present your progress bars in arc mode with information and total control.

ArcProgressStackView Present your progress bars in arc mode with information and total control. You can check the sample app here. Warn This library i

Devlight 1.3k Nov 29, 2022
Present your progress bars in arc mode with information and total control.

ArcProgressStackView Present your progress bars in arc mode with information and total control. You can check the sample app here. Warn This library i

Devlight 1.3k Nov 29, 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
ArcProgressbar project let create Arc progressbar in android in simplest way.

Arc Progressbar In Android ArcProgressbar project let create Arc progressbar in android in simplest way. USAGE To make a Arc Progressbar add ArcProgre

Manish 40 Dec 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