bozapro / circular-slider-range

A circular slider range for Android.
Apache License 2.0
19 stars 6 forks source link

Circular Slider Range

Download

What is this?

Circular Slider Range is a small Android library used for slider range. It works similarly to the regular slider control (SeekBar), just goes around in a circular fashion and provider possibility of start and end positions.

Note: that the start/stop thumbs scroller (the thing you drag around) can be either a solid-color circle or a custom drawable (like a PNG image).

Motivation to write this library i got from CircularSlider library, which is used as starting point.

Requirements

Getting Started

This will run the app on your device. You may need to download a newer version of Gradle, which will be available in the Android Studio UI if compile fails.

What does it look like?

screenshot_1

Sample usage

...
<com.bozapro.circularsliderrange.CircularSliderRange
    android:id="@+id/circular"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:padding="30dp"
    range:arc_color="@color/colorAccent"
    range:arc_dash_size="20dp"
    range:border_color="#505090"
    range:border_thickness="14dp"
    range:end_angle="30"
    range:end_thumb_image="@drawable/circle_shape"
    range:start_angle="120"
    range:start_thumb_color="#30AEFF"
    range:start_thumb_size="60dp"
    range:thumb_size="50dp" />
...

Explanation of attributes

Here are some short explanations for the attributes provided by the view. You can leave out any of them, values will get set to default ones.

Note that thumb color and thumb image are mutually exclusive, you can't use both.

Support

If you've found an error while using the library, please file an issue.