Skip to content

Commit

Permalink
Merge pull request #201 from skydoves/remove/deprecated
Browse files Browse the repository at this point in the history
Remove deprecated GlideImage and CoilImage Composables
  • Loading branch information
skydoves authored Nov 12, 2022
2 parents e0b56b4 + ea93ba5 commit be595bc
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 143 deletions.
3 changes: 0 additions & 3 deletions coil/api/coil.api
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
public final class com/skydoves/landscapist/coil/CoilImage {
public static final fun CoilImage (Ljava/lang/Object;Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function2;Lcom/skydoves/landscapist/components/ImageComponent;Lkotlin/jvm/functions/Function0;Lcom/skydoves/landscapist/ImageOptions;Lkotlin/jvm/functions/Function1;ILkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function4;Landroidx/compose/runtime/Composer;III)V
public static final fun CoilImage (Lkotlin/jvm/functions/Function0;Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function2;Lcom/skydoves/landscapist/components/ImageComponent;Lcom/skydoves/landscapist/ImageOptions;Lkotlin/jvm/functions/Function1;ILkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function4;Landroidx/compose/runtime/Composer;II)V
public static final fun CoilImage (Lkotlin/jvm/functions/Function0;Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function2;Lcom/skydoves/landscapist/components/ImageComponent;Lkotlin/jvm/functions/Function0;Lcom/skydoves/landscapist/ImageOptions;Lkotlin/jvm/functions/Function1;ILkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function4;Landroidx/compose/runtime/Composer;III)V
}
Expand Down Expand Up @@ -50,11 +49,9 @@ public final class com/skydoves/landscapist/coil/ComposableSingletons$CoilImageK
public static final field INSTANCE Lcom/skydoves/landscapist/coil/ComposableSingletons$CoilImageKt;
public static field lambda-1 Lkotlin/jvm/functions/Function3;
public static field lambda-2 Lkotlin/jvm/functions/Function3;
public static field lambda-3 Lkotlin/jvm/functions/Function3;
public fun <init> ()V
public final fun getLambda-1$coil_release ()Lkotlin/jvm/functions/Function3;
public final fun getLambda-2$coil_release ()Lkotlin/jvm/functions/Function3;
public final fun getLambda-3$coil_release ()Lkotlin/jvm/functions/Function3;
}

