mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-23 13:08:00 +01:00
updating SubsamplingScaleImageView to 4.0.0
This commit is contained in:
parent
f91f1819b0
commit
87436720b8
2 changed files with 19 additions and 7 deletions
|
@ -57,7 +57,7 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'com.simplemobiletools:commons:5.5.4'
|
implementation 'com.simplemobiletools:commons:5.5.15'
|
||||||
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
|
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
|
||||||
implementation 'androidx.multidex:multidex:2.0.0'
|
implementation 'androidx.multidex:multidex:2.0.0'
|
||||||
implementation 'it.sephiroth.android.exif:library:1.0.1'
|
implementation 'it.sephiroth.android.exif:library:1.0.1'
|
||||||
|
@ -77,7 +77,8 @@ dependencies {
|
||||||
annotationProcessor 'androidx.room:room-compiler:2.0.0'
|
annotationProcessor 'androidx.room:room-compiler:2.0.0'
|
||||||
|
|
||||||
//implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.10.0'
|
//implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.10.0'
|
||||||
implementation 'com.github.tibbi:subsampling-scale-image-view:v3.10.1-fork'
|
//implementation 'com.github.tibbi:subsampling-scale-image-view:v3.10.1-fork'
|
||||||
|
implementation 'com.github.tibbi:subsampling-scale-image-view:4.0.0'
|
||||||
|
|
||||||
// implementation 'com.github.chrisbanes:PhotoView:2.1.4'
|
// implementation 'com.github.chrisbanes:PhotoView:2.1.4'
|
||||||
implementation 'com.github.tibbi:PhotoView:2.2.1-fork'
|
implementation 'com.github.tibbi:PhotoView:2.2.1-fork'
|
||||||
|
|
|
@ -26,6 +26,9 @@ import com.bumptech.glide.request.RequestListener
|
||||||
import com.bumptech.glide.request.RequestOptions
|
import com.bumptech.glide.request.RequestOptions
|
||||||
import com.davemorrissey.labs.subscaleview.ImageSource
|
import com.davemorrissey.labs.subscaleview.ImageSource
|
||||||
import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView
|
import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView
|
||||||
|
import com.davemorrissey.labs.subscaleview.decoder.DecoderFactory
|
||||||
|
import com.davemorrissey.labs.subscaleview.decoder.ImageDecoder
|
||||||
|
import com.davemorrissey.labs.subscaleview.decoder.ImageRegionDecoder
|
||||||
import com.simplemobiletools.commons.extensions.*
|
import com.simplemobiletools.commons.extensions.*
|
||||||
import com.simplemobiletools.commons.helpers.OTG_PATH
|
import com.simplemobiletools.commons.helpers.OTG_PATH
|
||||||
import com.simplemobiletools.gallery.pro.R
|
import com.simplemobiletools.gallery.pro.R
|
||||||
|
@ -377,18 +380,26 @@ class PhotoFragment : ViewPagerFragment() {
|
||||||
val path = getPathToLoad(medium)
|
val path = getPathToLoad(medium)
|
||||||
isSubsamplingVisible = true
|
isSubsamplingVisible = true
|
||||||
|
|
||||||
|
val bitmapDecoder = object : DecoderFactory<ImageDecoder> {
|
||||||
|
override fun make() = PicassoDecoder(path, Picasso.get(), rotation)
|
||||||
|
}
|
||||||
|
|
||||||
|
val regionDecoder = object : DecoderFactory<ImageRegionDecoder> {
|
||||||
|
override fun make() = PicassoRegionDecoder()
|
||||||
|
}
|
||||||
|
|
||||||
view.subsampling_view.apply {
|
view.subsampling_view.apply {
|
||||||
setMaxTileSize(if (context!!.config.showHighestQuality) Integer.MAX_VALUE else 4096)
|
setMaxTileSize(if (context!!.config.showHighestQuality) Integer.MAX_VALUE else 4096)
|
||||||
setMinimumTileDpi(if (context!!.config.showHighestQuality) -1 else getMinTileDpi())
|
setMinimumTileDpi(if (context!!.config.showHighestQuality) -1 else getMinTileDpi())
|
||||||
background = ColorDrawable(Color.TRANSPARENT)
|
background = ColorDrawable(Color.TRANSPARENT)
|
||||||
setBitmapDecoderFactory { PicassoDecoder(path, Picasso.get(), rotation) }
|
setBitmapDecoderFactory(bitmapDecoder)
|
||||||
setRegionDecoderFactory { PicassoRegionDecoder() }
|
setRegionDecoderFactory(regionDecoder)
|
||||||
maxScale = 10f
|
maxScale = 10f
|
||||||
beVisible()
|
beVisible()
|
||||||
isQuickScaleEnabled = context.config.oneFingerZoom
|
isQuickScaleEnabled = context.config.oneFingerZoom
|
||||||
setResetScaleOnSizeChange(false)
|
setResetScaleOnSizeChange(false)
|
||||||
setImage(ImageSource.uri(path))
|
setImage(ImageSource.uri(path))
|
||||||
orientation = rotation
|
setOrientation(rotation)
|
||||||
setEagerLoadingEnabled(false)
|
setEagerLoadingEnabled(false)
|
||||||
setOnImageEventListener(object : SubsamplingScaleImageView.OnImageEventListener {
|
setOnImageEventListener(object : SubsamplingScaleImageView.OnImageEventListener {
|
||||||
override fun onImageLoaded() {
|
override fun onImageLoaded() {
|
||||||
|
@ -402,7 +413,7 @@ class PhotoFragment : ViewPagerFragment() {
|
||||||
mOriginalSubsamplingScale = scale
|
mOriginalSubsamplingScale = scale
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onTileLoadError(e: Exception?) {
|
override fun onTileLoadError(e: Exception) {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onPreviewReleased() {
|
override fun onPreviewReleased() {
|
||||||
|
@ -415,7 +426,7 @@ class PhotoFragment : ViewPagerFragment() {
|
||||||
beGone()
|
beGone()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onPreviewLoadError(e: Exception?) {
|
override fun onPreviewLoadError(e: Exception) {
|
||||||
background = ColorDrawable(Color.TRANSPARENT)
|
background = ColorDrawable(Color.TRANSPARENT)
|
||||||
isSubsamplingVisible = false
|
isSubsamplingVisible = false
|
||||||
beGone()
|
beGone()
|
||||||
|
|
Loading…
Reference in a new issue