|
|
@ -31,14 +31,21 @@ object ImageLoader { |
|
|
|
GlideApp.with(context).load(path) |
|
|
|
GlideApp.with(context).load(path) |
|
|
|
) |
|
|
|
) |
|
|
|
path.isAbsUrl() -> { |
|
|
|
path.isAbsUrl() -> { |
|
|
|
val url = kotlin.runCatching { |
|
|
|
kotlin.runCatching { |
|
|
|
AnalyzeUrl(path).getGlideUrl() |
|
|
|
val url = AnalyzeUrl(path).getGlideUrl() |
|
|
|
}.getOrDefault(path) |
|
|
|
|
|
|
|
GlideApp.with(context).load(url) |
|
|
|
GlideApp.with(context).load(url) |
|
|
|
|
|
|
|
}.getOrDefault( |
|
|
|
|
|
|
|
GlideApp.with(context).load(path) |
|
|
|
|
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
path.isContentScheme() -> GlideApp.with(context).load(Uri.parse(path)) |
|
|
|
path.isContentScheme() -> GlideApp.with(context).load(Uri.parse(path)) |
|
|
|
else -> kotlin.runCatching { |
|
|
|
else -> kotlin.runCatching { |
|
|
|
GlideApp.with(context).load(File(path)) |
|
|
|
val file = File(path) |
|
|
|
|
|
|
|
if (file.exists()) { |
|
|
|
|
|
|
|
GlideApp.with(context).load(file) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
GlideApp.with(context).load(path) |
|
|
|
|
|
|
|
} |
|
|
|
}.getOrElse { |
|
|
|
}.getOrElse { |
|
|
|
GlideApp.with(context).load(path) |
|
|
|
GlideApp.with(context).load(path) |
|
|
|
} |
|
|
|
} |
|
|
|