Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package com.nativeapptemplate.nativeapptemplatefree.ui.shop_detail

import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
Expand All @@ -23,7 +21,6 @@ fun ShopDetailCardView(
data: Data,
) {
Row(
horizontalArrangement = Arrangement.Center,
verticalAlignment = Alignment.CenterVertically,
modifier = Modifier.padding(16.dp),
) {
Expand All @@ -35,10 +32,11 @@ fun ShopDetailCardView(
data.getName(),
style = MaterialTheme.typography.titleLarge,
fontSize = nameFontSize,
modifier = Modifier
.weight(1f)
.padding(end = 8.dp),
)

Spacer(modifier = Modifier.weight(1f))

// TODO: removed in Phase 2A-2 — scanState/customerReadAt column dropped with ItemTag schema v2

Column(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.material3.ListItem
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
Expand All @@ -28,52 +28,50 @@ fun ItemTagListCardView(
val state = data.getItemTagState()
val completedAt = data.getCompletedAt()

ListItem(
headlineContent = {
Row(
horizontalArrangement = Arrangement.spacedBy(8.dp),
verticalAlignment = Alignment.CenterVertically,
modifier = Modifier.fillMaxWidth(),
) {
Row(
horizontalArrangement = Arrangement.spacedBy(8.dp),
verticalAlignment = Alignment.CenterVertically,
modifier = Modifier
.fillMaxWidth()
.clickable { onItemClick(data.id!!) }
.padding(horizontal = 16.dp, vertical = 12.dp),
) {
Column(
modifier = Modifier.weight(1f),
verticalArrangement = Arrangement.spacedBy(2.dp),
) {
Text(
data.getName(),
style = MaterialTheme.typography.titleMedium,
)
if (description.isNotBlank()) {
Text(
data.getName(),
style = MaterialTheme.typography.titleMedium,
modifier = Modifier.weight(1f),
description,
style = MaterialTheme.typography.bodySmall,
maxLines = 2,
overflow = TextOverflow.Ellipsis,
color = MaterialTheme.colorScheme.onSurfaceVariant,
)
when (state) {
ItemTagState.Completed -> CompletedTag()
ItemTagState.Idled -> IdlingTag()
null -> Unit
}
}
},
supportingContent = if (description.isBlank() && state != ItemTagState.Completed) {
null
} else {
{
Column(verticalArrangement = Arrangement.spacedBy(2.dp)) {
if (description.isNotBlank()) {
Text(
description,
style = MaterialTheme.typography.bodySmall,
maxLines = 2,
overflow = TextOverflow.Ellipsis,
color = MaterialTheme.colorScheme.onSurfaceVariant,
)
}
if (state == ItemTagState.Completed && completedAt.isNotBlank()) {
}
Column(
horizontalAlignment = Alignment.End,
verticalArrangement = Arrangement.spacedBy(4.dp),
) {
when (state) {
ItemTagState.Completed -> {
CompletedTag()
if (completedAt.isNotBlank()) {
Text(
completedAt.cardDateTimeString(),
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.onSurfaceVariant,
)
}
}
ItemTagState.Idled -> IdlingTag()
null -> Unit
}
},
modifier = Modifier
.clickable {
onItemClick(data.id!!)
},
)
}
}
}
Loading