diff --git a/build.gradle b/build.gradle index 7c650440..de01f71c 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = "1.3.72" + ext.kotlin_version = "1.4.10" repositories { gradlePluginPortal() jcenter() @@ -7,10 +7,10 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:4.0.0' + classpath 'com.android.tools.build:gradle:4.1.0' classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' - classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4' - classpath 'org.jlleitschuh.gradle:ktlint-gradle:9.2.1' + classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5' + classpath 'org.jlleitschuh.gradle:ktlint-gradle:9.4.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/example/build.gradle b/example/build.gradle index b32faa1f..de3cb274 100644 --- a/example/build.gradle +++ b/example/build.gradle @@ -25,12 +25,12 @@ android { dependencies { implementation project(':slidetoact') - implementation 'androidx.appcompat:appcompat:1.1.0' - implementation 'com.google.android.material:material:1.0.0' + implementation 'androidx.appcompat:appcompat:1.2.0' + implementation 'com.google.android.material:material:1.2.1' - testImplementation "junit:junit:4.12" + testImplementation "junit:junit:4.13.1" - androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' - androidTestImplementation 'androidx.test:rules:1.2.0' - androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' + androidTestImplementation 'androidx.test:rules:1.3.0' + androidTestImplementation 'androidx.test.ext:junit:1.1.2' } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 84226702..14e30f74 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/slidetoact/build.gradle b/slidetoact/build.gradle index 1a2fb79a..55addf17 100644 --- a/slidetoact/build.gradle +++ b/slidetoact/build.gradle @@ -28,7 +28,7 @@ android { } dependencies { - implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'androidx.appcompat:appcompat:1.2.0' implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" } @@ -107,7 +107,7 @@ bintray { } ktlint { - version = "0.37.0" + version = "0.39.0" debug = false verbose = true android = true diff --git a/slidetoact/src/main/java/com/ncorti/slidetoact/SlideToActView.kt b/slidetoact/src/main/java/com/ncorti/slidetoact/SlideToActView.kt index 8be841e5..e95b2fd7 100644 --- a/slidetoact/src/main/java/com/ncorti/slidetoact/SlideToActView.kt +++ b/slidetoact/src/main/java/com/ncorti/slidetoact/SlideToActView.kt @@ -292,7 +292,9 @@ class SlideToActView @JvmOverloads constructor( val attrs: TypedArray = context.theme.obtainStyledAttributes( xmlAttrs, - R.styleable.SlideToActView, defStyleAttr, R.style.SlideToActView + R.styleable.SlideToActView, + defStyleAttr, + R.style.SlideToActView ) try { mDesiredSliderHeight = TypedValue.applyDimension( @@ -307,10 +309,12 @@ class SlideToActView @JvmOverloads constructor( ).toInt() val defaultOuter = ContextCompat.getColor( - this.context, R.color.slidetoact_defaultAccent + this.context, + R.color.slidetoact_defaultAccent ) val defaultWhite = ContextCompat.getColor( - this.context, R.color.slidetoact_white + this.context, + R.color.slidetoact_white ) with(attrs) { @@ -348,13 +352,16 @@ class SlideToActView @JvmOverloads constructor( isReversed = getBoolean(R.styleable.SlideToActView_slider_reversed, false) isRotateIcon = getBoolean(R.styleable.SlideToActView_rotate_icon, true) isAnimateCompletion = getBoolean( - R.styleable.SlideToActView_animate_completion, true + R.styleable.SlideToActView_animate_completion, + true ) animDuration = getInteger( - R.styleable.SlideToActView_animation_duration, 300 + R.styleable.SlideToActView_animation_duration, + 300 ).toLong() bumpVibration = getInt( - R.styleable.SlideToActView_bump_vibration, 0 + R.styleable.SlideToActView_bump_vibration, + 0 ).toLong() mOriginAreaMargin = getDimensionPixelSize( @@ -364,7 +371,8 @@ class SlideToActView @JvmOverloads constructor( mActualAreaMargin = mOriginAreaMargin sliderIcon = getResourceId( - R.styleable.SlideToActView_slider_icon, R.drawable.slidetoact_ic_arrow + R.styleable.SlideToActView_slider_icon, + R.drawable.slidetoact_ic_arrow ) // For icon color. check if the `slide_icon_color` is set. @@ -657,7 +665,8 @@ class SlideToActView @JvmOverloads constructor( // Animator that bounce away the cursors val marginAnimator = ValueAnimator.ofInt( - mActualAreaMargin, (mInnerRect.width() / 2).toInt() + mActualAreaMargin + mActualAreaMargin, + (mInnerRect.width() / 2).toInt() + mActualAreaMargin ) marginAnimator.addUpdateListener { mActualAreaMargin = it.animatedValue as Int @@ -699,27 +708,30 @@ class SlideToActView @JvmOverloads constructor( animSet.duration = animDuration - animSet.addListener(object : Animator.AnimatorListener { - override fun onAnimationStart(p0: Animator?) { - onSlideToActAnimationEventListener?.onSlideCompleteAnimationStarted( - this@SlideToActView, mPositionPerc - ) - } + animSet.addListener( + object : Animator.AnimatorListener { + override fun onAnimationStart(p0: Animator?) { + onSlideToActAnimationEventListener?.onSlideCompleteAnimationStarted( + this@SlideToActView, + mPositionPerc + ) + } - override fun onAnimationCancel(p0: Animator?) { - } + override fun onAnimationCancel(p0: Animator?) { + } - override fun onAnimationEnd(p0: Animator?) { - mIsCompleted = true - onSlideToActAnimationEventListener?.onSlideCompleteAnimationEnded( - this@SlideToActView - ) - onSlideCompleteListener?.onSlideComplete(this@SlideToActView) - } + override fun onAnimationEnd(p0: Animator?) { + mIsCompleted = true + onSlideToActAnimationEventListener?.onSlideCompleteAnimationEnded( + this@SlideToActView + ) + onSlideCompleteListener?.onSlideComplete(this@SlideToActView) + } - override fun onAnimationRepeat(p0: Animator?) { + override fun onAnimationRepeat(p0: Animator?) { + } } - }) + ) animSet.start() } @@ -812,28 +824,30 @@ class SlideToActView @JvmOverloads constructor( animSet.duration = animDuration - animSet.addListener(object : Animator.AnimatorListener { - override fun onAnimationStart(p0: Animator?) { - onSlideToActAnimationEventListener?.onSlideResetAnimationStarted( - this@SlideToActView - ) - } + animSet.addListener( + object : Animator.AnimatorListener { + override fun onAnimationStart(p0: Animator?) { + onSlideToActAnimationEventListener?.onSlideResetAnimationStarted( + this@SlideToActView + ) + } - override fun onAnimationCancel(p0: Animator?) { - } + override fun onAnimationCancel(p0: Animator?) { + } - override fun onAnimationEnd(p0: Animator?) { - isEnabled = true - stopIconAnimation(mDrawableTick) - onSlideToActAnimationEventListener?.onSlideResetAnimationEnded( - this@SlideToActView - ) - onSlideResetListener?.onSlideReset(this@SlideToActView) - } + override fun onAnimationEnd(p0: Animator?) { + isEnabled = true + stopIconAnimation(mDrawableTick) + onSlideToActAnimationEventListener?.onSlideResetAnimationEnded( + this@SlideToActView + ) + onSlideResetListener?.onSlideReset(this@SlideToActView) + } - override fun onAnimationRepeat(p0: Animator?) { + override fun onAnimationRepeat(p0: Animator?) { + } } - }) + ) animSet.start() }