RemoteImageSample
@Sampled
@PreviewWrapper(RemoteComponentPreviewWrapper::class)
@Composable
fun RemoteImageSample() {
val remoteBitmap = rememberRemoteImageBitmap(url = "https://example.com/placeholder.png")
RemoteImage(
remoteBitmap = remoteBitmap,
contentDescription = "Sample Remote Image".rs,
modifier = RemoteModifier.size(100.rdp),
contentScale = ContentScale.Crop,
)
}
RemoteImageFitSample
@Sampled
@PreviewWrapper(RemoteComponentPreviewWrapper::class)
@Composable
fun RemoteImageFitSample() {
val remoteBitmap = rememberRemoteImageBitmap(url = "https://example.com/placeholder.png")
RemoteImage(
remoteBitmap = remoteBitmap,
contentDescription = "Fit Sample".rs,
modifier = RemoteModifier.size(100.rdp),
contentScale = ContentScale.Fit,
)
}