mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2025-01-18 14:28:00 +01:00
feed the Glide bitmap to subsamplingScaleImageview
This commit is contained in:
parent
a94d027388
commit
609e341b81
1 changed files with 4 additions and 4 deletions
|
@ -153,9 +153,9 @@ class PhotoFragment : ViewPagerFragment() {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onResourceReady(bitmap: Bitmap?, model: String?, target: Target<Bitmap>?, isFromMemoryCache: Boolean, isFirstResource: Boolean): Boolean {
|
override fun onResourceReady(bitmap: Bitmap, model: String?, target: Target<Bitmap>?, isFromMemoryCache: Boolean, isFirstResource: Boolean): Boolean {
|
||||||
if (degrees == 0f) {
|
if (degrees == 0f) {
|
||||||
addZoomableView()
|
addZoomableView(bitmap)
|
||||||
} else {
|
} else {
|
||||||
photo_view.beVisible()
|
photo_view.beVisible()
|
||||||
subsampling_view.beGone()
|
subsampling_view.beGone()
|
||||||
|
@ -169,12 +169,12 @@ class PhotoFragment : ViewPagerFragment() {
|
||||||
loadBitmap(degrees)
|
loadBitmap(degrees)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun addZoomableView() {
|
private fun addZoomableView(bitmap: Bitmap) {
|
||||||
if (!medium.isPng()) {
|
if (!medium.isPng()) {
|
||||||
subsamplingView.apply {
|
subsamplingView.apply {
|
||||||
beVisible()
|
beVisible()
|
||||||
setDoubleTapZoomScale(1.2f)
|
setDoubleTapZoomScale(1.2f)
|
||||||
setImage(ImageSource.uri(medium.path))
|
setImage(ImageSource.cachedBitmap(bitmap))
|
||||||
orientation = SubsamplingScaleImageView.ORIENTATION_USE_EXIF
|
orientation = SubsamplingScaleImageView.ORIENTATION_USE_EXIF
|
||||||
maxScale = 5f
|
maxScale = 5f
|
||||||
setOnImageEventListener(object : SubsamplingScaleImageView.OnImageEventListener {
|
setOnImageEventListener(object : SubsamplingScaleImageView.OnImageEventListener {
|
||||||
|
|
Loading…
Reference in a new issue