From 7a34d19670560c4a976503a86074b298e20a919b Mon Sep 17 00:00:00 2001 From: Tommy Buonomo Date: Wed, 20 Nov 2024 22:12:29 +0100 Subject: [PATCH 1/4] Upgrade jvmToolchain to 21 --- viewpagerdotsindicator-sample/build.gradle.kts | 2 +- viewpagerdotsindicator/build.gradle.kts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/viewpagerdotsindicator-sample/build.gradle.kts b/viewpagerdotsindicator-sample/build.gradle.kts index 9b6f9b3..3238024 100644 --- a/viewpagerdotsindicator-sample/build.gradle.kts +++ b/viewpagerdotsindicator-sample/build.gradle.kts @@ -35,7 +35,7 @@ android { } kotlin { - jvmToolchain(17) + jvmToolchain(21) } dependencies { diff --git a/viewpagerdotsindicator/build.gradle.kts b/viewpagerdotsindicator/build.gradle.kts index 93e93ef..e481b06 100644 --- a/viewpagerdotsindicator/build.gradle.kts +++ b/viewpagerdotsindicator/build.gradle.kts @@ -30,7 +30,7 @@ android { } kotlin { - jvmToolchain(17) + jvmToolchain(21) } dependencies { From e769def3df5f7d91c4ded43ddabf94843760e3b9 Mon Sep 17 00:00:00 2001 From: Tommy Buonomo Date: Wed, 20 Nov 2024 22:13:31 +0100 Subject: [PATCH 2/4] Upgrade Android Gradle Plugin to 8.7.2 --- gradle/libs.versions.toml | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index b95698b..bc34ad2 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -agp = "8.5.2" +agp = "8.7.2" cardview = "1.0.0" constraintlayout = "2.1.4" dotsindicator = "5.0" diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b4817f9..607b415 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Fri Mar 10 20:33:42 CET 2023 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From 7b4f0173dec6530ca6b5b64f3bc1dc2a00a53113 Mon Sep 17 00:00:00 2001 From: Tommy Buonomo Date: Wed, 20 Nov 2024 22:13:50 +0100 Subject: [PATCH 3/4] Upgrade dotsindicator sample dependency --- gradle/libs.versions.toml | 2 +- viewpagerdotsindicator-sample/build.gradle.kts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index bc34ad2..72836b2 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,7 +2,7 @@ agp = "8.7.2" cardview = "1.0.0" constraintlayout = "2.1.4" -dotsindicator = "5.0" +dotsindicator = "5.1.0" espressoCore = "3.6.1" kotlin = "1.9.25" coreKtx = "1.13.1" diff --git a/viewpagerdotsindicator-sample/build.gradle.kts b/viewpagerdotsindicator-sample/build.gradle.kts index 3238024..50017a9 100644 --- a/viewpagerdotsindicator-sample/build.gradle.kts +++ b/viewpagerdotsindicator-sample/build.gradle.kts @@ -49,8 +49,8 @@ dependencies { androidTestImplementation(libs.androidx.runner) androidTestImplementation(libs.androidx.espresso.core) - implementation(project(":viewpagerdotsindicator")) -// implementation(libs.dotsindicator) +// implementation(project(":viewpagerdotsindicator")) + implementation(libs.dotsindicator) implementation(platform(libs.androidx.compose.bom)) implementation(libs.androidx.ui) From fbedaa3b8c95d76f9d2f3032e1b211b364d63f0d Mon Sep 17 00:00:00 2001 From: Tommy Buonomo Date: Thu, 21 Nov 2024 13:53:17 +0100 Subject: [PATCH 4/4] [Fix #169] Handle null background --- .../tbuonomo/viewpagerdotsindicator/DotsIndicator.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/viewpagerdotsindicator/src/main/kotlin/com/tbuonomo/viewpagerdotsindicator/DotsIndicator.kt b/viewpagerdotsindicator/src/main/kotlin/com/tbuonomo/viewpagerdotsindicator/DotsIndicator.kt index 63e3e8f..8cbbff3 100644 --- a/viewpagerdotsindicator/src/main/kotlin/com/tbuonomo/viewpagerdotsindicator/DotsIndicator.kt +++ b/viewpagerdotsindicator/src/main/kotlin/com/tbuonomo/viewpagerdotsindicator/DotsIndicator.kt @@ -135,8 +135,8 @@ class DotsIndicator @JvmOverloads constructor( (dotsSize + dotsSize * (dotsWidthFactor - 1) * positionOffset).toInt() nextDot.setWidth(nextDotWidth) - val selectedDotBackground = selectedDot.background as DotsGradientDrawable - val nextDotBackground = nextDot.background as DotsGradientDrawable + val selectedDotBackground = selectedDot.background as DotsGradientDrawable? + val nextDotBackground = nextDot.background as DotsGradientDrawable? if (selectedDotColor != dotsColor) { val selectedColor = argbEvaluator.evaluate( @@ -148,12 +148,12 @@ class DotsIndicator @JvmOverloads constructor( selectedDotColor ) as Int - nextDotBackground.setColor(nextColor) + nextDotBackground?.setColor(nextColor) if (progressMode && selectedPosition <= pager!!.currentItem) { - selectedDotBackground.setColor(selectedDotColor) + selectedDotBackground?.setColor(selectedDotColor) } else { - selectedDotBackground.setColor(selectedColor) + selectedDotBackground?.setColor(selectedColor) } } }