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