Skip to content

Commit

Permalink
Merge pull request #520 from kiwicom/task/MOBILE-48354-remove-choice-…
Browse files Browse the repository at this point in the history
…tile-centered

Remove deprecated `ChoiceTileCentered`
  • Loading branch information
hrach authored Sep 5, 2023
2 parents ad7b499 + 2e103d7 commit 8621c82
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 290 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package kiwi.orbit.compose.catalog.screens

import androidx.compose.foundation.Image
import androidx.compose.foundation.horizontalScroll
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
Expand All @@ -25,16 +24,12 @@ import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import kiwi.orbit.compose.catalog.components.CustomPlaceholder
import kiwi.orbit.compose.icons.Icons
import kiwi.orbit.compose.illustrations.Illustrations
import kiwi.orbit.compose.ui.controls.BadgeInfoSubtle
import kiwi.orbit.compose.ui.controls.BadgeNeutral
import kiwi.orbit.compose.ui.controls.ChoiceTile
import kiwi.orbit.compose.ui.controls.ChoiceTileCentered
import kiwi.orbit.compose.ui.controls.Icon
import kiwi.orbit.compose.ui.controls.Scaffold
import kiwi.orbit.compose.ui.controls.Stepper
Expand Down Expand Up @@ -205,66 +200,5 @@ private fun ChoiceTileScreenInner() {
onSelect = { selectedD = !selectedD },
content = { },
)

// Vertical padding to avoid clip issues on Android 12+ when over-scrolling.
// https://issuetracker.google.com/issues/215652703
var selectedE by rememberSaveable { mutableIntStateOf(-1) }
Row(
Modifier
.height(IntrinsicSize.Max)
.padding(horizontal = 16.dp)
.padding(top = 12.dp) // half of the badge
.padding(top = 2.dp, bottom = 4.dp), // over-scroll workaround
horizontalArrangement = Arrangement.spacedBy(8.dp),
) {
ChoiceTileCentered(
modifier = Modifier
.fillMaxHeight()
.weight(1f),
selected = selectedE == 0,
onSelect = { selectedE = 0 },
title = { Text("Plus Support") },
description = { Text("Everyone sits together") },
price = { BadgeNeutral { Text("Included") } },
)

ChoiceTileCentered(
modifier = Modifier
.fillMaxHeight()
.weight(1f),
selected = selectedE == 1,
onSelect = { selectedE = 1 },
icon = {
Image(
painter = Illustrations.Boarding,
contentDescription = null,
Modifier.height(60.dp),
)
},
title = { Text("Plus Support") },
description = { Text("Everyone sits together") },
price = { Text("+ 10 €") },
)

ChoiceTileCentered(
modifier = Modifier
.fillMaxHeight()
.weight(1f),
selected = selectedE == 2,
onSelect = { selectedE = 2 },
badgeContent = {
Text(
"Recommended Very Much",
maxLines = 1,
overflow = TextOverflow.Ellipsis,
)
},
icon = { Icon(painter = Icons.BaggageSet, contentDescription = null) },
title = { Text("Plus Support") },
description = { Text("Everyone sits together") },
price = { Text("+ 10 €") },
largeHeading = false,
)
}
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import kiwi.orbit.compose.ui.controls.ButtonTextLinkPreview
import kiwi.orbit.compose.ui.controls.CardPreview
import kiwi.orbit.compose.ui.controls.CheckboxFieldPreview
import kiwi.orbit.compose.ui.controls.CheckboxPreview
import kiwi.orbit.compose.ui.controls.ChoiceTileCenteredPreview
import kiwi.orbit.compose.ui.controls.ChoiceTilePreview
import kiwi.orbit.compose.ui.controls.CircularProgressIndicatorPreview
import kiwi.orbit.compose.ui.controls.ClickableFieldPreview
Expand Down Expand Up @@ -195,11 +194,6 @@ internal class ScreenshotTest {
snapshot { ChoiceTilePreview() }
}

@Test
fun choiceTileCentered() {
snapshot { ChoiceTileCenteredPreview() }
}

@Test
fun circularProgressIndicator() {
snapshot { CircularProgressIndicatorPreview() }
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 8621c82

Please sign in to comment.