https://github.com/harjot-oberai/croller
A circular seekbar for Android, with a control knob! (for the lack of a better word).
https://github.com/harjot-oberai/croller
andorid circular custom-view seekbar
Last synced: 5 months ago
JSON representation
A circular seekbar for Android, with a control knob! (for the lack of a better word).
- Host: GitHub
- URL: https://github.com/harjot-oberai/croller
- Owner: harjot-oberai
- License: mit
- Created: 2016-07-30T20:01:56.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2020-06-13T10:18:01.000Z (over 5 years ago)
- Last Synced: 2024-10-11T00:54:12.152Z (about 1 year ago)
- Topics: andorid, circular, custom-view, seekbar
- Language: Java
- Homepage:
- Size: 3.71 MB
- Stars: 1,230
- Watchers: 32
- Forks: 165
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
[](https://www.android.com)
[](https://android-arsenal.com/api?level=16)
[](https://opensource.org/licenses/MIT)# Usage
Just add the following dependency in your app's `build.gradle`
```groovy
dependencies {
compile 'com.sdsmdg.harjot:croller:1.0.7'
}
```### XML
```xml```
### Java
```java
Croller croller = (Croller) findViewById(R.id.croller);
croller.setIndicatorWidth(10);
croller.setBackCircleColor(Color.parseColor("#EDEDED"));
croller.setMainCircleColor(Color.WHITE);
croller.setMax(50);
croller.setStartOffset(45);
croller.setIsContinuous(false);
croller.setLabelColor(Color.BLACK);
croller.setProgressPrimaryColor(Color.parseColor("#0B3C49"));
croller.setIndicatorColor(Color.parseColor("#0B3C49"));
croller.setProgressSecondaryColor(Color.parseColor("#EEEEEE"));
```
### Listeners#### Progress Change Listener (if you only want to use the progress)
```java
Croller croller = (Croller) findViewById(R.id.croller);
croller.setOnProgressChangedListener(new Croller.onProgressChangedListener() {
@Override
public void onProgressChanged(int progress) {
// use the progress
}
});
```#### Croller Change Listener (if want start and stop tracking as well, similar to seekbar)
```java
Croller croller.setOnCrollerChangeListener(new OnCrollerChangeListener() {
@Override
public void onProgressChanged(Croller croller, int progress) {
// use the progress
}@Override
public void onStartTrackingTouch(Croller croller) {
// tracking started
}@Override
public void onStopTrackingTouch(Croller croller) {
// tracking stopped
}
});
```# Attributes
XML Attribute | Java set method | Functionality
------------ | ------------- | -------------
anticlockwise | setAntiClockwise(boolean anticlockwise) | Set the direction of rotation
progress | setProgress(int progress) | Set the current progress of the seekbar
label | setLabel(String str) | Set the label
label_size | setLabelSize(int size) | Set the label size
label_color | setLabelColor(int color) | Set the label color
is_continuous | setIsContinuous(boolean bool) | Set whether seekbar is conitnuous or discrete
max | setMax(int max) | Set the maximum value of the seekbar
min | setMin(int min) | Set the minimum value of the seekbar (Default is **1**)
start_offset | setStartOffset(int offset) | Set the seekbar start offset angle from bottom horizontal center
sweep_angle | setSweepAngle(int angle) | Set the total angle covered by the seekbar
progress_primary_stroke_width | setProgressPrimaryStrokeWidth(float width) | Set the primary progress thickness for continuous type
progress_secondary_stroke_width | setProgressSecondaryStrokeWidth(float width) | Set the secondary progress thickness for continuous type
progress_primary_circle_size | setProgressPrimaryCircleSize(float size) | Set the primary progress circle size for discrete type
progress_secondary_circle_size | setProgressSecondaryCircleSize(float size) | Set the secondary progress circle size for discrete type
indicator_width | setIndicatorWidth(float width) | Set the progress indicator width
indicator_color | setIndicatorColor(int color) | Set the progress indicator color
progress_primary_color | setProgressPrimaryColor(int color) | Set the progress primary(active) color
progress_secondary_color | setProgressSecondaryColor(int color) | Set the progress secondary(inactive) color
progress_radius | setProgressRadius(float radius) | Set the radius of the progress arc
main_circle_radius | setMainCircleRadius(float radius) | Set the main(front) circle radius
back_circle_radius | setBackCircleRadius(float radius) | Set the back circle radius
main_circle_color | setMainCircleColor(int color) | Set the main(front) circle color
back_circle_color | setBackCircleColor(int color) | Set the back circle color# Examples
### ```is_continuous = false```
![]()
### ```is_continuous = true```
![]()
# License
Croller is licensed under `MIT license`. View [license](LICENSE.md).