do not attempt transforming the fullscreen image if rotation is 0 degrees
This commit is contained in:
parent
71051fe928
commit
ac63a8648d
|
@ -135,14 +135,24 @@ class PhotoFragment : ViewPagerFragment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun loadBitmap(degrees: Float = 0f) {
|
private fun loadBitmap(degrees: Float = 0f) {
|
||||||
Glide.with(this)
|
if (degrees == 0f) {
|
||||||
.load(medium.path)
|
Glide.with(this)
|
||||||
.asBitmap()
|
.load(medium.path)
|
||||||
.transform(GlideRotateTransformation(context, degrees))
|
.asBitmap()
|
||||||
.format(if (medium.isPng()) DecodeFormat.PREFER_ARGB_8888 else DecodeFormat.PREFER_RGB_565)
|
.format(DecodeFormat.PREFER_ARGB_8888)
|
||||||
.thumbnail(0.1f)
|
.thumbnail(0.1f)
|
||||||
.diskCacheStrategy(DiskCacheStrategy.NONE)
|
.diskCacheStrategy(DiskCacheStrategy.NONE)
|
||||||
.into(view.photo_view)
|
.into(view.photo_view)
|
||||||
|
} else {
|
||||||
|
Glide.with(this)
|
||||||
|
.load(medium.path)
|
||||||
|
.asBitmap()
|
||||||
|
.transform(GlideRotateTransformation(context, degrees))
|
||||||
|
.format(DecodeFormat.PREFER_ARGB_8888)
|
||||||
|
.thumbnail(0.1f)
|
||||||
|
.diskCacheStrategy(DiskCacheStrategy.NONE)
|
||||||
|
.into(view.photo_view)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun rotateImageViewBy(degrees: Float) {
|
fun rotateImageViewBy(degrees: Float) {
|
||||||
|
|
Loading…
Reference in New Issue