diff --git a/coil/api/coil.api b/coil/api/coil.api index db3e6061..96dbef9c 100644 --- a/coil/api/coil.api +++ b/coil/api/coil.api @@ -1,10 +1,10 @@ public final class com/skydoves/landscapist/coil/CoilImage { public static final fun CoilImage (Lcoil/request/ImageRequest;Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function2;Landroidx/compose/ui/Alignment;Landroidx/compose/ui/layout/ContentScale;Ljava/lang/String;FLandroidx/compose/ui/graphics/ColorFilter;Lcom/skydoves/landscapist/CircularReveal;Lcom/skydoves/landscapist/ShimmerParams;Lcom/skydoves/landscapist/palette/BitmapPalette;ILkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function4;Landroidx/compose/runtime/Composer;III)V public static final fun CoilImage (Lcoil/request/ImageRequest;Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function2;Landroidx/compose/ui/Alignment;Landroidx/compose/ui/layout/ContentScale;Ljava/lang/String;FLandroidx/compose/ui/graphics/ColorFilter;Lcom/skydoves/landscapist/CircularReveal;Lcom/skydoves/landscapist/palette/BitmapPalette;ILkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function4;Landroidx/compose/runtime/Composer;III)V - public static final fun CoilImage (Ljava/lang/Object;Landroidx/compose/ui/Modifier;Landroid/content/Context;Landroidx/lifecycle/LifecycleOwner;Lkotlin/jvm/functions/Function2;Landroidx/compose/ui/Alignment;FLandroidx/compose/ui/layout/ContentScale;Ljava/lang/String;Lcom/skydoves/landscapist/CircularReveal;Landroidx/compose/ui/graphics/ColorFilter;Lcom/skydoves/landscapist/ShimmerParams;Lcom/skydoves/landscapist/palette/BitmapPalette;Ljava/lang/Object;ILandroidx/compose/runtime/Composer;III)V - public static final fun CoilImage (Ljava/lang/Object;Landroidx/compose/ui/Modifier;Landroid/content/Context;Landroidx/lifecycle/LifecycleOwner;Lkotlin/jvm/functions/Function2;Landroidx/compose/ui/Alignment;FLandroidx/compose/ui/layout/ContentScale;Ljava/lang/String;Lcom/skydoves/landscapist/CircularReveal;Lcom/skydoves/landscapist/palette/BitmapPalette;Landroidx/compose/ui/graphics/ColorFilter;Ljava/lang/Object;Ljava/lang/Object;ILandroidx/compose/runtime/Composer;III)V - public static final fun CoilImage (Ljava/lang/Object;Landroidx/compose/ui/Modifier;Landroid/content/Context;Landroidx/lifecycle/LifecycleOwner;Lkotlin/jvm/functions/Function2;Landroidx/compose/ui/Alignment;Landroidx/compose/ui/layout/ContentScale;Ljava/lang/String;FLandroidx/compose/ui/graphics/ColorFilter;Lcom/skydoves/landscapist/CircularReveal;Lcom/skydoves/landscapist/ShimmerParams;Lcom/skydoves/landscapist/palette/BitmapPalette;ILkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function4;Landroidx/compose/runtime/Composer;III)V - public static final fun CoilImage (Ljava/lang/Object;Landroidx/compose/ui/Modifier;Landroid/content/Context;Landroidx/lifecycle/LifecycleOwner;Lkotlin/jvm/functions/Function2;Landroidx/compose/ui/Alignment;Landroidx/compose/ui/layout/ContentScale;Ljava/lang/String;FLandroidx/compose/ui/graphics/ColorFilter;Lcom/skydoves/landscapist/CircularReveal;Lcom/skydoves/landscapist/palette/BitmapPalette;ILkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function4;Landroidx/compose/runtime/Composer;III)V + public static final fun CoilImage (Ljava/lang/Object;Landroidx/compose/ui/Modifier;Landroid/content/Context;Landroidx/lifecycle/LifecycleOwner;Lkotlin/jvm/functions/Function2;Lcoil/request/ImageRequest$Listener;Landroidx/compose/ui/Alignment;FLandroidx/compose/ui/layout/ContentScale;Ljava/lang/String;Lcom/skydoves/landscapist/CircularReveal;Landroidx/compose/ui/graphics/ColorFilter;Lcom/skydoves/landscapist/ShimmerParams;Lcom/skydoves/landscapist/palette/BitmapPalette;Ljava/lang/Object;ILandroidx/compose/runtime/Composer;III)V + public static final fun CoilImage (Ljava/lang/Object;Landroidx/compose/ui/Modifier;Landroid/content/Context;Landroidx/lifecycle/LifecycleOwner;Lkotlin/jvm/functions/Function2;Lcoil/request/ImageRequest$Listener;Landroidx/compose/ui/Alignment;FLandroidx/compose/ui/layout/ContentScale;Ljava/lang/String;Lcom/skydoves/landscapist/CircularReveal;Lcom/skydoves/landscapist/palette/BitmapPalette;Landroidx/compose/ui/graphics/ColorFilter;Ljava/lang/Object;Ljava/lang/Object;ILandroidx/compose/runtime/Composer;III)V + public static final fun CoilImage (Ljava/lang/Object;Landroidx/compose/ui/Modifier;Landroid/content/Context;Landroidx/lifecycle/LifecycleOwner;Lkotlin/jvm/functions/Function2;Lcoil/request/ImageRequest$Listener;Landroidx/compose/ui/Alignment;Landroidx/compose/ui/layout/ContentScale;Ljava/lang/String;FLandroidx/compose/ui/graphics/ColorFilter;Lcom/skydoves/landscapist/CircularReveal;Lcom/skydoves/landscapist/ShimmerParams;Lcom/skydoves/landscapist/palette/BitmapPalette;ILkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function4;Landroidx/compose/runtime/Composer;III)V + public static final fun CoilImage (Ljava/lang/Object;Landroidx/compose/ui/Modifier;Landroid/content/Context;Landroidx/lifecycle/LifecycleOwner;Lkotlin/jvm/functions/Function2;Lcoil/request/ImageRequest$Listener;Landroidx/compose/ui/Alignment;Landroidx/compose/ui/layout/ContentScale;Ljava/lang/String;FLandroidx/compose/ui/graphics/ColorFilter;Lcom/skydoves/landscapist/CircularReveal;Lcom/skydoves/landscapist/palette/BitmapPalette;ILkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function4;Landroidx/compose/runtime/Composer;III)V } public abstract class com/skydoves/landscapist/coil/CoilImageState { diff --git a/coil/src/main/kotlin/com/skydoves/landscapist/coil/CoilImage.kt b/coil/src/main/kotlin/com/skydoves/landscapist/coil/CoilImage.kt index 82b3df87..49cee4b8 100644 --- a/coil/src/main/kotlin/com/skydoves/landscapist/coil/CoilImage.kt +++ b/coil/src/main/kotlin/com/skydoves/landscapist/coil/CoilImage.kt @@ -85,11 +85,10 @@ import kotlinx.coroutines.suspendCancellableCoroutine * @param context The context for creating the [ImageRequest.Builder]. * @param lifecycleOwner The [LifecycleOwner] for constructing the [ImageRequest.Builder]. * @param imageLoader The [ImageLoader] to use when requesting the image. - * Defaults to [LocalCoilProvider.getCoilImageLoader]. + * @param requestListener A class for monitoring the status of a request while images load. * @param alignment The alignment parameter used to place the loaded [ImageBitmap] in the image container. * @param alpha The alpha parameter used to apply for the image when it is rendered onscreen. - * @param contentScale The scale parameter used to determine the aspect ratio scaling to be - * used for the loaded [ImageBitmap]. + * @param contentScale The scale parameter used to determine the aspect ratio scaling to be used for the loaded [ImageBitmap]. * @param contentDescription The content description used to provide accessibility to describe the image. * @param circularReveal circular reveal parameters for running reveal animation when images are successfully loaded. * @param colorFilter The colorFilter parameter used to apply for the image when it is rendered onscreen. @@ -105,6 +104,7 @@ public fun CoilImage( context: Context = LocalContext.current, lifecycleOwner: LifecycleOwner = LocalLifecycleOwner.current, imageLoader: @Composable () -> ImageLoader = { LocalCoilProvider.getCoilImageLoader() }, + requestListener: ImageRequest.Listener? = null, alignment: Alignment = Alignment.Center, alpha: Float = DefaultAlpha, contentScale: ContentScale = ContentScale.Crop, @@ -121,6 +121,7 @@ public fun CoilImage( context = context, lifecycleOwner = lifecycleOwner, imageLoader = imageLoader, + requestListener = requestListener, modifier = modifier, alignment = alignment, contentScale = contentScale, @@ -169,11 +170,10 @@ public fun CoilImage( * @param context The context for creating the [ImageRequest.Builder]. * @param lifecycleOwner The [LifecycleOwner] for constructing the [ImageRequest.Builder]. * @param imageLoader The [ImageLoader] to use when requesting the image. - * Defaults to [LocalCoilProvider.getCoilImageLoader]. + * @param requestListener A class for monitoring the status of a request while images load. * @param alignment The alignment parameter used to place the loaded [ImageBitmap] in the image container. * @param alpha The alpha parameter used to apply for the image when it is rendered onscreen. - * @param contentScale The scale parameter used to determine the aspect ratio scaling to be - * used for the loaded [ImageBitmap]. + * @param contentScale The scale parameter used to determine the aspect ratio scaling to be used for the loaded [ImageBitmap]. * @param contentDescription The content description used to provide accessibility to describe the image. * @param circularReveal circular reveal parameters for running reveal animation when images are successfully loaded. * @param bitmapPalette A [Palette] generator for extracting major (theme) colors from images. @@ -189,6 +189,7 @@ public fun CoilImage( context: Context = LocalContext.current, lifecycleOwner: LifecycleOwner = LocalLifecycleOwner.current, imageLoader: @Composable () -> ImageLoader = { LocalCoilProvider.getCoilImageLoader() }, + requestListener: ImageRequest.Listener? = null, alignment: Alignment = Alignment.Center, alpha: Float = DefaultAlpha, contentScale: ContentScale = ContentScale.Crop, @@ -205,6 +206,7 @@ public fun CoilImage( context = context, lifecycleOwner = lifecycleOwner, imageLoader = imageLoader, + requestListener = requestListener, modifier = modifier, alignment = alignment, contentScale = contentScale, @@ -263,11 +265,10 @@ public fun CoilImage( * @param context The context for creating the [ImageRequest.Builder]. * @param lifecycleOwner The [LifecycleOwner] for constructing the [ImageRequest.Builder]. * @param imageLoader The [ImageLoader] to use when requesting the image. - * Defaults to [LocalCoilProvider.getCoilImageLoader]. + * @param requestListener A class for monitoring the status of a request while images load. * @param alignment The alignment parameter used to place the loaded [ImageBitmap] in the image container. * @param alpha The alpha parameter used to apply for the image when it is rendered onscreen. - * @param contentScale The scale parameter used to determine the aspect ratio scaling to be - * used for the loaded [ImageBitmap]. + * @param contentScale The scale parameter used to determine the aspect ratio scaling to be used for the loaded [ImageBitmap]. * @param contentDescription The content description used to provide accessibility to describe the image. * @param circularReveal circular reveal parameters for running reveal animation when images are successfully loaded. * @param bitmapPalette A [Palette] generator for extracting major (theme) colors from images. @@ -283,6 +284,7 @@ public fun CoilImage( context: Context = LocalContext.current, lifecycleOwner: LifecycleOwner = LocalLifecycleOwner.current, imageLoader: @Composable () -> ImageLoader = { LocalCoilProvider.getCoilImageLoader() }, + requestListener: ImageRequest.Listener? = null, alignment: Alignment = Alignment.Center, contentScale: ContentScale = ContentScale.Crop, contentDescription: String? = null, @@ -298,6 +300,7 @@ public fun CoilImage( CoilImage( imageRequest = ImageRequest.Builder(context) .data(imageModel) + .listener(requestListener) .lifecycle(lifecycleOwner) .build(), imageLoader = imageLoader, @@ -340,11 +343,10 @@ public fun CoilImage( * @param context The context for creating the [ImageRequest.Builder]. * @param lifecycleOwner The [LifecycleOwner] for constructing the [ImageRequest.Builder]. * @param imageLoader The [ImageLoader] to use when requesting the image. - * Defaults to [LocalCoilProvider.getCoilImageLoader]. + * @param requestListener A class for monitoring the status of a request while images load. * @param alignment The alignment parameter used to place the loaded [ImageBitmap] in the image container. * @param alpha The alpha parameter used to apply for the image when it is rendered onscreen. - * @param contentScale The scale parameter used to determine the aspect ratio scaling to be - * used for the loaded [ImageBitmap]. + * @param contentScale The scale parameter used to determine the aspect ratio scaling to be used for the loaded [ImageBitmap]. * @param contentDescription The content description used to provide accessibility to describe the image. * @param circularReveal circular reveal parameters for running reveal animation when images are successfully loaded. * @param bitmapPalette A [Palette] generator for extracting major (theme) colors from images. @@ -361,6 +363,7 @@ public fun CoilImage( context: Context = LocalContext.current, lifecycleOwner: LifecycleOwner = LocalLifecycleOwner.current, imageLoader: @Composable () -> ImageLoader = { LocalCoilProvider.getCoilImageLoader() }, + requestListener: ImageRequest.Listener? = null, alignment: Alignment = Alignment.Center, contentScale: ContentScale = ContentScale.Crop, contentDescription: String? = null, @@ -376,6 +379,7 @@ public fun CoilImage( CoilImage( imageRequest = ImageRequest.Builder(context) .data(imageModel) + .listener(requestListener) .lifecycle(lifecycleOwner) .build(), imageLoader = imageLoader, @@ -416,11 +420,9 @@ public fun CoilImage( * @param imageRequest The request to execute. * @param modifier [Modifier] used to adjust the layout or drawing content. * @param imageLoader The [ImageLoader] to use when requesting the image. - * Defaults to [LocalCoilProvider.getCoilImageLoader]. * @param alignment The alignment parameter used to place the loaded [ImageBitmap] in the image container. * @param alpha The alpha parameter used to apply for the image when it is rendered onscreen. - * @param contentScale The scale parameter used to determine the aspect ratio scaling to be - * used for the loaded [ImageBitmap]. + * @param contentScale The scale parameter used to determine the aspect ratio scaling to be used for the loaded [ImageBitmap]. * @param contentDescription The content description used to provide accessibility to describe the image. * @param circularReveal circular reveal parameters for running reveal animation when images are successfully loaded. * @param bitmapPalette A [Palette] generator for extracting major (theme) colors from images. @@ -525,11 +527,9 @@ public fun CoilImage( * @param imageRequest The request to execute. * @param modifier [Modifier] used to adjust the layout or drawing content. * @param imageLoader The [ImageLoader] to use when requesting the image. - * Defaults to [LocalCoilProvider.getCoilImageLoader]. * @param alignment The alignment parameter used to place the loaded [ImageBitmap] in the image container. * @param alpha The alpha parameter used to apply for the image when it is rendered onscreen. - * @param contentScale The scale parameter used to determine the aspect ratio scaling to be - * used for the loaded [ImageBitmap]. + * @param contentScale The scale parameter used to determine the aspect ratio scaling to be used for the loaded [ImageBitmap]. * @param contentDescription The content description used to provide accessibility to describe the image. * @param circularReveal circular reveal parameters for running reveal animation when images are successfully loaded. * @param bitmapPalette A [Palette] generator for extracting major (theme) colors from images. diff --git a/dependencies.gradle b/dependencies.gradle index 95548875..2cc86d6a 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -4,22 +4,16 @@ ext.versions = [ versionCode : 30, versionName : '1.3.0', - gradleBuildTool : '7.1.0', + gradleBuildTool : '7.1.2', spotlessGradle : '6.2.1', dokkaGradle : '1.6.0', binaryValidator : '0.8.0', - mavenPublish : '0.18.0', - - // di - hiltCoreVersion : '2.40.5', + mavenPublish : '0.19.0', kotlin : '1.6.10', coreKtxVersion : '1.5.0-beta01', composeVersion : '1.1.1', - constraintVersion: '1.0.0-alpha07', - activityVersion : '1.3.0-alpha08', coroutinesVersion: '1.6.0', - multidex : '2.0.1', frescoVersion : '2.6.0', glideVersion : '4.13.0', @@ -33,6 +27,7 @@ ext.versions = [ androidxTestJunit: '1.1.3', // for demo + hiltCoreVersion : '2.40.5', constraintVersion: '1.0.0-alpha07', activityVersion : '1.3.0-alpha08', multidex : '2.0.1',