Skip to content

Instantly share code, notes, and snippets.

@Astroa7m
Created October 25, 2022 18:25
Show Gist options
  • Save Astroa7m/b967b5a353e4ea9cec3af980c28851f9 to your computer and use it in GitHub Desktop.
Save Astroa7m/b967b5a353e4ea9cec3af980c28851f9 to your computer and use it in GitHub Desktop.
@Composable
fun DetailsScreen(
modifier: Modifier = Modifier,
user: User?,
onDismiss: () -> Unit,
onSharing: () -> Unit,
onAddNewUserClicked: () -> Unit
) {
if (user == null)
UserNotFoundDialog(
onAddNewUserClicked = onAddNewUserClicked,
onDismiss = onDismiss
)
else {
Column(
modifier = modifier.scrollable(rememberScrollState(), Orientation.Vertical),
horizontalAlignment = Alignment.CenterHorizontally,
) {
UserItem(
user = user
)
Spacer(modifier = Modifier.height(16.dp))
// here
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S)
SharingUtil.CheckIfAppApprovedForDomain()
IconButton(onClick = { onSharing() }) {
Icon(imageVector = Icons.Rounded.Share, contentDescription = null)
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment