Formatting improved

This commit is contained in:
Yogesh Choudhary Paliyal 2021-12-02 22:43:39 +05:30
parent 0c24210719
commit 169d29410a

View file

@ -32,42 +32,44 @@ import com.mxalbert.zoomable.Zoomable
import io.getstream.androiddeveloperroadmap.ui.theme.AndroidDeveloperRoadmapTheme
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
AndroidDeveloperRoadmapTheme {
Surface(
color = MaterialTheme.colors.background
) {
Roadmap()
}
}
setContent {
AndroidDeveloperRoadmapTheme {
Surface(
color = MaterialTheme.colors.background
) {
Roadmap()
}
}
}
}
}
@Composable
private fun Roadmap() {
Zoomable(
modifier = Modifier.fillMaxSize(),
) {
Image(
painter = rememberImagePainter("https://user-images.githubusercontent.com/24237865/144350753-5a52e6e5-3517-476c-8e5c-adad919abe8e.png",
builder = {
placeholder(R.drawable.roadmap_preview)
}),
modifier = Modifier.fillMaxSize(),
contentScale = ContentScale.Fit,
contentDescription = null
)
}
Zoomable(
modifier = Modifier.fillMaxSize(),
) {
Image(
painter = rememberImagePainter(
"https://user-images.githubusercontent.com/24237865/144350753-5a52e6e5-3517-476c-8e5c-adad919abe8e.png",
builder = {
placeholder(R.drawable.roadmap_preview)
}
),
modifier = Modifier.fillMaxSize(),
contentScale = ContentScale.Fit,
contentDescription = null
)
}
}
@Preview(showBackground = true)
@Composable
private fun DefaultPreview() {
AndroidDeveloperRoadmapTheme {
Roadmap()
}
AndroidDeveloperRoadmapTheme {
Roadmap()
}
}