-
public class SubSamplingImageSource.Companion
-
-
Field Summary
Fields Modifier and Type Field Description public final static SubSamplingImageSource.CompanionINSTANCE
-
Method Summary
Modifier and Type Method Description final SubSamplingImageSource)>file(Path path, ImageBitmap preview, <ERROR CLASS> onClose)An image stored on the device file system. final SubSamplingImageSourceasset(String name, ImageBitmap preview)An image stored in src/main/assets.final SubSamplingImageSourceresource(@DrawableRes() Integer id, ImageBitmap preview)An image stored in src/main/res/drawable*directories.final SubSamplingImageSourcecontentUri(Uri uri, ImageBitmap preview)Same as SubSamplingImageSource.contentUriOrNull, but throws an error if the uriis unsupported by ContentResolver.openInputStream.final SubSamplingImageSourcecontentUriOrNull(Uri uri, ImageBitmap preview)An image exposed by a content provider. final SubSamplingImageSource)>rawSource(Function0<Source> source, ImageBitmap preview, <ERROR CLASS> onClose)An arbitrary stream that should only be used for images that can't be read directly from the disk. -
-
Method Detail
-
file
@Stable() final SubSamplingImageSource )>file(Path path, ImageBitmap preview, <ERROR CLASS> onClose)
An image stored on the device file system. This can be used with image loading libraries that store cached images on disk.
- Parameters:
preview- See SubSamplingImageSource.preview.onClose- Called when the image is no longer visible.
-
asset
@Stable() final SubSamplingImageSource asset(String name, ImageBitmap preview)
An image stored in
src/main/assets.- Parameters:
preview- See SubSamplingImageSource.preview.
-
resource
@Stable() final SubSamplingImageSource resource(@DrawableRes() Integer id, ImageBitmap preview)
An image stored in
src/main/res/drawable*directories.- Parameters:
preview- See SubSamplingImageSource.preview.
-
contentUri
@Stable() final SubSamplingImageSource contentUri(Uri uri, ImageBitmap preview)
Same as SubSamplingImageSource.contentUriOrNull, but throws an error if the
uriis unsupported by ContentResolver.openInputStream.
-
contentUriOrNull
@Stable() final SubSamplingImageSource contentUriOrNull(Uri uri, ImageBitmap preview)
An image exposed by a content provider. A common use-case for this would be to display images shared by other apps.
- Parameters:
preview- See SubSamplingImageSource.preview.
-
rawSource
@Stable() final SubSamplingImageSource )>rawSource(Function0<Source> source, ImageBitmap preview, <ERROR CLASS> onClose)
An arbitrary stream that should only be used for images that can't be read directly from the disk. For all other purposes, prefer using )>SubSamplingImageSource.file instead as it is significantly faster.
- Parameters:
preview- See SubSamplingImageSource.preview.onClose- Called when the image is no longer visible.
-
-
-
-