From d542a24613e04b8c45f1238516d053edab711253 Mon Sep 17 00:00:00 2001 From: Ignacio Ruiz Date: Mon, 15 Jul 2024 15:36:26 +0200 Subject: [PATCH 1/2] Document Coil package --- docs/filepicker.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/filepicker.md b/docs/filepicker.md index aa6f5f8..5bb3925 100644 --- a/docs/filepicker.md +++ b/docs/filepicker.md @@ -162,3 +162,23 @@ val file: java.io.File = kmpFile.file ```kotlin val file: org.w3c.files.File = kmpFile.file ``` + +#### Coil etensions + +In case you're using [Coil](https://github.com/coil-kt/coil) in your project, Calf has a dedicated package that includes utilities to ease the integration between both libraries. + +You can use it by adding the following dependency to your module `build.gradle.kts` file: + +```kotlin +implementation("com.mohamedrejeb.calf:calf-file-picker-coil:0.5.1") +``` + +Currently, this package contains a `KmpFileFetcher` that you can use to let Coil know how to load a [KmpFile] by adding it to Coil's `ImageLoader`: + +```kotlin +ImageLoader.Builder(context) + .components { add(KmpFileFetcher.Factory()) } + .build() +``` + +For more info regarding how to extend the Image Pipeline in Coil, you can read [here](https://coil-kt.github.io/coil/image_pipeline/). \ No newline at end of file From 175f514468d31ff8dba3460e0e8ffdc542347de4 Mon Sep 17 00:00:00 2001 From: Ignacio Ruiz Date: Mon, 15 Jul 2024 15:38:24 +0200 Subject: [PATCH 2/2] Remove useless code redirection --- docs/filepicker.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/filepicker.md b/docs/filepicker.md index 5bb3925..ea513a2 100644 --- a/docs/filepicker.md +++ b/docs/filepicker.md @@ -173,7 +173,7 @@ You can use it by adding the following dependency to your module `build.gradle.k implementation("com.mohamedrejeb.calf:calf-file-picker-coil:0.5.1") ``` -Currently, this package contains a `KmpFileFetcher` that you can use to let Coil know how to load a [KmpFile] by adding it to Coil's `ImageLoader`: +Currently, this package contains a `KmpFileFetcher` that you can use to let Coil know how to load a KmpFile by adding it to Coil's `ImageLoader`: ```kotlin ImageLoader.Builder(context)