Skip to content

Instantly share code, notes, and snippets.

@catalinghita8
Last active June 23, 2021 13:02
Show Gist options
  • Select an option

  • Save catalinghita8/6ccf5c75cb5b9fcc7c3f2efb746bce19 to your computer and use it in GitHub Desktop.

Select an option

Save catalinghita8/6ccf5c75cb5b9fcc7c3f2efb746bce19 to your computer and use it in GitHub Desktop.
@Composable
fun ProfileCardComposable(userProfile: UserProfile) {
val onlineStatus = remember { mutableStateOf(userProfile.isOnline) }
Card(
Modifier.
...
.background(color = Helper.getWhiteColor())
.clickable(onClick = { onlineStatus.value = onlineStatus.value.not() })
.padding(16.dp)
) {
Row(...) {
ProfilePictureComposable(onlineStatus, userProfile.profilePictureDrawableId)
ProfileContentComposable(onlineStatus, userProfile.name, userProfile.lastActivityMinutes)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment