Skip to content

Commit

Permalink
Add isDragging method
Browse files Browse the repository at this point in the history
  • Loading branch information
Wynne Plaga committed Dec 9, 2020
1 parent 3ceda2c commit b4c5b0f
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 21 deletions.
10 changes: 5 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 29
buildToolsVersion '29.0.3'
compileSdkVersion 30
buildToolsVersion '30.0.3'

defaultConfig {
applicationId "com.turingtechnologies.materialscrollbardemo"
minSdkVersion 14
targetSdkVersion 29
targetSdkVersion 30
versionCode 7
versionName "7.0"
}
Expand All @@ -27,6 +27,6 @@ dependencies {
implementation project(':lib')
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.pnikosis:materialish-progress:1.7'
implementation 'com.google.android.material:material:1.1.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.appcompat:appcompat:1.2.0'
}
5 changes: 2 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@
apply plugin: 'com.github.ben-manes.versions'

buildscript {
// ext.kotlin_version = '1.2.10'

repositories {
jcenter()
google()
}
dependencies {
classpath 'com.github.ben-manes:gradle-versions-plugin:0.15.0'
classpath 'com.android.tools.build:gradle:4.0.0-beta05'
// classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.android.tools.build:gradle:4.2.0-beta01'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
14 changes: 6 additions & 8 deletions lib/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
apply plugin: 'com.android.library'
//apply plugin: 'kotlin-android'

def libVersion = '13.3.4'
def libVersion = '13.4.0'

android {
compileSdkVersion 29
buildToolsVersion '29.0.3'
compileSdkVersion 30
buildToolsVersion '30.0.3'

defaultConfig {
minSdkVersion 14
targetSdkVersion 29
targetSdkVersion 30
versionName libVersion
}
compileOptions {
Expand Down Expand Up @@ -44,9 +43,8 @@ artifacts {

dependencies {
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.google.android.material:material:1.1.0'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.0.0'
// compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
}
repositories {
mavenCentral()
Expand Down
4 changes: 0 additions & 4 deletions lib/gradle.properties

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public abstract class MaterialScrollBar<T> extends RelativeLayout {
boolean hiddenByUser = false;
private boolean hiddenByNotEnoughElements = false;
private float fastScrollSnapPercent = 0;
private Boolean isDragging = false;

//Associated Objects
RecyclerView recyclerView;
Expand Down Expand Up @@ -680,6 +681,10 @@ public void clearScrollListeners() {
listeners.clear();
}

public boolean isDragging() {
return isDragging;
}

//CHAPTER IV - MISC METHODS

//Fetch accent color.
Expand Down Expand Up @@ -765,6 +770,8 @@ public void onAnimationEnd(Animator animation) {
if(lightOnTouch) {
handleThumb.setBackgroundColor(handleColor);
}

isDragging = true;
}

protected void onUp() {
Expand All @@ -782,6 +789,8 @@ public void onAnimationEnd(Animator animation) {
if(lightOnTouch) {
handleThumb.setBackgroundColor(handleOffColor);
}

isDragging = false;
}

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

0 comments on commit b4c5b0f

Please sign in to comment.