diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/EditActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/EditActivity.kt index 13cbe344d..ffea6d0cd 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/EditActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/EditActivity.kt @@ -207,7 +207,7 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener .load(uri) .apply(options) .listener(object : RequestListener { - override fun onLoadFailed(e: GlideException?, model: Any?, target: Target?, isFirstResource: Boolean): Boolean { + override fun onLoadFailed(e: GlideException?, model: Any?, target: Target, isFirstResource: Boolean): Boolean { if (uri != originalUri) { uri = originalUri Handler().post { @@ -218,10 +218,10 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener } override fun onResourceReady( - bitmap: Bitmap?, - model: Any?, - target: Target?, - dataSource: DataSource?, + bitmap: Bitmap, + model: Any, + target: Target, + dataSource: DataSource, isFirstResource: Boolean ): Boolean { val currentFilter = getFiltersAdapter()?.getCurrentFilter() @@ -630,16 +630,16 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener Glide.with(this) .asBitmap() .load(uri).listener(object : RequestListener { - override fun onLoadFailed(e: GlideException?, model: Any?, target: Target?, isFirstResource: Boolean): Boolean { + override fun onLoadFailed(e: GlideException?, model: Any?, target: Target, isFirstResource: Boolean): Boolean { showErrorToast(e.toString()) return false } override fun onResourceReady( - resource: Bitmap?, - model: Any?, - target: Target?, - dataSource: DataSource?, + resource: Bitmap, + model: Any, + target: Target, + dataSource: DataSource, isFirstResource: Boolean ) = false }) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt index ecb183d10..e898823c0 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt @@ -1016,22 +1016,19 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View .load(path) .apply(options) .listener(object : RequestListener { - override fun onLoadFailed(e: GlideException?, model: Any?, target: Target?, isFirstResource: Boolean): Boolean { + override fun onLoadFailed(e: GlideException?, model: Any?, target: Target, isFirstResource: Boolean): Boolean { showErrorToast(e?.localizedMessage ?: "") return false } override fun onResourceReady( - bitmap: Bitmap?, - model: Any?, - target: Target?, - dataSource: DataSource?, + bitmap: Bitmap, + model: Any, + target: Target, + dataSource: DataSource, isFirstResource: Boolean ): Boolean { - if (bitmap != null) { - printHelper.printBitmap(path.getFilenameFromPath(), bitmap) - } - + printHelper.printBitmap(path.getFilenameFromPath(), bitmap) return false } }).submit(requestedWidth, requestedHeight) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt index 031917600..5de9b38f5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt @@ -533,16 +533,16 @@ fun Context.loadPng( .load(path) .apply(options) .listener(object : RequestListener { - override fun onLoadFailed(e: GlideException?, model: Any?, targetBitmap: Target?, isFirstResource: Boolean): Boolean { + override fun onLoadFailed(e: GlideException?, model: Any?, targetBitmap: Target, isFirstResource: Boolean): Boolean { tryLoadingWithPicasso(path, target, cropThumbnails, roundCorners, signature) return true } override fun onResourceReady( - resource: Bitmap?, - model: Any?, - targetBitmap: Target?, - dataSource: DataSource?, + resource: Bitmap, + model: Any, + targetBitmap: Target, + dataSource: DataSource, isFirstResource: Boolean ): Boolean { return false diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt index c7a1de603..715f23472 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt @@ -462,7 +462,7 @@ class PhotoFragment : ViewPagerFragment() { .load(path) .apply(options) .listener(object : RequestListener { - override fun onLoadFailed(e: GlideException?, model: Any?, target: Target?, isFirstResource: Boolean): Boolean { + override fun onLoadFailed(e: GlideException?, model: Any?, target: Target, isFirstResource: Boolean): Boolean { if (activity != null && !activity!!.isDestroyed && !activity!!.isFinishing) { tryLoadingWithPicasso(addZoomableView) } @@ -470,10 +470,10 @@ class PhotoFragment : ViewPagerFragment() { } override fun onResourceReady( - resource: Drawable?, - model: Any?, - target: Target?, - dataSource: DataSource?, + resource: Drawable, + model: Any, + target: Target, + dataSource: DataSource, isFirstResource: Boolean ): Boolean { val allowZoomingImages = context?.config?.allowZoomingImages ?: true diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/svg/SvgSoftwareLayerSetter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/svg/SvgSoftwareLayerSetter.kt index 2d7444eba..777f5666b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/svg/SvgSoftwareLayerSetter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/svg/SvgSoftwareLayerSetter.kt @@ -11,7 +11,7 @@ import com.bumptech.glide.request.target.Target class SvgSoftwareLayerSetter : RequestListener { - override fun onLoadFailed(e: GlideException?, model: Any, target: Target, isFirstResource: Boolean): Boolean { + override fun onLoadFailed(e: GlideException?, model: Any?, target: Target, isFirstResource: Boolean): Boolean { val view = (target as ImageViewTarget<*>).view view.setLayerType(ImageView.LAYER_TYPE_NONE, null) return false diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 89d065eb5..28ba853f3 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -13,7 +13,7 @@ exif = "1.0.1" #Room room = "2.6.0-beta01" #Simple tools -simple-commons = "687fa225a8" +simple-commons = "7c1e5b5777" #Gradle gradlePlugins-agp = "8.1.0" #Other @@ -55,7 +55,7 @@ androidx-room-runtime = { module = "androidx.room:room-runtime", version.ref = " androidx-room-ktx = { module = "androidx.room:room-ktx", version.ref = "room" } androidx-room-compiler = { module = "androidx.room:room-compiler", version.ref = "room" } #Simple Mobile Tools -simple-tools-commons = { module = "com.github.esensar:Simple-Commons", version.ref = "simple-commons" } +simple-tools-commons = { module = "com.github.SimpleMobileTools:Simple-Commons", version.ref = "simple-commons" } #Other android-gif-drawable = { module = "pl.droidsonroids.gif:android-gif-drawable", version.ref = "androidGifDrawable" } android-image-cropper = { module = "com.vanniktech:android-image-cropper", version.ref = "androidImageCropper" }