From c834a5c17a10b5d4e7d470d1845f2f9a174353fb Mon Sep 17 00:00:00 2001 From: duguyihou Date: Wed, 29 May 2024 08:55:39 +1000 Subject: [PATCH] refactor: apply (#209) --- android/src/main/java/com/turboimage/TurboImageViewManager.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android/src/main/java/com/turboimage/TurboImageViewManager.kt b/android/src/main/java/com/turboimage/TurboImageViewManager.kt index e8bb732..d2e98c0 100644 --- a/android/src/main/java/com/turboimage/TurboImageViewManager.kt +++ b/android/src/main/java/com/turboimage/TurboImageViewManager.kt @@ -60,7 +60,7 @@ class TurboImageViewManager : SimpleViewManager() { override fun onAfterUpdateTransaction(view: TurboImageView) { super.onAfterUpdateTransaction(view) - setImageLoader(ImageLoader.Builder(view.context).apply { + ImageLoader.Builder(view.context).apply { respectCacheHeaders(view.cachePolicy == "urlCache") components { add(SvgDecoder.Factory()) @@ -70,7 +70,7 @@ class TurboImageViewManager : SimpleViewManager() { add(GifDecoder.Factory()) } } - }.build()) + }.build().apply { setImageLoader(this) } val diskCacheEnabled = if (view.cachePolicy != "memory") CachePolicy.ENABLED else CachePolicy.DISABLED