SeekArc Library

A Simple Circular SeekArc Library

License

License

GroupId

GroupId

com.andreabaccega
ArtifactId

ArtifactId

com.triggertrap.seekarc
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

aar
Description

Description

SeekArc Library
A Simple Circular SeekArc Library
Project URL

Project URL

https://github.com/vekexasia/SeekArc
Source Code Management

Source Code Management

https://github.com/vekexasia/SeekArc

Download com.triggertrap.seekarc

How to add to project

<!-- https://jarcasting.com/artifacts/com.andreabaccega/com.triggertrap.seekarc/ -->
<dependency>
    <groupId>com.andreabaccega</groupId>
    <artifactId>com.triggertrap.seekarc</artifactId>
    <version>1.0.1</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/com.andreabaccega/com.triggertrap.seekarc/
implementation 'com.andreabaccega:com.triggertrap.seekarc:1.0.1'
// https://jarcasting.com/artifacts/com.andreabaccega/com.triggertrap.seekarc/
implementation ("com.andreabaccega:com.triggertrap.seekarc:1.0.1")
'com.andreabaccega:com.triggertrap.seekarc:aar:1.0.1'
<dependency org="com.andreabaccega" name="com.triggertrap.seekarc" rev="1.0.1">
  <artifact name="com.triggertrap.seekarc" type="aar" />
</dependency>
@Grapes(
@Grab(group='com.andreabaccega', module='com.triggertrap.seekarc', version='1.0.1')
)
libraryDependencies += "com.andreabaccega" % "com.triggertrap.seekarc" % "1.0.1"
[com.andreabaccega/com.triggertrap.seekarc "1.0.1"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

SeekArc

ATTENTION

This is a fork of the original TriggerTrap library. I created it mainly cause there were no Maven Support. I might accept pull requests and push them to central.

To include it use

  compile 'com.andreabaccega:com.triggertrap.seekarc:1.0.1'

What is a SeekArc?

So what the heck is a SeekArc? Essentially it’s a SeekBar that has been wrapped around a circle. It acts like a SeekBar and generally has the same settings. You can even add a Listener to it as you would with a SeekBar. So if its in a circle why not call it a SeekCircle? The answer is that the SeekArc does have a few more setting than the SeekBar one of these is the sweepAngle, which means that the SeekArc doesn’t have to be drawn as a full circle, and can be drawn as a circle, semi-circle or quarter arc or whatever you like.

Sample Project

You can see the SeekArc working in the sample application. Just check out the library and sample application as two separate projects and import them into eclipse. Make sure that the Sample app is setup to correctly use the library project. The sample app will let you explore the attributes that can be set on the SeekArc

Using the SeekArc

Using the SeekArc is straightforward. There are a number of settings from sweep angle to rotation that can be set. One of the less obvious settings is the radius or diameter of the SeekArc. When I developed the SeekArc I thought about adding an attribute for defining the diameter of the circle. In the end I decided against this. I thought a more flexible approach would be to allow the SeekArc to expand to the size of its container layout. This way the SeekArc can grow in size with a layout that has widths or heights of match parent. Also it is still possible to set the SeekArc to a specific size by setting the container layouts width and height to specific dp values. This sizing approach gives the best of both worlds. To further adjust how the arc fits in its container a padding attribute can also be used.

To help with understanding how to use the SeeekArc I’ve put together a sample app with a number of controls that can be used to adjust the attributes of the SeekArc. This is by far the best way to get a good understanding of how to use the SeekArc. From the sample app you’ll see that it is possible to set attributes such as:

Sweep angle, Rotation, Clockwise, (which way do you want the progress to increase clockwise/anticlockwise), Arc and progress width, Rounded corners and Touch inside enable/disable.

To use it in your code

Simply add the View to your Layout

    <com.triggertrap.seekarc.SeekArc
        android:id="@+id/seekArc"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:padding="30dp"
        seekarc:rotation="180"
        seekarc:startAngle="30"
        seekarc:sweepAngle="300"
        seekarc:touchInside="true" />

License


The MIT License (MIT)

Copyright (c) 2013 Triggertrap Ltd
Author Neil Davies 

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Versions

Version
1.0.1
1.0.0