mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2024-12-17 19:18:31 +01:00
fix some errors at loading fullscreen images
This commit is contained in:
parent
259f517a18
commit
eeaf854144
@ -156,12 +156,14 @@ class PhotoFragment : ViewPagerFragment() {
|
|||||||
|
|
||||||
private fun loadBitmap(degrees: Float = 0f) {
|
private fun loadBitmap(degrees: Float = 0f) {
|
||||||
if (degrees == 0f) {
|
if (degrees == 0f) {
|
||||||
|
val targetWidth = if (ViewPagerActivity.screenWidth == 0) Target.SIZE_ORIGINAL else ViewPagerActivity.screenWidth
|
||||||
|
val targetHeight = if (ViewPagerActivity.screenHeight == 0) Target.SIZE_ORIGINAL else ViewPagerActivity.screenHeight
|
||||||
Glide.with(this)
|
Glide.with(this)
|
||||||
.load(medium.path)
|
.load(medium.path)
|
||||||
.asBitmap()
|
.asBitmap()
|
||||||
.format(DecodeFormat.PREFER_ARGB_8888)
|
.format(DecodeFormat.PREFER_ARGB_8888)
|
||||||
.diskCacheStrategy(DiskCacheStrategy.NONE)
|
.diskCacheStrategy(DiskCacheStrategy.NONE)
|
||||||
.override(ViewPagerActivity.screenWidth, ViewPagerActivity.screenHeight)
|
.override(targetWidth, targetHeight)
|
||||||
.listener(object : RequestListener<String, Bitmap> {
|
.listener(object : RequestListener<String, Bitmap> {
|
||||||
override fun onException(e: java.lang.Exception?, model: String?, target: Target<Bitmap>?, isFirstResource: Boolean): Boolean {
|
override fun onException(e: java.lang.Exception?, model: String?, target: Target<Bitmap>?, isFirstResource: Boolean): Boolean {
|
||||||
return false
|
return false
|
||||||
|
Loading…
Reference in New Issue
Block a user