mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 22:47:59 +01:00
increase the image load priority of initially opened images
This commit is contained in:
parent
19d4ff53cb
commit
aa55dfbb15
1 changed files with 3 additions and 0 deletions
|
@ -10,6 +10,7 @@ import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import com.bumptech.glide.Glide
|
import com.bumptech.glide.Glide
|
||||||
|
import com.bumptech.glide.Priority
|
||||||
import com.bumptech.glide.load.engine.DiskCacheStrategy
|
import com.bumptech.glide.load.engine.DiskCacheStrategy
|
||||||
import com.simplemobiletools.commons.extensions.beGone
|
import com.simplemobiletools.commons.extensions.beGone
|
||||||
import com.simplemobiletools.commons.extensions.beVisible
|
import com.simplemobiletools.commons.extensions.beVisible
|
||||||
|
@ -124,6 +125,7 @@ class PhotoFragment : ViewPagerFragment() {
|
||||||
.load(medium.path)
|
.load(medium.path)
|
||||||
.asGif()
|
.asGif()
|
||||||
.crossFade()
|
.crossFade()
|
||||||
|
.priority(if (isFragmentVisible) Priority.IMMEDIATE else Priority.LOW)
|
||||||
.diskCacheStrategy(DiskCacheStrategy.SOURCE)
|
.diskCacheStrategy(DiskCacheStrategy.SOURCE)
|
||||||
.into(view.gif_holder)
|
.into(view.gif_holder)
|
||||||
} else {
|
} else {
|
||||||
|
@ -135,6 +137,7 @@ class PhotoFragment : ViewPagerFragment() {
|
||||||
Picasso.with(activity)
|
Picasso.with(activity)
|
||||||
.load("file:${medium.path}")
|
.load("file:${medium.path}")
|
||||||
.resize(ViewPagerActivity.screenWidth * 2, ViewPagerActivity.screenHeight * 2)
|
.resize(ViewPagerActivity.screenWidth * 2, ViewPagerActivity.screenHeight * 2)
|
||||||
|
.priority(if (isFragmentVisible) Picasso.Priority.HIGH else Picasso.Priority.LOW)
|
||||||
.rotate(degrees)
|
.rotate(degrees)
|
||||||
.centerInside()
|
.centerInside()
|
||||||
.into(view.photo_view)
|
.into(view.photo_view)
|
||||||
|
|
Loading…
Reference in a new issue