All Projects → DVegasa → Arcpointer

DVegasa / Arcpointer

Licence: apache-2.0
Arc pointer - simple customized progress bar in the form of an arch

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Arcpointer

QuantityPickerView
A View capable of increasing or decreasing a unit value with a toggle animation
Stars: ✭ 42 (-44%)
Mutual labels:  android-view
Colorpicker
🎨 A color picker for Android. Pick a color using color wheel and slider (HSV & alpha).
Stars: ✭ 254 (+238.67%)
Mutual labels:  android-view
Smarttable
一款android自动生成表格框架---An Android automatically generated table framework
Stars: ✭ 4,621 (+6061.33%)
Mutual labels:  android-view
MaterialChipView
Material Chip View can be used as tags for categories, contacts or creating text clouds. Port of
Stars: ✭ 13 (-82.67%)
Mutual labels:  android-view
SignatureView
【Android View】:好用的Android电子签名板,能保存所签名的图片
Stars: ✭ 89 (+18.67%)
Mutual labels:  android-view
Android Tips
An awesome list of tips for Android.
Stars: ✭ 3,239 (+4218.67%)
Mutual labels:  android-view
Krumbsview
🍞 The ultimate breadcrumbs view for Android!
Stars: ✭ 170 (+126.67%)
Mutual labels:  android-view
Xcdanmuview
Android弹幕效果View-支持左右两个方向
Stars: ✭ 28 (-62.67%)
Mutual labels:  android-view
CustomViewCollection
Android自定义View库
Stars: ✭ 17 (-77.33%)
Mutual labels:  android-view
Edgetranslucent
Android 任意View边沿渐变透明
Stars: ✭ 461 (+514.67%)
Mutual labels:  android-view
AndroidTips
A collections of tips in Android developing.Android开发总结。我的博客:
Stars: ✭ 721 (+861.33%)
Mutual labels:  android-view
ChinaMapView
自定义View,可缩放、可平移、可点击的中国地图,有中国地图的全部省份,具备每个省份的点击接口
Stars: ✭ 1,211 (+1514.67%)
Mutual labels:  android-view
Proswipebutton
A swipe button for Android with a circular progress bar for async operations
Stars: ✭ 319 (+325.33%)
Mutual labels:  android-view
andColorPicker
Color picker library for Android
Stars: ✭ 233 (+210.67%)
Mutual labels:  android-view
Androidtips
A collections of tips in Android developing.Android开发总结。我的博客:
Stars: ✭ 713 (+850.67%)
Mutual labels:  android-view
Android library
android_library
Stars: ✭ 170 (+126.67%)
Mutual labels:  android-view
Avatar View
Avatar ImageView with user's name first letter Drawable placeholder
Stars: ✭ 309 (+312%)
Mutual labels:  android-view
Vector Analog Clock
A Simple Customizable VectorAnalogClock Android View
Stars: ✭ 73 (-2.67%)
Mutual labels:  android-view
Polygondrawingutil
A compact Android utility for constructing and drawing rounded regular polygons.
Stars: ✭ 805 (+973.33%)
Mutual labels:  android-view
Shadowhelper
A library to add shadows for the Android View.(一个方便为Android View添加自然的阴影的库)
Stars: ✭ 322 (+329.33%)
Mutual labels:  android-view

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.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].