mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-06-05 21:59:19 +02:00
let's try using GlideDecoder at fullscreen media
This commit is contained in:
@@ -46,7 +46,7 @@ ext {
|
||||
|
||||
dependencies {
|
||||
compile 'com.simplemobiletools:commons:2.37.6'
|
||||
compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0'
|
||||
compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.7.2'
|
||||
compile 'com.theartofdev.edmodo:android-image-cropper:2.4.0'
|
||||
compile 'com.bignerdranch.android:recyclerview-multiselect:0.2'
|
||||
compile 'com.google.code.gson:gson:2.8.2'
|
||||
|
@@ -27,6 +27,7 @@ import com.simplemobiletools.gallery.R
|
||||
import com.simplemobiletools.gallery.activities.PhotoActivity
|
||||
import com.simplemobiletools.gallery.activities.ViewPagerActivity
|
||||
import com.simplemobiletools.gallery.extensions.*
|
||||
import com.simplemobiletools.gallery.helpers.GlideDecoder
|
||||
import com.simplemobiletools.gallery.helpers.GlideRotateTransformation
|
||||
import com.simplemobiletools.gallery.helpers.MEDIUM
|
||||
import com.simplemobiletools.gallery.models.Medium
|
||||
@@ -226,7 +227,7 @@ class PhotoFragment : ViewPagerFragment() {
|
||||
private fun addZoomableView() {
|
||||
if ((medium.isImage()) && isFragmentVisible && view.subsampling_view.visibility == View.GONE) {
|
||||
view.subsampling_view.apply {
|
||||
//setBitmapDecoderClass(GlideDecoder::class.java) // causing random crashes on Android 7+
|
||||
setBitmapDecoderClass(GlideDecoder::class.java) // was causing random crashes on Android 7+
|
||||
maxScale = 10f
|
||||
beVisible()
|
||||
setImage(ImageSource.uri(medium.path))
|
||||
|
@@ -42,10 +42,8 @@ class GlideDecoder : ImageDecoder {
|
||||
}
|
||||
|
||||
private fun drawableToBitmap(drawable: Drawable): Bitmap {
|
||||
if (drawable is BitmapDrawable) {
|
||||
if (drawable.bitmap != null) {
|
||||
return drawable.bitmap
|
||||
}
|
||||
if (drawable is BitmapDrawable && drawable.bitmap != null) {
|
||||
return drawable.bitmap
|
||||
}
|
||||
|
||||
val bitmap = if (drawable.intrinsicWidth <= 0 || drawable.intrinsicHeight <= 0) {
|
||||
|
Reference in New Issue
Block a user