Skip to content

Commit

Permalink
refactor: apply (#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
duguyihou authored May 28, 2024
1 parent 3a9883b commit c834a5c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions android/src/main/java/com/turboimage/TurboImageViewManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class TurboImageViewManager : SimpleViewManager<TurboImageView>() {
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())
Expand All @@ -70,7 +70,7 @@ class TurboImageViewManager : SimpleViewManager<TurboImageView>() {
add(GifDecoder.Factory())
}
}
}.build())
}.build().apply { setImageLoader(this) }

val diskCacheEnabled =
if (view.cachePolicy != "memory") CachePolicy.ENABLED else CachePolicy.DISABLED
Expand Down

0 comments on commit c834a5c

Please sign in to comment.