Package 

Class GlideImage

    • Method Summary

      Modifier and Type Method Description
      final static Unit GlideImage(Function0<Object> imageModel, Modifier modifier, GlideRequestType glideRequestType, Function0<RequestBuilder<?>> requestBuilder, Function0<RequestOptions> requestOptions, Function0<RequestListener<Object>> requestListener, ImageComponent component, ImageOptions imageOptions, Boolean clearTarget, Function1<GlideImageState, Unit> onImageStateChanged, Painter previewPlaceholder, Function2<BoxScope, GlideImageState.Loading, Unit> loading, Function3<BoxScope, GlideImageState.Success, Painter, Unit> success, Function2<BoxScope, GlideImageState.Failure, Unit> failure) Load and render an image with the given imageModel from the network or local storage.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • GlideImage

         final static Unit GlideImage(Function0<Object> imageModel, Modifier modifier, GlideRequestType glideRequestType, Function0<RequestBuilder<?>> requestBuilder, Function0<RequestOptions> requestOptions, Function0<RequestListener<Object>> requestListener, ImageComponent component, ImageOptions imageOptions, Boolean clearTarget, Function1<GlideImageState, Unit> onImageStateChanged, Painter previewPlaceholder, Function2<BoxScope, GlideImageState.Loading, Unit> loading, Function3<BoxScope, GlideImageState.Success, Painter, Unit> success, Function2<BoxScope, GlideImageState.Failure, Unit> failure)

        Load and render an image with the given imageModel from the network or local storage.

        GlideImage(
        imageModel = { imageUrl },
        requestBuilder = {
         Glide
          .with(LocalContext.current)
          .asBitmap()
          .apply(RequestOptions().diskCacheStrategy(DiskCacheStrategy.ALL))
          .thumbnail(0.6f)
          .transition(withCrossFade())
        },
        modifier = modifier,
        loading = {
          Box(modifier = Modifier.matchParentSize()) {
            CircularProgressIndicator(
               modifier = Modifier.align(Alignment.Center)
            )
          }
        },
        failure = {
          Text(text = "image request failed.")
        })
        Parameters:
        imageModel - The data model to request image.
        modifier - Modifier used to adjust the layout or drawing content.
        glideRequestType - Glide image request type, which decides the result of image data.
        requestBuilder - Most options in Glide can be applied directly on the RequestBuilder object returned by Glide.with().
        requestOptions - Provides type independent options to customize loads with Glide.
        requestListener - A class for monitoring the status of a request while images load.
        component - An image component that conjuncts pluggable ImagePlugins.
        imageOptions - Represents parameters to load generic Image Composable.
        clearTarget - Whether clear the target or not.
        onImageStateChanged - An image state change listener will be triggered whenever the image state is changed.
        previewPlaceholder - A painter that is specifically rendered when this function operates in preview mode.
        loading - Content to be displayed when the request is in progress.
        success - Content to be displayed when the request is succeeded.
        failure - Content to be displayed when the request is failed.