updating commons

This commit is contained in:
tibbi 2023-08-31 00:06:22 +02:00
parent b9feabb98b
commit 87adbfcd4b
6 changed files with 29 additions and 32 deletions

View file

@ -207,7 +207,7 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener
.load(uri) .load(uri)
.apply(options) .apply(options)
.listener(object : RequestListener<Bitmap> { .listener(object : RequestListener<Bitmap> {
override fun onLoadFailed(e: GlideException?, model: Any?, target: Target<Bitmap>?, isFirstResource: Boolean): Boolean { override fun onLoadFailed(e: GlideException?, model: Any?, target: Target<Bitmap>, isFirstResource: Boolean): Boolean {
if (uri != originalUri) { if (uri != originalUri) {
uri = originalUri uri = originalUri
Handler().post { Handler().post {
@ -218,10 +218,10 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener
} }
override fun onResourceReady( override fun onResourceReady(
bitmap: Bitmap?, bitmap: Bitmap,
model: Any?, model: Any,
target: Target<Bitmap>?, target: Target<Bitmap>,
dataSource: DataSource?, dataSource: DataSource,
isFirstResource: Boolean isFirstResource: Boolean
): Boolean { ): Boolean {
val currentFilter = getFiltersAdapter()?.getCurrentFilter() val currentFilter = getFiltersAdapter()?.getCurrentFilter()
@ -630,16 +630,16 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener
Glide.with(this) Glide.with(this)
.asBitmap() .asBitmap()
.load(uri).listener(object : RequestListener<Bitmap> { .load(uri).listener(object : RequestListener<Bitmap> {
override fun onLoadFailed(e: GlideException?, model: Any?, target: Target<Bitmap>?, isFirstResource: Boolean): Boolean { override fun onLoadFailed(e: GlideException?, model: Any?, target: Target<Bitmap>, isFirstResource: Boolean): Boolean {
showErrorToast(e.toString()) showErrorToast(e.toString())
return false return false
} }
override fun onResourceReady( override fun onResourceReady(
resource: Bitmap?, resource: Bitmap,
model: Any?, model: Any,
target: Target<Bitmap>?, target: Target<Bitmap>,
dataSource: DataSource?, dataSource: DataSource,
isFirstResource: Boolean isFirstResource: Boolean
) = false ) = false
}) })

View file

@ -1016,22 +1016,19 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
.load(path) .load(path)
.apply(options) .apply(options)
.listener(object : RequestListener<Bitmap> { .listener(object : RequestListener<Bitmap> {
override fun onLoadFailed(e: GlideException?, model: Any?, target: Target<Bitmap>?, isFirstResource: Boolean): Boolean { override fun onLoadFailed(e: GlideException?, model: Any?, target: Target<Bitmap>, isFirstResource: Boolean): Boolean {
showErrorToast(e?.localizedMessage ?: "") showErrorToast(e?.localizedMessage ?: "")
return false return false
} }
override fun onResourceReady( override fun onResourceReady(
bitmap: Bitmap?, bitmap: Bitmap,
model: Any?, model: Any,
target: Target<Bitmap>?, target: Target<Bitmap>,
dataSource: DataSource?, dataSource: DataSource,
isFirstResource: Boolean isFirstResource: Boolean
): Boolean { ): Boolean {
if (bitmap != null) { printHelper.printBitmap(path.getFilenameFromPath(), bitmap)
printHelper.printBitmap(path.getFilenameFromPath(), bitmap)
}
return false return false
} }
}).submit(requestedWidth, requestedHeight) }).submit(requestedWidth, requestedHeight)

View file

@ -533,16 +533,16 @@ fun Context.loadPng(
.load(path) .load(path)
.apply(options) .apply(options)
.listener(object : RequestListener<Bitmap> { .listener(object : RequestListener<Bitmap> {
override fun onLoadFailed(e: GlideException?, model: Any?, targetBitmap: Target<Bitmap>?, isFirstResource: Boolean): Boolean { override fun onLoadFailed(e: GlideException?, model: Any?, targetBitmap: Target<Bitmap>, isFirstResource: Boolean): Boolean {
tryLoadingWithPicasso(path, target, cropThumbnails, roundCorners, signature) tryLoadingWithPicasso(path, target, cropThumbnails, roundCorners, signature)
return true return true
} }
override fun onResourceReady( override fun onResourceReady(
resource: Bitmap?, resource: Bitmap,
model: Any?, model: Any,
targetBitmap: Target<Bitmap>?, targetBitmap: Target<Bitmap>,
dataSource: DataSource?, dataSource: DataSource,
isFirstResource: Boolean isFirstResource: Boolean
): Boolean { ): Boolean {
return false return false

View file

@ -462,7 +462,7 @@ class PhotoFragment : ViewPagerFragment() {
.load(path) .load(path)
.apply(options) .apply(options)
.listener(object : RequestListener<Drawable> { .listener(object : RequestListener<Drawable> {
override fun onLoadFailed(e: GlideException?, model: Any?, target: Target<Drawable>?, isFirstResource: Boolean): Boolean { override fun onLoadFailed(e: GlideException?, model: Any?, target: Target<Drawable>, isFirstResource: Boolean): Boolean {
if (activity != null && !activity!!.isDestroyed && !activity!!.isFinishing) { if (activity != null && !activity!!.isDestroyed && !activity!!.isFinishing) {
tryLoadingWithPicasso(addZoomableView) tryLoadingWithPicasso(addZoomableView)
} }
@ -470,10 +470,10 @@ class PhotoFragment : ViewPagerFragment() {
} }
override fun onResourceReady( override fun onResourceReady(
resource: Drawable?, resource: Drawable,
model: Any?, model: Any,
target: Target<Drawable>?, target: Target<Drawable>,
dataSource: DataSource?, dataSource: DataSource,
isFirstResource: Boolean isFirstResource: Boolean
): Boolean { ): Boolean {
val allowZoomingImages = context?.config?.allowZoomingImages ?: true val allowZoomingImages = context?.config?.allowZoomingImages ?: true

View file

@ -11,7 +11,7 @@ import com.bumptech.glide.request.target.Target
class SvgSoftwareLayerSetter : RequestListener<PictureDrawable> { class SvgSoftwareLayerSetter : RequestListener<PictureDrawable> {
override fun onLoadFailed(e: GlideException?, model: Any, target: Target<PictureDrawable>, isFirstResource: Boolean): Boolean { override fun onLoadFailed(e: GlideException?, model: Any?, target: Target<PictureDrawable>, isFirstResource: Boolean): Boolean {
val view = (target as ImageViewTarget<*>).view val view = (target as ImageViewTarget<*>).view
view.setLayerType(ImageView.LAYER_TYPE_NONE, null) view.setLayerType(ImageView.LAYER_TYPE_NONE, null)
return false return false

View file

@ -13,7 +13,7 @@ exif = "1.0.1"
#Room #Room
room = "2.6.0-beta01" room = "2.6.0-beta01"
#Simple tools #Simple tools
simple-commons = "687fa225a8" simple-commons = "7c1e5b5777"
#Gradle #Gradle
gradlePlugins-agp = "8.1.0" gradlePlugins-agp = "8.1.0"
#Other #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-ktx = { module = "androidx.room:room-ktx", version.ref = "room" }
androidx-room-compiler = { module = "androidx.room:room-compiler", version.ref = "room" } androidx-room-compiler = { module = "androidx.room:room-compiler", version.ref = "room" }
#Simple Mobile Tools #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 #Other
android-gif-drawable = { module = "pl.droidsonroids.gif:android-gif-drawable", version.ref = "androidGifDrawable" } 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" } android-image-cropper = { module = "com.vanniktech:android-image-cropper", version.ref = "androidImageCropper" }