Glide cache improvement for non encrypted files
This commit is contained in:
parent
d2004978f3
commit
2215cb4621
2 changed files with 4 additions and 5 deletions
|
@ -321,7 +321,7 @@ fun loadAvatarWithGlideFallback(imageView: ImageView, path: String?) {
|
||||||
@BindingAdapter("glidePath")
|
@BindingAdapter("glidePath")
|
||||||
fun loadImageWithGlide(imageView: ImageView, path: String) {
|
fun loadImageWithGlide(imageView: ImageView, path: String) {
|
||||||
if (path.isNotEmpty() && FileUtils.isExtensionImage(path)) {
|
if (path.isNotEmpty() && FileUtils.isExtensionImage(path)) {
|
||||||
if (corePreferences.vfsEnabled) {
|
if (corePreferences.vfsEnabled && path.endsWith(FileUtils.VFS_PLAIN_FILE_EXTENSION)) {
|
||||||
GlideApp.with(imageView)
|
GlideApp.with(imageView)
|
||||||
.load(path)
|
.load(path)
|
||||||
.diskCacheStrategy(DiskCacheStrategy.NONE)
|
.diskCacheStrategy(DiskCacheStrategy.NONE)
|
||||||
|
@ -347,9 +347,8 @@ fun loadAvatarWithGlide(imageView: ImageView, path: String?) {
|
||||||
.with(imageView)
|
.with(imageView)
|
||||||
.load(path)
|
.load(path)
|
||||||
.signature(ObjectKey(coreContext.contactsManager.latestContactFetch))
|
.signature(ObjectKey(coreContext.contactsManager.latestContactFetch))
|
||||||
.apply(RequestOptions.circleCropTransform()).listener(
|
.apply(RequestOptions.circleCropTransform())
|
||||||
object :
|
.listener(object : RequestListener<Drawable?> {
|
||||||
RequestListener<Drawable?> {
|
|
||||||
override fun onLoadFailed(
|
override fun onLoadFailed(
|
||||||
e: GlideException?,
|
e: GlideException?,
|
||||||
model: Any?,
|
model: Any?,
|
||||||
|
|
|
@ -43,7 +43,7 @@ import org.linphone.core.tools.Log
|
||||||
|
|
||||||
class FileUtils {
|
class FileUtils {
|
||||||
companion object {
|
companion object {
|
||||||
private const val VFS_PLAIN_FILE_EXTENSION = ".bctbx_evfs_plain"
|
const val VFS_PLAIN_FILE_EXTENSION = ".bctbx_evfs_plain"
|
||||||
|
|
||||||
fun getNameFromFilePath(filePath: String): String {
|
fun getNameFromFilePath(filePath: String): String {
|
||||||
var name = filePath
|
var name = filePath
|
||||||
|
|
Loading…
Reference in a new issue