public final class com/skydoves/landscapist/coil/LocalCoilProviderKt {
Expand Down
65 changes: 0 additions & 65 deletions coil/src/main/kotlin/com/skydoves/landscapist/coil/CoilImage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -62,71 +62,6 @@ import kotlinx.coroutines.channels.trySendBlocking
import kotlinx.coroutines.flow.channelFlow
import okhttp3.HttpUrl

/**
* Load and render an image with the given [imageModel] from the network or local storage.
*
*
* @param imageModel The data model to request image. See [ImageRequest.Builder.data] for types allowed.
* @param modifier [Modifier] used to adjust the layout or drawing content.
* @param imageLoader The [ImageLoader] to use when requesting the image.
* @param component An image component that conjuncts pluggable [ImagePlugin]s.
* @param requestListener A class for monitoring the status of a request while images load.
* @param imageOptions Represents parameters to load generic [Image] Composable.
* @param onImageStateChanged An image state change listener will be triggered whenever the image state is changed.
* @param previewPlaceholder Drawable resource ID which will be displayed when this function is ran in preview mode.
* @param loading Content to be displayed when the request is in progress.
* @param success Content to be displayed when the request is succeeded.
* @param failure Content to be displayed when the request is failed.
*/
@Composable
@Deprecated(
message = "Use CoilImage(imageModel = { imageModel }..) " +
"for improving recomposition performance.",
replaceWith = ReplaceWith(
"" +
"CoilImage(\n" +
" imageModel = { imageModel },\n" +
" modifier = modifier,\n" +
" imageLoader = imageLoader,\n" +
" component = component,\n" +
" requestListener = requestListener,\n" +
" imageOptions = imageOptions,\n" +
" onImageStateChanged = onImageStateChanged,\n" +
" previewPlaceholder = previewPlaceholder,\n" +
" loading = loading,\n" +
" success = success,\n" +
" failure = failure\n" +
" )"
)
)
public fun CoilImage(
imageModel: Any?,
modifier: Modifier = Modifier,
imageLoader: @Composable () -> ImageLoader = { LocalCoilProvider.getCoilImageLoader() },
component: ImageComponent = rememberImageComponent {},
requestListener: (() -> ImageRequest.Listener)? = null,
imageOptions: ImageOptions = ImageOptions(),
onImageStateChanged: (CoilImageState) -> Unit = {},
@DrawableRes previewPlaceholder: Int = 0,
loading: @Composable (BoxScope.(imageState: CoilImageState.Loading) -> Unit)? = null,
success: @Composable (BoxScope.(imageState: CoilImageState.Success) -> Unit)? = null,
failure: @Composable (BoxScope.(imageState: CoilImageState.Failure) -> Unit)? = null
) {
CoilImage(
imageModel = { imageModel },
modifier = modifier,
imageLoader = imageLoader,
component = component,
requestListener = requestListener,
imageOptions = imageOptions,
onImageStateChanged = onImageStateChanged,
previewPlaceholder = previewPlaceholder,
loading = loading,
success = success,
failure = failure
)
}

/**
* Load and render an image with the given [imageModel] from the network or local storage.
*
Expand Down
3 changes: 0 additions & 3 deletions glide/api/glide.api
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
public final class com/skydoves/landscapist/glide/ComposableSingletons$GlideImageKt {
public static final field INSTANCE Lcom/skydoves/landscapist/glide/ComposableSingletons$GlideImageKt;
public static field lambda-1 Lkotlin/jvm/functions/Function3;
public static field lambda-2 Lkotlin/jvm/functions/Function3;
public fun <init> ()V
public final fun getLambda-1$glide_release ()Lkotlin/jvm/functions/Function3;
public final fun getLambda-2$glide_release ()Lkotlin/jvm/functions/Function3;
}

public final class com/skydoves/landscapist/glide/GlideImage {
public static final fun GlideImage (Ljava/lang/Object;Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function0;Lcom/skydoves/landscapist/components/ImageComponent;Lcom/skydoves/landscapist/ImageOptions;Lkotlin/jvm/functions/Function1;ILkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function4;Landroidx/compose/runtime/Composer;III)V
public static final fun GlideImage (Lkotlin/jvm/functions/Function0;Landroidx/compose/ui/Modifier;Lcom/skydoves/landscapist/glide/GlideRequestType;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function0;Lcom/skydoves/landscapist/components/ImageComponent;Lcom/skydoves/landscapist/ImageOptions;Lkotlin/jvm/functions/Function1;ILkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function4;Landroidx/compose/runtime/Composer;III)V
}

Expand Down
72 changes: 0 additions & 72 deletions glide/src/main/kotlin/com/skydoves/landscapist/glide/GlideImage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -55,78 +55,6 @@ import com.skydoves.landscapist.rememberDrawablePainter
import kotlinx.coroutines.channels.awaitClose
import kotlinx.coroutines.flow.callbackFlow

/**
* Load and render an image with the given [imageModel] from the network or local storage.
*
* @param imageModel The data model to request image. See [RequestBuilder.load] for types allowed.
* @param modifier [Modifier] used to adjust the layout or drawing content.
* @param requestBuilder Most options in Glide can be applied directly on the RequestBuilder object returned by Glide.with().
* @param requestOptions Provides type independent options to customize loads with Glide.
* @param requestListener A class for monitoring the status of a request while images load.
* @param component An image component that conjuncts pluggable [ImagePlugin]s.
* @param imageOptions Represents parameters to load generic [Image] Composable.
* @param onImageStateChanged An image state change listener will be triggered whenever the image state is changed.
* @param previewPlaceholder Drawable resource ID which will be displayed when this function is ran in preview mode.
* @param loading Content to be displayed when the request is in progress.
* @param success Content to be displayed when the request is succeeded.
* @param failure Content to be displayed when the request is failed.
*/
@Deprecated(
message = "Use GlideImage(imageModel = { imageModel }..) " +
"for improving recomposition performance.",
replaceWith = ReplaceWith(
"" +
"GlideImage(\n" +
" imageModel = { imageModel },\n" +
" modifier = modifier,\n" +
" requestBuilder = requestBuilder,\n" +
" requestOptions = requestOptions,\n" +
" requestListener = requestListener,\n" +
" component = component,\n" +
" imageOptions = imageOptions,\n" +
" onImageStateChanged = onImageStateChanged,\n" +
" previewPlaceholder = previewPlaceholder,\n" +
" loading = loading,\n" +
" success = success,\n" +
" failure = failure\n" +
" )"
)
)
@Composable
public fun GlideImage(
imageModel: Any?,
modifier: Modifier = Modifier,
requestBuilder: @Composable () -> RequestBuilder<*> = {
LocalGlideProvider.getGlideRequestBuilder()
},
requestOptions: @Composable () -> RequestOptions = {
LocalGlideProvider.getGlideRequestOptions()
},
requestListener: (() -> RequestListener<Any>)? = null,
component: ImageComponent = rememberImageComponent {},
imageOptions: ImageOptions = ImageOptions(),
onImageStateChanged: (GlideImageState) -> Unit = {},
@DrawableRes previewPlaceholder: Int = 0,
loading: @Composable (BoxScope.(imageState: GlideImageState.Loading) -> Unit)? = null,
success: @Composable (BoxScope.(imageState: GlideImageState.Success) -> Unit)? = null,
failure: @Composable (BoxScope.(imageState: GlideImageState.Failure) -> Unit)? = null
) {
GlideImage(
imageModel = { imageModel },
modifier = modifier,
requestBuilder = requestBuilder,
requestOptions = requestOptions,
requestListener = requestListener,
component = component,
imageOptions = imageOptions,
onImageStateChanged = onImageStateChanged,
previewPlaceholder = previewPlaceholder,
loading = loading,
success = success,
failure = failure
)
}

/**
* Load and render an image with the given [imageModel] from the network or local storage.
*
Expand Down

0 comments on commit be595bc

Please sign in to comment.