File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
src/main/java/com/example/compose/snippets/images Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -159,5 +159,6 @@ dependencies {
159
159
160
160
androidTestImplementation(libs.androidx.compose.ui.test.junit4)
161
161
debugImplementation(libs.androidx.compose.ui.test.manifest)
162
+ implementation(" com.github.bumptech.glide:compose:1.0.0-beta01" )
162
163
163
164
}
Original file line number Diff line number Diff line change @@ -22,6 +22,8 @@ import androidx.compose.ui.res.painterResource
22
22
import androidx.compose.ui.res.stringResource
23
23
import androidx.compose.ui.tooling.preview.Preview
24
24
import coil.compose.AsyncImage
25
+ import com.bumptech.glide.integration.compose.ExperimentalGlideComposeApi
26
+ import com.bumptech.glide.integration.compose.GlideImage
25
27
import com.example.compose.snippets.R
26
28
27
29
/*
@@ -53,11 +55,24 @@ fun LoadingImageFromDisk() {
53
55
54
56
@Preview
55
57
@Composable
56
- fun LoadingImageFromInternet () {
58
+ fun LoadingImageFromInternetCoil () {
57
59
// [START android_compose_images_load_internet_coil]
58
60
AsyncImage (
59
61
model = " https://example.com/image.jpg" ,
60
62
contentDescription = " Translated description of what the image contains"
61
63
)
62
64
// [END android_compose_images_load_internet_coil]
63
65
}
66
+
67
+ @OptIn(ExperimentalGlideComposeApi ::class )
68
+ @Preview
69
+ @Composable
70
+ fun LoadingImageFromInternetGlide () {
71
+ // [START android_compose_images_load_internet_glide]
72
+ GlideImage (
73
+ model = " https://example.com/image.jpg" ,
74
+ contentDescription = " Translated description of what the image contains"
75
+ )
76
+ // [END android_compose_images_load_internet_glide]
77
+ }
78
+
You can’t perform that action at this time.
0 commit comments