Skip to content

Commit 6f671eb

Browse files
authored
Merge pull request #8 from yogeshpaliyal/demo_crash
Fix Crash for low end devices.
2 parents 96fe743 + 169d294 commit 6f671eb

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

app/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ dependencies {
4848
implementation "androidx.compose.foundation:foundation-layout:$compose_version"
4949
implementation "androidx.activity:activity-compose:$compose_activity_version"
5050

51-
implementation "com.github.skydoves:landscapist-glide:$landscapist_version"
5251
implementation "com.mxalbert.zoomable:zoomable:$zoomable_version"
52+
53+
implementation("io.coil-kt:coil-compose:1.4.0")
5354
}

app/src/main/kotlin/io/getstream/androiddeveloperroadmap/MainActivity.kt

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,16 @@ package io.getstream.androiddeveloperroadmap
1919
import android.os.Bundle
2020
import androidx.activity.ComponentActivity
2121
import androidx.activity.compose.setContent
22+
import androidx.compose.foundation.Image
2223
import androidx.compose.foundation.layout.fillMaxSize
23-
import androidx.compose.foundation.layout.height
2424
import androidx.compose.material.MaterialTheme
2525
import androidx.compose.material.Surface
2626
import androidx.compose.runtime.Composable
2727
import androidx.compose.ui.Modifier
2828
import androidx.compose.ui.layout.ContentScale
2929
import androidx.compose.ui.tooling.preview.Preview
30-
import androidx.compose.ui.unit.dp
30+
import coil.compose.rememberImagePainter
3131
import com.mxalbert.zoomable.Zoomable
32-
import com.skydoves.landscapist.glide.GlideImage
3332
import io.getstream.androiddeveloperroadmap.ui.theme.AndroidDeveloperRoadmapTheme
3433

3534
class MainActivity : ComponentActivity() {
@@ -51,13 +50,18 @@ class MainActivity : ComponentActivity() {
5150
@Composable
5251
private fun Roadmap() {
5352
Zoomable(
54-
modifier = Modifier.height(3200.dp)
53+
modifier = Modifier.fillMaxSize(),
5554
) {
56-
GlideImage(
57-
imageModel = "https://user-images.githubusercontent.com/24237865/144350753-5a52e6e5-3517-476c-8e5c-adad919abe8e.png",
55+
Image(
56+
painter = rememberImagePainter(
57+
"https://user-images.githubusercontent.com/24237865/144350753-5a52e6e5-3517-476c-8e5c-adad919abe8e.png",
58+
builder = {
59+
placeholder(R.drawable.roadmap_preview)
60+
}
61+
),
5862
modifier = Modifier.fillMaxSize(),
59-
previewPlaceholder = R.drawable.roadmap_preview,
60-
contentScale = ContentScale.Fit
63+
contentScale = ContentScale.Fit,
64+
contentDescription = null
6165
)
6266
}
6367
}

settings.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ pluginManagement {
55
mavenCentral()
66
}
77
plugins {
8-
id 'com.android.application' version '7.1.0-alpha13'
9-
id 'com.android.library' version '7.1.0-alpha13'
8+
id 'com.android.application' version '7.1.0-beta03'
9+
id 'com.android.library' version '7.1.0-beta03'
1010
id 'org.jetbrains.kotlin.android' version '1.5.31'
1111
}
1212
}

0 commit comments

Comments
 (0)