From e772cd297dc4d721ad5d6a2b0b53a5bc95920dc0 Mon Sep 17 00:00:00 2001 From: Jay Patel Date: Tue, 8 Oct 2024 22:14:38 +0530 Subject: [PATCH] Update: AGP upgraded to 8.5.2 and minor improvements --- cropper/build.gradle.kts | 6 ++---- cropper/src/main/kotlin/com/canhub/cropper/BitmapUtils.kt | 2 +- .../src/main/kotlin/com/canhub/cropper/CropImageView.kt | 8 ++++---- gradle/libs.versions.toml | 6 +++--- gradle/wrapper/gradle-wrapper.properties | 2 +- 5 files changed, 11 insertions(+), 13 deletions(-) diff --git a/cropper/build.gradle.kts b/cropper/build.gradle.kts index ed7645de..da1b5e8f 100644 --- a/cropper/build.gradle.kts +++ b/cropper/build.gradle.kts @@ -14,7 +14,7 @@ licensee { kotlin { jvmToolchain { - languageVersion.set(JavaLanguageVersion.of(11)) + languageVersion.set(JavaLanguageVersion.of(17)) } } @@ -37,9 +37,7 @@ android { } testOptions { - unitTests { - isIncludeAndroidResources = true - } + unitTests.isIncludeAndroidResources = true } } diff --git a/cropper/src/main/kotlin/com/canhub/cropper/BitmapUtils.kt b/cropper/src/main/kotlin/com/canhub/cropper/BitmapUtils.kt index aece8f42..6e1b7b51 100644 --- a/cropper/src/main/kotlin/com/canhub/cropper/BitmapUtils.kt +++ b/cropper/src/main/kotlin/com/canhub/cropper/BitmapUtils.kt @@ -218,7 +218,7 @@ internal object BitmapUtils { scale: Float, flipHorizontally: Boolean, flipVertically: Boolean, - ): Bitmap? { + ): Bitmap { // get the rectangle in original image that contains the required cropped area (larger for non- // rectangular crop) val rect = getRectFromPoints( diff --git a/cropper/src/main/kotlin/com/canhub/cropper/CropImageView.kt b/cropper/src/main/kotlin/com/canhub/cropper/CropImageView.kt index 5956e59c..e37c0c33 100644 --- a/cropper/src/main/kotlin/com/canhub/cropper/CropImageView.kt +++ b/cropper/src/main/kotlin/com/canhub/cropper/CropImageView.kt @@ -1815,10 +1815,10 @@ class CropImageView @JvmOverloads constructor( isSaveBitmapToInstanceState = a.getBoolean(R.styleable.CropImageView_cropSaveBitmapToInstanceState, isSaveBitmapToInstanceState) CropImageOptions( - scaleType = ScaleType.values()[a.getInt(R.styleable.CropImageView_cropScaleType, default.scaleType.ordinal)], - cropShape = CropShape.values()[a.getInt(R.styleable.CropImageView_cropShape, default.cropShape.ordinal)], - cornerShape = CropCornerShape.values()[a.getInt(R.styleable.CropImageView_cornerShape, default.cornerShape.ordinal)], - guidelines = Guidelines.values()[a.getInt(R.styleable.CropImageView_cropGuidelines, default.guidelines.ordinal)], + scaleType = ScaleType.entries[a.getInt(R.styleable.CropImageView_cropScaleType, default.scaleType.ordinal)], + cropShape = CropShape.entries[a.getInt(R.styleable.CropImageView_cropShape, default.cropShape.ordinal)], + cornerShape = CropCornerShape.entries[a.getInt(R.styleable.CropImageView_cornerShape, default.cornerShape.ordinal)], + guidelines = Guidelines.entries[a.getInt(R.styleable.CropImageView_cropGuidelines, default.guidelines.ordinal)], aspectRatioX = a.getInteger(R.styleable.CropImageView_cropAspectRatioX, default.aspectRatioX), aspectRatioY = a.getInteger(R.styleable.CropImageView_cropAspectRatioY, default.aspectRatioY), autoZoomEnabled = a.getBoolean(R.styleable.CropImageView_cropAutoZoomEnabled, default.autoZoomEnabled), diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 890f7650..49bba0aa 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -3,17 +3,17 @@ minSdk = "21" compileSdk = "34" targetSdk = "34" -androidgradleplugin = "8.5.1" +androidgradleplugin = "8.5.2" kotlin = "2.0.0" kotlinxcoroutines = "1.8.1" ktlint = "1.3.1" [libraries] -androidx-activity-ktx = { module = "androidx.activity:activity-ktx", version = "1.9.1" } +androidx-activity-ktx = { module = "androidx.activity:activity-ktx", version = "1.9.2" } androidx-appcompat = { module = "androidx.appcompat:appcompat", version = "1.7.0" } androidx-core-ktx = { module = "androidx.core:core-ktx", version = "1.13.1" } androidx-exifinterface = { module = "androidx.exifinterface:exifinterface", version = "1.3.7" } -androidx-fragment-testing = { module = "androidx.fragment:fragment-testing", version = "1.8.2" } +androidx-fragment-testing = { module = "androidx.fragment:fragment-testing", version = "1.8.4" } androidx-test-junit = { module = "androidx.test.ext:junit", version = "1.2.1" } junit = { module = "junit:junit", version = "4.13.2" } kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "kotlinxcoroutines" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index dedd5d1e..ae5a00bc 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -4,4 +4,4 @@ distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists +