mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 22:17:03 +05:30
refactor(android): DRY
This commit is contained in:
parent
cf93eda6c1
commit
58bab2f538
1 changed files with 3 additions and 6 deletions
|
@ -44,14 +44,11 @@ fun WidgetListEntry(
|
||||||
) {
|
) {
|
||||||
val titleStyle = MaterialTheme.typography.titleMedium
|
val titleStyle = MaterialTheme.typography.titleMedium
|
||||||
val subtitleStyle = MaterialTheme.typography.labelLarge
|
val subtitleStyle = MaterialTheme.typography.labelLarge
|
||||||
val postAction =
|
|
||||||
if (post.url.isNotEmpty()) {
|
|
||||||
actionStartActivity(Intent(Intent.ACTION_VIEW, Uri.parse(post.url)))
|
|
||||||
} else {
|
|
||||||
actionStartActivity<MainActivity>(actionParametersOf(destinationKey to post.shortId))
|
|
||||||
}
|
|
||||||
val commentsAction =
|
val commentsAction =
|
||||||
actionStartActivity<MainActivity>(actionParametersOf(destinationKey to post.shortId))
|
actionStartActivity<MainActivity>(actionParametersOf(destinationKey to post.shortId))
|
||||||
|
val postAction =
|
||||||
|
if (post.url.isNotEmpty()) actionStartActivity(Intent(Intent.ACTION_VIEW, Uri.parse(post.url)))
|
||||||
|
else commentsAction
|
||||||
Box(modifier.padding(8.dp)) {
|
Box(modifier.padding(8.dp)) {
|
||||||
Row(
|
Row(
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue