├── .gitignore
├── LICENSE.md
├── README.md
├── app
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── sdsmdg
│ │ └── harjot
│ │ └── crollerTest
│ │ └── ApplicationTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── assets
│ │ └── fonts
│ │ │ ├── Pattaya-Regular.ttf
│ │ │ └── sans_bold.ttf
│ ├── java
│ │ └── com
│ │ │ └── sdsmdg
│ │ │ └── harjot
│ │ │ └── crollerTest
│ │ │ └── MainActivity.java
│ └── res
│ │ ├── layout
│ │ └── activity_main.xml
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxxhdpi
│ │ └── ic_launcher.png
│ │ ├── values-w820dp
│ │ └── dimens.xml
│ │ └── values
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── sdsmdg
│ └── harjot
│ └── crollerTest
│ └── ExampleUnitTest.java
├── build.gradle
├── croller.apk
├── croller
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── sdsmdg
│ │ └── harjot
│ │ └── crollerTest
│ │ └── ApplicationTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── sdsmdg
│ │ │ └── harjot
│ │ │ └── crollerTest
│ │ │ ├── Croller.java
│ │ │ ├── OnCrollerChangeListener.java
│ │ │ └── utilities
│ │ │ └── Utils.java
│ └── res
│ │ ├── layout
│ │ └── croller_view.xml
│ │ └── values
│ │ ├── attrs.xml
│ │ └── strings.xml
│ └── test
│ └── java
│ └── com
│ └── sdsmdg
│ └── harjot
│ └── croller
│ └── ExampleUnitTest.java
├── gifs
├── croller_1.gif
└── croller_2.gif
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── screens
├── croller_attributes.png
├── croller_cover.png
└── croller_example.png
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | ### Android ###
3 | # Built application files
4 | *.apk
5 | *.ap_
6 |
7 | # Files for the ART/Dalvik VM
8 | *.dex
9 |
10 | # Java class files
11 | *.class
12 |
13 | # Generated files
14 | bin/
15 | gen/
16 | out/
17 |
18 | # Gradle files
19 | .gradle/
20 | build/
21 |
22 | # Local configuration file (sdk path, etc)
23 | local.properties
24 |
25 | # Proguard folder generated by Eclipse
26 | proguard/
27 |
28 | # Log Files
29 | *.log
30 |
31 | # Android Studio Navigation editor temp files
32 | .navigation/
33 |
34 | # Android Studio captures folder
35 | captures/
36 |
37 | # Intellij
38 | *.iml
39 | .idea/
40 |
41 | # Keystore files
42 | *.jks
43 |
44 | # External native build folder generated in Android Studio 2.2 and later
45 | .externalNativeBuild
46 |
47 | # Google Services (e.g. APIs or Firebase)
48 | google-services.json
49 |
50 | ### Android Patch ###
51 | gen-external-apklibs
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | Copyright 2016-17 Harjot Singh Oberai
2 |
3 | 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:
4 |
5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6 |
7 | 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.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 
2 | [](https://www.android.com)
3 | [](https://android-arsenal.com/api?level=16)
4 | [](https://opensource.org/licenses/MIT)
5 |
6 | # Usage
7 | Just add the following dependency in your app's `build.gradle`
8 | ```groovy
9 | dependencies {
10 | compile 'com.sdsmdg.harjot:croller:1.0.7'
11 | }
12 | ```
13 |
14 | ### XML
15 | ```xml
16 |
31 | ```
32 |
33 | ### Java
34 | ```java
35 | Croller croller = (Croller) findViewById(R.id.croller);
36 | croller.setIndicatorWidth(10);
37 | croller.setBackCircleColor(Color.parseColor("#EDEDED"));
38 | croller.setMainCircleColor(Color.WHITE);
39 | croller.setMax(50);
40 | croller.setStartOffset(45);
41 | croller.setIsContinuous(false);
42 | croller.setLabelColor(Color.BLACK);
43 | croller.setProgressPrimaryColor(Color.parseColor("#0B3C49"));
44 | croller.setIndicatorColor(Color.parseColor("#0B3C49"));
45 | croller.setProgressSecondaryColor(Color.parseColor("#EEEEEE"));
46 | ```
47 | ### Listeners
48 |
49 | #### Progress Change Listener (if you only want to use the progress)
50 | ```java
51 | Croller croller = (Croller) findViewById(R.id.croller);
52 | croller.setOnProgressChangedListener(new Croller.onProgressChangedListener() {
53 | @Override
54 | public void onProgressChanged(int progress) {
55 | // use the progress
56 | }
57 | });
58 | ```
59 |
60 | #### Croller Change Listener (if want start and stop tracking as well, similar to seekbar)
61 | ```java
62 | Croller croller.setOnCrollerChangeListener(new OnCrollerChangeListener() {
63 | @Override
64 | public void onProgressChanged(Croller croller, int progress) {
65 | // use the progress
66 | }
67 |
68 | @Override
69 | public void onStartTrackingTouch(Croller croller) {
70 | // tracking started
71 | }
72 |
73 | @Override
74 | public void onStopTrackingTouch(Croller croller) {
75 | // tracking stopped
76 | }
77 | });
78 | ```
79 |
80 | # Attributes
81 |
82 | 
83 |
84 | XML Attribute | Java set method | Functionality
85 | ------------ | ------------- | -------------
86 | anticlockwise | setAntiClockwise(boolean anticlockwise) | Set the direction of rotation
87 | progress | setProgress(int progress) | Set the current progress of the seekbar
88 | label | setLabel(String str) | Set the label
89 | label_size | setLabelSize(int size) | Set the label size
90 | label_color | setLabelColor(int color) | Set the label color
91 | is_continuous | setIsContinuous(boolean bool) | Set whether seekbar is conitnuous or discrete
92 | max | setMax(int max) | Set the maximum value of the seekbar
93 | min | setMin(int min) | Set the minimum value of the seekbar (Default is **1**)
94 | start_offset | setStartOffset(int offset) | Set the seekbar start offset angle from bottom horizontal center
95 | sweep_angle | setSweepAngle(int angle) | Set the total angle covered by the seekbar
96 | progress_primary_stroke_width | setProgressPrimaryStrokeWidth(float width) | Set the primary progress thickness for continuous type
97 | progress_secondary_stroke_width | setProgressSecondaryStrokeWidth(float width) | Set the secondary progress thickness for continuous type
98 | progress_primary_circle_size | setProgressPrimaryCircleSize(float size) | Set the primary progress circle size for discrete type
99 | progress_secondary_circle_size | setProgressSecondaryCircleSize(float size) | Set the secondary progress circle size for discrete type
100 | indicator_width | setIndicatorWidth(float width) | Set the progress indicator width
101 | indicator_color | setIndicatorColor(int color) | Set the progress indicator color
102 | progress_primary_color | setProgressPrimaryColor(int color) | Set the progress primary(active) color
103 | progress_secondary_color | setProgressSecondaryColor(int color) | Set the progress secondary(inactive) color
104 | progress_radius | setProgressRadius(float radius) | Set the radius of the progress arc
105 | main_circle_radius | setMainCircleRadius(float radius) | Set the main(front) circle radius
106 | back_circle_radius | setBackCircleRadius(float radius) | Set the back circle radius
107 | main_circle_color | setMainCircleColor(int color) | Set the main(front) circle color
108 | back_circle_color | setBackCircleColor(int color) | Set the back circle color
109 |
110 | # Examples
111 |
112 |
113 | ### ```is_continuous = false```
114 |
115 |
116 |
117 |
118 | ### ```is_continuous = true```
119 |
120 |
121 |
122 |
123 | # License
124 | Croller is licensed under `MIT license`. View [license](LICENSE.md).
125 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 27
5 | buildToolsVersion '28.0.3'
6 |
7 | defaultConfig {
8 | applicationId "com.sdsmdg.harjot.croller"
9 | minSdkVersion 16
10 | targetSdkVersion 27
11 | versionCode 1
12 | versionName "1.0"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | implementation fileTree(dir: 'libs', include: ['*.jar'])
24 | testImplementation 'junit:junit:4.12'
25 | implementation 'com.android.support:appcompat-v7:27.1.1'
26 | implementation project(':croller')
27 | }
28 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in C:\Users\Harjot\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/sdsmdg/harjot/crollerTest/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.sdsmdg.harjot.crollerTest;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
11 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/assets/fonts/Pattaya-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/harjot-oberai/Croller/88b84e3cf17971fa9921998f853395f2025adcda/app/src/main/assets/fonts/Pattaya-Regular.ttf
--------------------------------------------------------------------------------
/app/src/main/assets/fonts/sans_bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/harjot-oberai/Croller/88b84e3cf17971fa9921998f853395f2025adcda/app/src/main/assets/fonts/sans_bold.ttf
--------------------------------------------------------------------------------
/app/src/main/java/com/sdsmdg/harjot/crollerTest/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.sdsmdg.harjot.crollerTest;
2 |
3 | import android.os.Bundle;
4 | import android.support.v7.app.AppCompatActivity;
5 | import android.support.v7.widget.SwitchCompat;
6 | import android.widget.CompoundButton;
7 | import android.widget.Toast;
8 |
9 | public class MainActivity extends AppCompatActivity {
10 |
11 | private Croller croller;
12 |
13 | @Override
14 | protected void onCreate(Bundle savedInstanceState) {
15 | super.onCreate(savedInstanceState);
16 | setContentView(R.layout.activity_main);
17 |
18 | croller = findViewById(R.id.croller);
19 | SwitchCompat enableSwitch = findViewById(R.id.enableSwitch);
20 |
21 | enableSwitch.setChecked(croller.isEnabled());
22 |
23 | // croller.setIndicatorWidth(10);
24 | // croller.setBackCircleColor(Color.parseColor("#EDEDED"));
25 | // croller.setMainCircleColor(Color.WHITE);
26 | // croller.setMax(50);
27 | // croller.setStartOffset(45);
28 | // croller.setIsContinuous(false);
29 | // croller.setLabelColor(Color.BLACK);
30 | // croller.setProgressPrimaryColor(Color.parseColor("#0B3C49"));
31 | // croller.setIndicatorColor(Color.parseColor("#0B3C49"));
32 | // croller.setProgressSecondaryColor(Color.parseColor("#EEEEEE"));
33 | // croller.setProgressRadius(380);
34 | // croller.setBackCircleRadius(300);
35 |
36 |
37 | croller.setOnCrollerChangeListener(new OnCrollerChangeListener() {
38 | @Override
39 | public void onProgressChanged(Croller croller, int progress) {
40 |
41 | }
42 |
43 | @Override
44 | public void onStartTrackingTouch(Croller croller) {
45 | Toast.makeText(MainActivity.this, "Start", Toast.LENGTH_SHORT).show();
46 | }
47 |
48 | @Override
49 | public void onStopTrackingTouch(Croller croller) {
50 | Toast.makeText(MainActivity.this, "Stop", Toast.LENGTH_SHORT).show();
51 | }
52 | });
53 |
54 | enableSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
55 | @Override
56 | public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
57 | if (b) {
58 | croller.setEnabled(true);
59 | } else {
60 | croller.setEnabled(false);
61 | }
62 | }
63 | });
64 |
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
31 |
32 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/harjot-oberai/Croller/88b84e3cf17971fa9921998f853395f2025adcda/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/harjot-oberai/Croller/88b84e3cf17971fa9921998f853395f2025adcda/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/harjot-oberai/Croller/88b84e3cf17971fa9921998f853395f2025adcda/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/harjot-oberai/Croller/88b84e3cf17971fa9921998f853395f2025adcda/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/harjot-oberai/Croller/88b84e3cf17971fa9921998f853395f2025adcda/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Croller
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/test/java/com/sdsmdg/harjot/crollerTest/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.sdsmdg.harjot.crollerTest;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * To work on unit tests, switch the Test Artifact in the Build Variants view.
9 | */
10 | public class ExampleUnitTest {
11 | @Test
12 | public void addition_isCorrect() throws Exception {
13 | assertEquals(4, 2 + 2);
14 | }
15 | }
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | google()
7 | }
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:3.2.1'
10 | classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
11 | classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
12 | // NOTE: Do not place your application dependencies here; they belong
13 | // in the individual module build.gradle files
14 | }
15 | }
16 |
17 | allprojects {
18 | repositories {
19 | jcenter()
20 | google()
21 | }
22 |
23 | }
24 |
25 | task clean(type: Delete) {
26 | delete rootProject.buildDir
27 | }
--------------------------------------------------------------------------------
/croller.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/harjot-oberai/Croller/88b84e3cf17971fa9921998f853395f2025adcda/croller.apk
--------------------------------------------------------------------------------
/croller/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/croller/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | ext {
4 | bintrayRepo = 'Croller'
5 | bintrayName = 'croller'
6 |
7 | publishedGroupId = 'com.sdsmdg.harjot'
8 | libraryName = 'Croller'
9 | artifact = 'croller'
10 |
11 | libraryDescription = 'A circular seekbar for Android, with a control knob! (for the lack of a better word).'
12 |
13 | siteUrl = 'https://github.com/harjot-oberai/Croller'
14 | gitUrl = 'https://github.com/harjot-oberai/Croller.git'
15 |
16 | libraryVersion = '1.0.7'
17 |
18 | developerId = 'harjot-oberai'
19 | developerName = 'Harjot Singh Oberai'
20 | developerEmail = 'harjot.oberai@gmail.com'
21 |
22 | licenseName = 'The Apache Software License, Version 2.0'
23 | licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
24 | allLicenses = ["Apache-2.0"]
25 | }
26 |
27 | version = '1.0.1'
28 |
29 | android {
30 | compileSdkVersion 27
31 | buildToolsVersion '28.0.3'
32 |
33 | defaultConfig {
34 | minSdkVersion 16
35 | targetSdkVersion 27
36 | versionCode 1
37 | versionName "1.0"
38 | }
39 | buildTypes {
40 | release {
41 | minifyEnabled false
42 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
43 | }
44 | }
45 | }
46 |
47 | dependencies {
48 | implementation fileTree(dir: 'libs', include: ['*.jar'])
49 | testImplementation 'junit:junit:4.12'
50 | implementation 'com.android.support:appcompat-v7:27.1.1'
51 | }
52 |
53 | //apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle'
54 | //apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle'
--------------------------------------------------------------------------------
/croller/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in C:\Users\Harjot\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/croller/src/androidTest/java/com/sdsmdg/harjot/crollerTest/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.sdsmdg.harjot.crollerTest;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/croller/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/croller/src/main/java/com/sdsmdg/harjot/crollerTest/Croller.java:
--------------------------------------------------------------------------------
1 | package com.sdsmdg.harjot.crollerTest;
2 |
3 | import android.content.Context;
4 | import android.content.res.AssetManager;
5 | import android.content.res.TypedArray;
6 | import android.graphics.Canvas;
7 | import android.graphics.Color;
8 | import android.graphics.Paint;
9 | import android.graphics.RectF;
10 | import android.graphics.Typeface;
11 | import android.util.AttributeSet;
12 | import android.util.TypedValue;
13 | import android.view.MotionEvent;
14 | import android.view.View;
15 |
16 | import com.sdsmdg.harjot.croller.R;
17 | import com.sdsmdg.harjot.crollerTest.utilities.Utils;
18 |
19 | public class Croller extends View {
20 |
21 | private float midx, midy;
22 | private Paint textPaint, circlePaint, circlePaint2, linePaint;
23 | private float currdeg = 0, deg = 3, downdeg = 0;
24 |
25 | private boolean isContinuous = false;
26 |
27 | private int backCircleColor = Color.parseColor("#222222");
28 | private int mainCircleColor = Color.parseColor("#000000");
29 | private int indicatorColor = Color.parseColor("#FFA036");
30 | private int progressPrimaryColor = Color.parseColor("#FFA036");
31 | private int progressSecondaryColor = Color.parseColor("#111111");
32 |
33 | private int backCircleDisabledColor = Color.parseColor("#82222222");
34 | private int mainCircleDisabledColor = Color.parseColor("#82000000");
35 | private int indicatorDisabledColor = Color.parseColor("#82FFA036");
36 | private int progressPrimaryDisabledColor = Color.parseColor("#82FFA036");
37 | private int progressSecondaryDisabledColor = Color.parseColor("#82111111");
38 |
39 | private float progressPrimaryCircleSize = -1;
40 | private float progressSecondaryCircleSize = -1;
41 |
42 | private float progressPrimaryStrokeWidth = 25;
43 | private float progressSecondaryStrokeWidth = 10;
44 |
45 | private float mainCircleRadius = -1;
46 | private float backCircleRadius = -1;
47 | private float progressRadius = -1;
48 |
49 | private int max = 25;
50 | private int min = 1;
51 |
52 | private float indicatorWidth = 7;
53 |
54 | private String label = "Label";
55 | private String labelFont;
56 | private int labelStyle = 0;
57 | private float labelSize = 14;
58 | private int labelColor = Color.WHITE;
59 |
60 | private int labelDisabledColor = Color.BLACK;
61 |
62 | private int startOffset = 30;
63 | private int startOffset2 = 0;
64 | private int sweepAngle = -1;
65 |
66 | private boolean isEnabled = true;
67 |
68 | private boolean isAntiClockwise = false;
69 |
70 | private boolean startEventSent = false;
71 |
72 | RectF oval;
73 |
74 | private onProgressChangedListener mProgressChangeListener;
75 | private OnCrollerChangeListener mCrollerChangeListener;
76 |
77 | public interface onProgressChangedListener {
78 | void onProgressChanged(int progress);
79 | }
80 |
81 | public void setOnProgressChangedListener(onProgressChangedListener mProgressChangeListener) {
82 | this.mProgressChangeListener = mProgressChangeListener;
83 | }
84 |
85 | public void setOnCrollerChangeListener(OnCrollerChangeListener mCrollerChangeListener) {
86 | this.mCrollerChangeListener = mCrollerChangeListener;
87 | }
88 |
89 | public Croller(Context context) {
90 | super(context);
91 | init();
92 | }
93 |
94 | public Croller(Context context, AttributeSet attrs) {
95 | super(context, attrs);
96 | initXMLAttrs(context, attrs);
97 | init();
98 | }
99 |
100 | public Croller(Context context, AttributeSet attrs, int defStyleAttr) {
101 | super(context, attrs, defStyleAttr);
102 | initXMLAttrs(context, attrs);
103 | init();
104 | }
105 |
106 | private void init() {
107 |
108 | textPaint = new Paint();
109 | textPaint.setAntiAlias(true);
110 | textPaint.setStyle(Paint.Style.FILL);
111 | textPaint.setFakeBoldText(true);
112 | textPaint.setTextAlign(Paint.Align.CENTER);
113 | textPaint.setTextSize(labelSize);
114 |
115 | generateTypeface();
116 |
117 | circlePaint = new Paint();
118 | circlePaint.setAntiAlias(true);
119 | circlePaint.setStrokeWidth(progressSecondaryStrokeWidth);
120 | circlePaint.setStyle(Paint.Style.FILL);
121 |
122 | circlePaint2 = new Paint();
123 | circlePaint2.setAntiAlias(true);
124 | circlePaint2.setStrokeWidth(progressPrimaryStrokeWidth);
125 | circlePaint2.setStyle(Paint.Style.FILL);
126 |
127 | linePaint = new Paint();
128 | linePaint.setAntiAlias(true);
129 | linePaint.setStrokeWidth(indicatorWidth);
130 |
131 | if (isEnabled) {
132 | circlePaint2.setColor(progressPrimaryColor);
133 | circlePaint.setColor(progressSecondaryColor);
134 | linePaint.setColor(indicatorColor);
135 | textPaint.setColor(labelColor);
136 | } else {
137 | circlePaint2.setColor(progressPrimaryDisabledColor);
138 | circlePaint.setColor(progressSecondaryDisabledColor);
139 | linePaint.setColor(indicatorDisabledColor);
140 | textPaint.setColor(labelDisabledColor);
141 | }
142 |
143 | oval = new RectF();
144 |
145 | }
146 |
147 | private void generateTypeface() {
148 | Typeface plainLabel = Typeface.DEFAULT;
149 | if (getLabelFont() != null && !getLabelFont().isEmpty()) {
150 | AssetManager assetMgr = getContext().getAssets();
151 | plainLabel = Typeface.createFromAsset(assetMgr, getLabelFont());
152 | }
153 |
154 | switch (getLabelStyle()) {
155 | case 0:
156 | textPaint.setTypeface(plainLabel);
157 | break;
158 | case 1:
159 | textPaint.setTypeface(Typeface.create(plainLabel, Typeface.BOLD));
160 | break;
161 | case 2:
162 | textPaint.setTypeface(Typeface.create(plainLabel, Typeface.ITALIC));
163 | break;
164 | case 3:
165 | textPaint.setTypeface(Typeface.create(plainLabel, Typeface.BOLD_ITALIC));
166 | break;
167 |
168 | }
169 |
170 | }
171 |
172 | private void initXMLAttrs(Context context, AttributeSet attrs) {
173 | TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.Croller);
174 |
175 | setEnabled(a.getBoolean(R.styleable.Croller_enabled, true));
176 | setProgress(a.getInt(R.styleable.Croller_start_progress, 1));
177 | setLabel(a.getString(R.styleable.Croller_label));
178 |
179 | setBackCircleColor(a.getColor(R.styleable.Croller_back_circle_color, backCircleColor));
180 | setMainCircleColor(a.getColor(R.styleable.Croller_main_circle_color, mainCircleColor));
181 | setIndicatorColor(a.getColor(R.styleable.Croller_indicator_color, indicatorColor));
182 | setProgressPrimaryColor(a.getColor(R.styleable.Croller_progress_primary_color, progressPrimaryColor));
183 | setProgressSecondaryColor(a.getColor(R.styleable.Croller_progress_secondary_color, progressSecondaryColor));
184 |
185 | setBackCircleDisabledColor(a.getColor(R.styleable.Croller_back_circle_disable_color, backCircleDisabledColor));
186 | setMainCircleDisabledColor(a.getColor(R.styleable.Croller_main_circle_disable_color, mainCircleDisabledColor));
187 | setIndicatorDisabledColor(a.getColor(R.styleable.Croller_indicator_disable_color, indicatorDisabledColor));
188 | setProgressPrimaryDisabledColor(a.getColor(R.styleable.Croller_progress_primary_disable_color, progressPrimaryDisabledColor));
189 | setProgressSecondaryDisabledColor(a.getColor(R.styleable.Croller_progress_secondary_disable_color, progressSecondaryDisabledColor));
190 |
191 | setLabelSize(a.getDimension(R.styleable.Croller_label_size, (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
192 | labelSize, getResources().getDisplayMetrics())));
193 | setLabelColor(a.getColor(R.styleable.Croller_label_color, labelColor));
194 | setlabelDisabledColor(a.getColor(R.styleable.Croller_label_disabled_color, labelDisabledColor));
195 | setLabelFont(a.getString(R.styleable.Croller_label_font));
196 | setLabelStyle(a.getInt(R.styleable.Croller_label_style, 0));
197 | setIndicatorWidth(a.getFloat(R.styleable.Croller_indicator_width, 7));
198 | setIsContinuous(a.getBoolean(R.styleable.Croller_is_continuous, false));
199 | setProgressPrimaryCircleSize(a.getFloat(R.styleable.Croller_progress_primary_circle_size, -1));
200 | setProgressSecondaryCircleSize(a.getFloat(R.styleable.Croller_progress_secondary_circle_size, -1));
201 | setProgressPrimaryStrokeWidth(a.getFloat(R.styleable.Croller_progress_primary_stroke_width, 25));
202 | setProgressSecondaryStrokeWidth(a.getFloat(R.styleable.Croller_progress_secondary_stroke_width, 10));
203 | setSweepAngle(a.getInt(R.styleable.Croller_sweep_angle, -1));
204 | setStartOffset(a.getInt(R.styleable.Croller_start_offset, 30));
205 | setMax(a.getInt(R.styleable.Croller_max, 25));
206 | setMin(a.getInt(R.styleable.Croller_min, 1));
207 | deg = min + 2;
208 | setBackCircleRadius(a.getFloat(R.styleable.Croller_back_circle_radius, -1));
209 | setProgressRadius(a.getFloat(R.styleable.Croller_progress_radius, -1));
210 | setAntiClockwise(a.getBoolean(R.styleable.Croller_anticlockwise, false));
211 | a.recycle();
212 | }
213 |
214 | @Override
215 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
216 | super.onMeasure(widthMeasureSpec, heightMeasureSpec);
217 | int minWidth = (int) Utils.convertDpToPixel(160, getContext());
218 | int minHeight = (int) Utils.convertDpToPixel(160, getContext());
219 |
220 | int widthMode = MeasureSpec.getMode(widthMeasureSpec);
221 | int widthSize = MeasureSpec.getSize(widthMeasureSpec);
222 | int heightMode = MeasureSpec.getMode(heightMeasureSpec);
223 | int heightSize = MeasureSpec.getSize(heightMeasureSpec);
224 |
225 | int width;
226 | int height;
227 |
228 | if (widthMode == MeasureSpec.EXACTLY) {
229 | width = widthSize;
230 | } else if (widthMode == MeasureSpec.AT_MOST) {
231 | width = Math.min(minWidth, widthSize);
232 | } else {
233 | // only in case of ScrollViews, otherwise MeasureSpec.UNSPECIFIED is never triggered
234 | // If width is wrap_content i.e. MeasureSpec.UNSPECIFIED, then make width equal to height
235 | width = heightSize;
236 | }
237 |
238 | if (heightMode == MeasureSpec.EXACTLY) {
239 | height = heightSize;
240 | } else if (heightMode == MeasureSpec.AT_MOST) {
241 | height = Math.min(minHeight, heightSize);
242 | } else {
243 | // only in case of ScrollViews, otherwise MeasureSpec.UNSPECIFIED is never triggered
244 | // If height is wrap_content i.e. MeasureSpec.UNSPECIFIED, then make height equal to width
245 | height = widthSize;
246 | }
247 |
248 | if (widthMode == MeasureSpec.UNSPECIFIED && heightMode == MeasureSpec.UNSPECIFIED) {
249 | width = minWidth;
250 | height = minHeight;
251 | }
252 |
253 | setMeasuredDimension(width, height);
254 | }
255 |
256 | @Override
257 | protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
258 | super.onLayout(changed, left, top, right, bottom);
259 |
260 | midx = getWidth() / 2;
261 | midy = getHeight() / 2;
262 | }
263 |
264 | @Override
265 | protected void onDraw(Canvas canvas) {
266 | super.onDraw(canvas);
267 |
268 | if (mProgressChangeListener != null)
269 | mProgressChangeListener.onProgressChanged((int) (deg - 2));
270 |
271 | if (mCrollerChangeListener != null)
272 | mCrollerChangeListener.onProgressChanged(this, (int) (deg - 2));
273 |
274 | if (isEnabled) {
275 | circlePaint2.setColor(progressPrimaryColor);
276 | circlePaint.setColor(progressSecondaryColor);
277 | linePaint.setColor(indicatorColor);
278 | textPaint.setColor(labelColor);
279 | } else {
280 | circlePaint2.setColor(progressPrimaryDisabledColor);
281 | circlePaint.setColor(progressSecondaryDisabledColor);
282 | linePaint.setColor(indicatorDisabledColor);
283 | textPaint.setColor(labelDisabledColor);
284 | }
285 |
286 | if (!isContinuous) {
287 |
288 | startOffset2 = startOffset - 15;
289 |
290 | linePaint.setStrokeWidth(indicatorWidth);
291 | textPaint.setTextSize(labelSize);
292 |
293 | int radius = (int) (Math.min(midx, midy) * ((float) 14.5 / 16));
294 |
295 | if (sweepAngle == -1) {
296 | sweepAngle = 360 - (2 * startOffset2);
297 | }
298 |
299 | if (mainCircleRadius == -1) {
300 | mainCircleRadius = radius * ((float) 11 / 15);
301 | }
302 | if (backCircleRadius == -1) {
303 | backCircleRadius = radius * ((float) 13 / 15);
304 | }
305 | if (progressRadius == -1) {
306 | progressRadius = radius;
307 | }
308 |
309 | float x, y;
310 | float deg2 = Math.max(3, deg);
311 | float deg3 = Math.min(deg, max + 2);
312 | for (int i = (int) (deg2); i < max + 3; i++) {
313 | float tmp = ((float) startOffset2 / 360) + ((float) sweepAngle / 360) * (float) i / (max + 5);
314 |
315 | if (isAntiClockwise) {
316 | tmp = 1.0f - tmp;
317 | }
318 |
319 | x = midx + (float) (progressRadius * Math.sin(2 * Math.PI * (1.0 - tmp)));
320 | y = midy + (float) (progressRadius * Math.cos(2 * Math.PI * (1.0 - tmp)));
321 | if (progressSecondaryCircleSize == -1)
322 | canvas.drawCircle(x, y, ((float) radius / 30 * ((float) 20 / max) * ((float) sweepAngle / 270)), circlePaint);
323 | else
324 | canvas.drawCircle(x, y, progressSecondaryCircleSize, circlePaint);
325 | }
326 | for (int i = 3; i <= deg3; i++) {
327 | float tmp = ((float) startOffset2 / 360) + ((float) sweepAngle / 360) * (float) i / (max + 5);
328 |
329 | if (isAntiClockwise) {
330 | tmp = 1.0f - tmp;
331 | }
332 |
333 | x = midx + (float) (progressRadius * Math.sin(2 * Math.PI * (1.0 - tmp)));
334 | y = midy + (float) (progressRadius * Math.cos(2 * Math.PI * (1.0 - tmp)));
335 | if (progressPrimaryCircleSize == -1)
336 | canvas.drawCircle(x, y, (progressRadius / 15 * ((float) 20 / max) * ((float) sweepAngle / 270)), circlePaint2);
337 | else
338 | canvas.drawCircle(x, y, progressPrimaryCircleSize, circlePaint2);
339 | }
340 |
341 | float tmp2 = ((float) startOffset2 / 360) + ((float) sweepAngle / 360) * deg / (max + 5);
342 |
343 | if (isAntiClockwise) {
344 | tmp2 = 1.0f - tmp2;
345 | }
346 |
347 | float x1 = midx + (float) (radius * ((float) 2 / 5) * Math.sin(2 * Math.PI * (1.0 - tmp2)));
348 | float y1 = midy + (float) (radius * ((float) 2 / 5) * Math.cos(2 * Math.PI * (1.0 - tmp2)));
349 | float x2 = midx + (float) (radius * ((float) 3 / 5) * Math.sin(2 * Math.PI * (1.0 - tmp2)));
350 | float y2 = midy + (float) (radius * ((float) 3 / 5) * Math.cos(2 * Math.PI * (1.0 - tmp2)));
351 |
352 | if (isEnabled)
353 | circlePaint.setColor(backCircleColor);
354 | else
355 | circlePaint.setColor(backCircleDisabledColor);
356 | canvas.drawCircle(midx, midy, backCircleRadius, circlePaint);
357 | if (isEnabled)
358 | circlePaint.setColor(mainCircleColor);
359 | else
360 | circlePaint.setColor(mainCircleDisabledColor);
361 | canvas.drawCircle(midx, midy, mainCircleRadius, circlePaint);
362 | canvas.drawText(label, midx, midy + (float) (radius * 1.1)-textPaint.getFontMetrics().descent, textPaint);
363 | canvas.drawLine(x1, y1, x2, y2, linePaint);
364 |
365 | } else {
366 |
367 | int radius = (int) (Math.min(midx, midy) * ((float) 14.5 / 16));
368 |
369 | if (sweepAngle == -1) {
370 | sweepAngle = 360 - (2 * startOffset);
371 | }
372 |
373 | if (mainCircleRadius == -1) {
374 | mainCircleRadius = radius * ((float) 11 / 15);
375 | }
376 | if (backCircleRadius == -1) {
377 | backCircleRadius = radius * ((float) 13 / 15);
378 | }
379 | if (progressRadius == -1) {
380 | progressRadius = radius;
381 | }
382 |
383 | circlePaint.setStrokeWidth(progressSecondaryStrokeWidth);
384 | circlePaint.setStyle(Paint.Style.STROKE);
385 | circlePaint2.setStrokeWidth(progressPrimaryStrokeWidth);
386 | circlePaint2.setStyle(Paint.Style.STROKE);
387 | linePaint.setStrokeWidth(indicatorWidth);
388 | textPaint.setTextSize(labelSize);
389 |
390 | float deg3 = Math.min(deg, max + 2);
391 |
392 | oval.set(midx - progressRadius, midy - progressRadius, midx + progressRadius, midy + progressRadius);
393 |
394 | canvas.drawArc(oval, (float) 90 + startOffset, (float) sweepAngle, false, circlePaint);
395 | if (isAntiClockwise) {
396 | canvas.drawArc(oval, (float) 90 - startOffset, -1 * ((deg3 - 2) * ((float) sweepAngle / max)), false, circlePaint2);
397 | } else {
398 | canvas.drawArc(oval, (float) 90 + startOffset, ((deg3 - 2) * ((float) sweepAngle / max)), false, circlePaint2);
399 | }
400 |
401 | float tmp2 = ((float) startOffset / 360) + (((float) sweepAngle / 360) * ((deg - 2) / (max)));
402 |
403 | if (isAntiClockwise) {
404 | tmp2 = 1.0f - tmp2;
405 | }
406 |
407 | float x1 = midx + (float) (radius * ((float) 2 / 5) * Math.sin(2 * Math.PI * (1.0 - tmp2)));
408 | float y1 = midy + (float) (radius * ((float) 2 / 5) * Math.cos(2 * Math.PI * (1.0 - tmp2)));
409 | float x2 = midx + (float) (radius * ((float) 3 / 5) * Math.sin(2 * Math.PI * (1.0 - tmp2)));
410 | float y2 = midy + (float) (radius * ((float) 3 / 5) * Math.cos(2 * Math.PI * (1.0 - tmp2)));
411 |
412 | circlePaint.setStyle(Paint.Style.FILL);
413 |
414 | if (isEnabled)
415 | circlePaint.setColor(backCircleColor);
416 | else
417 | circlePaint.setColor(backCircleDisabledColor);
418 | canvas.drawCircle(midx, midy, backCircleRadius, circlePaint);
419 | if (isEnabled)
420 | circlePaint.setColor(mainCircleColor);
421 | else
422 | circlePaint.setColor(mainCircleDisabledColor);
423 | canvas.drawCircle(midx, midy, mainCircleRadius, circlePaint);
424 | canvas.drawText(label, midx, midy + (float) (radius * 1.1)-textPaint.getFontMetrics().descent, textPaint);
425 | canvas.drawLine(x1, y1, x2, y2, linePaint);
426 | }
427 | }
428 |
429 | @Override
430 | public boolean onTouchEvent(MotionEvent e) {
431 |
432 | if (!isEnabled)
433 | return false;
434 |
435 | if (Utils.getDistance(e.getX(), e.getY(), midx, midy) > Math.max(mainCircleRadius, Math.max(backCircleRadius, progressRadius))) {
436 | if (startEventSent && mCrollerChangeListener != null) {
437 | mCrollerChangeListener.onStopTrackingTouch(this);
438 | startEventSent = false;
439 | }
440 | return super.onTouchEvent(e);
441 | }
442 |
443 | if (e.getAction() == MotionEvent.ACTION_DOWN) {
444 |
445 | float dx = e.getX() - midx;
446 | float dy = e.getY() - midy;
447 | downdeg = (float) ((Math.atan2(dy, dx) * 180) / Math.PI);
448 | downdeg -= 90;
449 | if (downdeg < 0) {
450 | downdeg += 360;
451 | }
452 | downdeg = (float) Math.floor((downdeg / 360) * (max + 5));
453 |
454 | if (mCrollerChangeListener != null) {
455 | mCrollerChangeListener.onStartTrackingTouch(this);
456 | startEventSent = true;
457 | }
458 |
459 | return true;
460 | }
461 | if (e.getAction() == MotionEvent.ACTION_MOVE) {
462 | float dx = e.getX() - midx;
463 | float dy = e.getY() - midy;
464 | currdeg = (float) ((Math.atan2(dy, dx) * 180) / Math.PI);
465 | currdeg -= 90;
466 | if (currdeg < 0) {
467 | currdeg += 360;
468 | }
469 | currdeg = (float) Math.floor((currdeg / 360) * (max + 5));
470 |
471 | if ((currdeg / (max + 4)) > 0.75f && ((downdeg - 0) / (max + 4)) < 0.25f) {
472 | if (isAntiClockwise) {
473 | deg++;
474 | if (deg > max + 2) {
475 | deg = max + 2;
476 | }
477 | } else {
478 | deg--;
479 | if (deg < (min + 2)) {
480 | deg = (min + 2);
481 | }
482 | }
483 | } else if ((downdeg / (max + 4)) > 0.75f && ((currdeg - 0) / (max + 4)) < 0.25f) {
484 | if (isAntiClockwise) {
485 | deg--;
486 | if (deg < (min + 2)) {
487 | deg = (min + 2);
488 | }
489 | } else {
490 | deg++;
491 | if (deg > max + 2) {
492 | deg = max + 2;
493 | }
494 | }
495 | } else {
496 | if (isAntiClockwise) {
497 | deg -= (currdeg - downdeg);
498 | } else {
499 | deg += (currdeg - downdeg);
500 | }
501 | if (deg > max + 2) {
502 | deg = max + 2;
503 | }
504 | if (deg < (min + 2)) {
505 | deg = (min + 2);
506 | }
507 | }
508 |
509 | downdeg = currdeg;
510 |
511 | invalidate();
512 | return true;
513 |
514 | }
515 | if (e.getAction() == MotionEvent.ACTION_UP) {
516 | if (mCrollerChangeListener != null) {
517 | mCrollerChangeListener.onStopTrackingTouch(this);
518 | startEventSent = false;
519 | }
520 | return true;
521 | }
522 | return super.onTouchEvent(e);
523 | }
524 |
525 | @Override
526 | public boolean dispatchTouchEvent(MotionEvent event) {
527 | if (getParent() != null && event.getAction() == MotionEvent.ACTION_DOWN) {
528 | getParent().requestDisallowInterceptTouchEvent(true);
529 | }
530 | return super.dispatchTouchEvent(event);
531 | }
532 |
533 | public boolean isEnabled() {
534 | return isEnabled;
535 | }
536 |
537 | public void setEnabled(boolean enabled) {
538 | this.isEnabled = enabled;
539 | invalidate();
540 | }
541 |
542 | public int getProgress() {
543 | return (int) (deg - 2);
544 | }
545 |
546 | public void setProgress(int x) {
547 | deg = x + 2;
548 | invalidate();
549 | }
550 |
551 | public String getLabel() {
552 | return label;
553 | }
554 |
555 | public void setLabel(String txt) {
556 | label = txt;
557 | invalidate();
558 | }
559 |
560 | public int getBackCircleColor() {
561 | return backCircleColor;
562 | }
563 |
564 | public void setBackCircleColor(int backCircleColor) {
565 | this.backCircleColor = backCircleColor;
566 | invalidate();
567 | }
568 |
569 | public int getMainCircleColor() {
570 | return mainCircleColor;
571 | }
572 |
573 | public void setMainCircleColor(int mainCircleColor) {
574 | this.mainCircleColor = mainCircleColor;
575 | invalidate();
576 | }
577 |
578 | public int getIndicatorColor() {
579 | return indicatorColor;
580 | }
581 |
582 | public void setIndicatorColor(int indicatorColor) {
583 | this.indicatorColor = indicatorColor;
584 | invalidate();
585 | }
586 |
587 | public int getProgressPrimaryColor() {
588 | return progressPrimaryColor;
589 | }
590 |
591 | public void setProgressPrimaryColor(int progressPrimaryColor) {
592 | this.progressPrimaryColor = progressPrimaryColor;
593 | invalidate();
594 | }
595 |
596 | public int getProgressSecondaryColor() {
597 | return progressSecondaryColor;
598 | }
599 |
600 | public void setProgressSecondaryColor(int progressSecondaryColor) {
601 | this.progressSecondaryColor = progressSecondaryColor;
602 | invalidate();
603 | }
604 |
605 | public int getBackCircleDisabledColor() {
606 | return backCircleDisabledColor;
607 | }
608 |
609 | public void setBackCircleDisabledColor(int backCircleDisabledColor) {
610 | this.backCircleDisabledColor = backCircleDisabledColor;
611 | invalidate();
612 | }
613 |
614 | public int getMainCircleDisabledColor() {
615 | return mainCircleDisabledColor;
616 | }
617 |
618 | public void setMainCircleDisabledColor(int mainCircleDisabledColor) {
619 | this.mainCircleDisabledColor = mainCircleDisabledColor;
620 | invalidate();
621 | }
622 |
623 | public int getIndicatorDisabledColor() {
624 | return indicatorDisabledColor;
625 | }
626 |
627 | public void setIndicatorDisabledColor(int indicatorDisabledColor) {
628 | this.indicatorDisabledColor = indicatorDisabledColor;
629 | invalidate();
630 | }
631 |
632 | public int getProgressPrimaryDisabledColor() {
633 | return progressPrimaryDisabledColor;
634 | }
635 |
636 | public void setProgressPrimaryDisabledColor(int progressPrimaryDisabledColor) {
637 | this.progressPrimaryDisabledColor = progressPrimaryDisabledColor;
638 | invalidate();
639 | }
640 |
641 | public int getProgressSecondaryDisabledColor() {
642 | return progressSecondaryDisabledColor;
643 | }
644 |
645 | public void setProgressSecondaryDisabledColor(int progressSecondaryDisabledColor) {
646 | this.progressSecondaryDisabledColor = progressSecondaryDisabledColor;
647 | invalidate();
648 | }
649 |
650 | public float getLabelSize() {
651 | return labelSize;
652 | }
653 |
654 | public void setLabelSize(float labelSize) {
655 | this.labelSize = labelSize;
656 | invalidate();
657 | }
658 |
659 | public int getLabelColor() {
660 | return labelColor;
661 | }
662 |
663 | public void setLabelColor(int labelColor) {
664 | this.labelColor = labelColor;
665 | invalidate();
666 | }
667 |
668 | public int getlabelDisabledColor() {
669 | return labelDisabledColor;
670 | }
671 |
672 | public void setlabelDisabledColor(int labelDisabledColor) {
673 | this.labelDisabledColor = labelDisabledColor;
674 | invalidate();
675 | }
676 |
677 | public String getLabelFont() {
678 | return labelFont;
679 | }
680 |
681 | public void setLabelFont(String labelFont) {
682 | this.labelFont = labelFont;
683 | if (textPaint != null)
684 | generateTypeface();
685 | invalidate();
686 | }
687 |
688 | public int getLabelStyle() {
689 | return labelStyle;
690 | }
691 |
692 | public void setLabelStyle(int labelStyle) {
693 | this.labelStyle = labelStyle;
694 | invalidate();
695 | }
696 |
697 | public float getIndicatorWidth() {
698 | return indicatorWidth;
699 | }
700 |
701 | public void setIndicatorWidth(float indicatorWidth) {
702 | this.indicatorWidth = indicatorWidth;
703 | invalidate();
704 | }
705 |
706 | public boolean isContinuous() {
707 | return isContinuous;
708 | }
709 |
710 | public void setIsContinuous(boolean isContinuous) {
711 | this.isContinuous = isContinuous;
712 | invalidate();
713 | }
714 |
715 | public float getProgressPrimaryCircleSize() {
716 | return progressPrimaryCircleSize;
717 | }
718 |
719 | public void setProgressPrimaryCircleSize(float progressPrimaryCircleSize) {
720 | this.progressPrimaryCircleSize = progressPrimaryCircleSize;
721 | invalidate();
722 | }
723 |
724 | public float getProgressSecondaryCircleSize() {
725 | return progressSecondaryCircleSize;
726 | }
727 |
728 | public void setProgressSecondaryCircleSize(float progressSecondaryCircleSize) {
729 | this.progressSecondaryCircleSize = progressSecondaryCircleSize;
730 | invalidate();
731 | }
732 |
733 | public float getProgressPrimaryStrokeWidth() {
734 | return progressPrimaryStrokeWidth;
735 | }
736 |
737 | public void setProgressPrimaryStrokeWidth(float progressPrimaryStrokeWidth) {
738 | this.progressPrimaryStrokeWidth = progressPrimaryStrokeWidth;
739 | invalidate();
740 | }
741 |
742 | public float getProgressSecondaryStrokeWidth() {
743 | return progressSecondaryStrokeWidth;
744 | }
745 |
746 | public void setProgressSecondaryStrokeWidth(float progressSecondaryStrokeWidth) {
747 | this.progressSecondaryStrokeWidth = progressSecondaryStrokeWidth;
748 | invalidate();
749 | }
750 |
751 | public int getSweepAngle() {
752 | return sweepAngle;
753 | }
754 |
755 | public void setSweepAngle(int sweepAngle) {
756 | this.sweepAngle = sweepAngle;
757 | invalidate();
758 | }
759 |
760 | public int getStartOffset() {
761 | return startOffset;
762 | }
763 |
764 | public void setStartOffset(int startOffset) {
765 | this.startOffset = startOffset;
766 | invalidate();
767 | }
768 |
769 | public int getMax() {
770 | return max;
771 | }
772 |
773 | public void setMax(int max) {
774 | if (max < min) {
775 | this.max = min;
776 | } else {
777 | this.max = max;
778 | }
779 | invalidate();
780 | }
781 |
782 | public int getMin() {
783 | return min;
784 | }
785 |
786 | public void setMin(int min) {
787 | if (min < 0) {
788 | this.min = 0;
789 | } else if (min > max) {
790 | this.min = max;
791 | } else {
792 | this.min = min;
793 | }
794 | invalidate();
795 | }
796 |
797 | public float getMainCircleRadius() {
798 | return mainCircleRadius;
799 | }
800 |
801 | public void setMainCircleRadius(float mainCircleRadius) {
802 | this.mainCircleRadius = mainCircleRadius;
803 | invalidate();
804 | }
805 |
806 | public float getBackCircleRadius() {
807 | return backCircleRadius;
808 | }
809 |
810 | public void setBackCircleRadius(float backCircleRadius) {
811 | this.backCircleRadius = backCircleRadius;
812 | invalidate();
813 | }
814 |
815 | public float getProgressRadius() {
816 | return progressRadius;
817 | }
818 |
819 | public void setProgressRadius(float progressRadius) {
820 | this.progressRadius = progressRadius;
821 | invalidate();
822 | }
823 |
824 | public boolean isAntiClockwise() {
825 | return isAntiClockwise;
826 | }
827 |
828 | public void setAntiClockwise(boolean antiClockwise) {
829 | isAntiClockwise = antiClockwise;
830 | invalidate();
831 | }
832 | }
833 |
--------------------------------------------------------------------------------
/croller/src/main/java/com/sdsmdg/harjot/crollerTest/OnCrollerChangeListener.java:
--------------------------------------------------------------------------------
1 | package com.sdsmdg.harjot.crollerTest;
2 |
3 | public interface OnCrollerChangeListener {
4 | void onProgressChanged(Croller croller, int progress);
5 |
6 | void onStartTrackingTouch(Croller croller);
7 |
8 | void onStopTrackingTouch(Croller croller);
9 | }
10 |
--------------------------------------------------------------------------------
/croller/src/main/java/com/sdsmdg/harjot/crollerTest/utilities/Utils.java:
--------------------------------------------------------------------------------
1 | package com.sdsmdg.harjot.crollerTest.utilities;
2 |
3 | import android.content.Context;
4 | import android.content.res.Resources;
5 | import android.util.DisplayMetrics;
6 |
7 | public class Utils {
8 | public static float getDistance(float x1, float y1, float x2, float y2) {
9 | return (float) Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
10 | }
11 |
12 | public static float convertDpToPixel(float dp, Context context) {
13 | Resources resources = context.getResources();
14 | DisplayMetrics metrics = resources.getDisplayMetrics();
15 | return dp * ((float) metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT);
16 | }
17 |
18 | public static float convertPixelsToDp(float px, Context context) {
19 | Resources resources = context.getResources();
20 | DisplayMetrics metrics = resources.getDisplayMetrics();
21 | return px / ((float) metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT);
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/croller/src/main/res/layout/croller_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/croller/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/croller/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Croller
3 |
4 |
--------------------------------------------------------------------------------
/croller/src/test/java/com/sdsmdg/harjot/croller/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.sdsmdg.harjot.crollerTest;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * To work on unit tests, switch the Test Artifact in the Build Variants view.
9 | */
10 | public class ExampleUnitTest {
11 | @Test
12 | public void addition_isCorrect() throws Exception {
13 | assertEquals(4, 2 + 2);
14 | }
15 | }
--------------------------------------------------------------------------------
/gifs/croller_1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/harjot-oberai/Croller/88b84e3cf17971fa9921998f853395f2025adcda/gifs/croller_1.gif
--------------------------------------------------------------------------------
/gifs/croller_2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/harjot-oberai/Croller/88b84e3cf17971fa9921998f853395f2025adcda/gifs/croller_2.gif
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/harjot-oberai/Croller/88b84e3cf17971fa9921998f853395f2025adcda/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Tue Nov 06 16:57:09 IST 2018
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/screens/croller_attributes.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/harjot-oberai/Croller/88b84e3cf17971fa9921998f853395f2025adcda/screens/croller_attributes.png
--------------------------------------------------------------------------------
/screens/croller_cover.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/harjot-oberai/Croller/88b84e3cf17971fa9921998f853395f2025adcda/screens/croller_cover.png
--------------------------------------------------------------------------------
/screens/croller_example.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/harjot-oberai/Croller/88b84e3cf17971fa9921998f853395f2025adcda/screens/croller_example.png
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app', ':croller'
2 |
--------------------------------------------------------------------------------