Skip to content

Commit b4c5b0f

Browse files
author
Wynne Plaga
committed
Add isDragging method
1 parent 3ceda2c commit b4c5b0f

File tree

6 files changed

+23
-21
lines changed

6 files changed

+23
-21
lines changed

app/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
apply plugin: 'com.android.application'
22

33
android {
4-
compileSdkVersion 29
5-
buildToolsVersion '29.0.3'
4+
compileSdkVersion 30
5+
buildToolsVersion '30.0.3'
66

77
defaultConfig {
88
applicationId "com.turingtechnologies.materialscrollbardemo"
99
minSdkVersion 14
10-
targetSdkVersion 29
10+
targetSdkVersion 30
1111
versionCode 7
1212
versionName "7.0"
1313
}
@@ -27,6 +27,6 @@ dependencies {
2727
implementation project(':lib')
2828
implementation 'androidx.recyclerview:recyclerview:1.1.0'
2929
implementation 'com.pnikosis:materialish-progress:1.7'
30-
implementation 'com.google.android.material:material:1.1.0'
31-
implementation 'androidx.appcompat:appcompat:1.1.0'
30+
implementation 'com.google.android.material:material:1.2.1'
31+
implementation 'androidx.appcompat:appcompat:1.2.0'
3232
}

build.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22
apply plugin: 'com.github.ben-manes.versions'
33

44
buildscript {
5-
// ext.kotlin_version = '1.2.10'
5+
66
repositories {
77
jcenter()
88
google()
99
}
1010
dependencies {
1111
classpath 'com.github.ben-manes:gradle-versions-plugin:0.15.0'
12-
classpath 'com.android.tools.build:gradle:4.0.0-beta05'
13-
// classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
12+
classpath 'com.android.tools.build:gradle:4.2.0-beta01'
1413

1514
// NOTE: Do not place your application dependencies here; they belong
1615
// in the individual module build.gradle files

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip

lib/build.gradle

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
apply plugin: 'com.android.library'
2-
//apply plugin: 'kotlin-android'
32

4-
def libVersion = '13.3.4'
3+
def libVersion = '13.4.0'
54

65
android {
7-
compileSdkVersion 29
8-
buildToolsVersion '29.0.3'
6+
compileSdkVersion 30
7+
buildToolsVersion '30.0.3'
98

109
defaultConfig {
1110
minSdkVersion 14
12-
targetSdkVersion 29
11+
targetSdkVersion 30
1312
versionName libVersion
1413
}
1514
compileOptions {
@@ -44,9 +43,8 @@ artifacts {
4443

4544
dependencies {
4645
implementation 'androidx.recyclerview:recyclerview:1.1.0'
47-
implementation 'com.google.android.material:material:1.1.0'
48-
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.0.0'
49-
// compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
46+
implementation 'com.google.android.material:material:1.2.1'
47+
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
5048
}
5149
repositories {
5250
mavenCentral()

lib/gradle.properties

Lines changed: 0 additions & 4 deletions
This file was deleted.

lib/src/main/java/com/turingtechnologies/materialscrollbar/MaterialScrollBar.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ public abstract class MaterialScrollBar<T> extends RelativeLayout {
8282
boolean hiddenByUser = false;
8383
private boolean hiddenByNotEnoughElements = false;
8484
private float fastScrollSnapPercent = 0;
85+
private Boolean isDragging = false;
8586

8687
//Associated Objects
8788
RecyclerView recyclerView;
@@ -680,6 +681,10 @@ public void clearScrollListeners() {
680681
listeners.clear();
681682
}
682683

684+
public boolean isDragging() {
685+
return isDragging;
686+
}
687+
683688
//CHAPTER IV - MISC METHODS
684689

685690
//Fetch accent color.
@@ -765,6 +770,8 @@ public void onAnimationEnd(Animator animation) {
765770
if(lightOnTouch) {
766771
handleThumb.setBackgroundColor(handleColor);
767772
}
773+
774+
isDragging = true;
768775
}
769776

770777
protected void onUp() {
@@ -782,6 +789,8 @@ public void onAnimationEnd(Animator animation) {
782789
if(lightOnTouch) {
783790
handleThumb.setBackgroundColor(handleOffColor);
784791
}
792+
793+
isDragging = false;
785794
}
786795

787796
//Tests to ensure that the touch is on the handleThumb depending on the user preference

0 commit comments

Comments
 (0)