Skip to content

Commit

Permalink
No border when looking at detail as we need more space
Browse files Browse the repository at this point in the history
  • Loading branch information
ksharma-xyz committed Oct 23, 2024
1 parent 4fb944c commit fe6e47b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.clickable
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
Expand Down Expand Up @@ -108,13 +109,24 @@ fun JourneyCard(
.fillMaxWidth()
.clip(RoundedCornerShape(12.dp))
.background(color = KrailTheme.colors.surface)
.border(
width = 2.dp,
shape = RoundedCornerShape(12.dp),
brush = Brush.linearGradient(colors = borderColors),
.then(
if (cardState == JourneyCardState.DEFAULT) Modifier.border(
width = 2.dp,
shape = RoundedCornerShape(12.dp),
brush = Brush.linearGradient(colors = borderColors),
)
else Modifier
)
.clickable(
role = Role.Button,
onClick = onClick,
interactionSource = remember { MutableInteractionSource() },
indication = null,
)
.clickable(role = Role.Button, onClick = onClick)
.padding(vertical = 8.dp, horizontal = 12.dp),
.padding(
vertical = 8.dp,
horizontal = if (cardState == JourneyCardState.DEFAULT) 12.dp else 0.dp
),
) {

when (cardState) {
Expand Down Expand Up @@ -495,7 +507,7 @@ private fun PreviewJourneyCardCollapsed() {
),
),

),
),
cardState = JourneyCardState.COLLAPSED,
onClick = {},
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ fun TimeTableScreen(
}.toImmutableList(),
legList = journey.legs.toImmutableList(),
cardState = if (expandedJourneyId == journey.journeyId) {
JourneyCardState.EXPANDED
JourneyCardState.COLLAPSED
} else JourneyCardState.DEFAULT,
onClick = {
onEvent(TimeTableUiEvent.JourneyCardClicked(journey.journeyId))
Expand Down

0 comments on commit fe6e47b

Please sign in to comment.