Subhash
01/29/2020, 4:27 PMMinor help request: I am not being able to scroll the contents. Am I doing something wrong here?@Composable
fun ArtistsList(artistsLiveData: LiveData<List<Artist>>) {
val artists = +state { artistsLiveData.value }
val artistObserver = Observer<List<Artist>> {
artists.value = it
}
+onActive {
artistsLiveData.observeForever(artistObserver)
}
+onDispose {
artistsLiveData.removeObserver(artistObserver)
}
VerticalScroller {
Column(modifier = Expanded) {
artists.value?.forEach {
Row(modifier = ExpandedWidth wraps Spacing(all = 8.dp)) {
Container(Spacing(4.dp), width = 40.dp, height = 40.dp) {
val image = +state<Image?> { null }
prepareImage(url = it.picture_small, state = image)
image.value?.let {
DrawImage(image = it)
}
}
Text(
text = it.name,
modifier = ExpandedWidth,
style = (+ambient(Typography)).body1
)
}
}
}
}
}
Zsolt
01/29/2020, 4:37 PMZsolt
01/29/2020, 4:38 PMSubhash
01/31/2020, 1:39 AM