|
|
|
@ -29,6 +29,7 @@ import androidx.compose.runtime.setValue
|
|
|
|
|
import androidx.compose.ui.Alignment
|
|
|
|
|
import androidx.compose.ui.Modifier
|
|
|
|
|
import androidx.compose.ui.graphics.Brush
|
|
|
|
|
import androidx.compose.ui.layout.layout
|
|
|
|
|
import androidx.compose.ui.res.painterResource
|
|
|
|
|
import androidx.compose.ui.res.stringResource
|
|
|
|
|
import androidx.compose.ui.semantics.semantics
|
|
|
|
@ -36,6 +37,7 @@ import androidx.compose.ui.tooling.preview.PreviewParameter
|
|
|
|
|
import androidx.compose.ui.tooling.preview.PreviewParameterProvider
|
|
|
|
|
import androidx.compose.ui.unit.dp
|
|
|
|
|
import org.mozilla.fenix.R
|
|
|
|
|
import org.mozilla.fenix.compose.Divider
|
|
|
|
|
import org.mozilla.fenix.compose.annotation.LightDarkPreview
|
|
|
|
|
import org.mozilla.fenix.compose.button.SecondaryButton
|
|
|
|
|
import org.mozilla.fenix.shopping.store.ReviewQualityCheckState
|
|
|
|
@ -46,6 +48,8 @@ import org.mozilla.fenix.shopping.store.forCompactMode
|
|
|
|
|
import org.mozilla.fenix.theme.FirefoxTheme
|
|
|
|
|
import java.util.SortedMap
|
|
|
|
|
|
|
|
|
|
private val combinedParentHorizontalPadding = 32.dp
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* UI for review quality check content displaying product analysis.
|
|
|
|
|
*
|
|
|
|
@ -304,6 +308,10 @@ private fun HighlightsCard(
|
|
|
|
|
if (showMoreButtonVisible) {
|
|
|
|
|
Spacer(modifier = Modifier.height(8.dp))
|
|
|
|
|
|
|
|
|
|
Divider(modifier = Modifier.extendWidthToParentBorder())
|
|
|
|
|
|
|
|
|
|
Spacer(modifier = Modifier.height(8.dp))
|
|
|
|
|
|
|
|
|
|
SecondaryButton(
|
|
|
|
|
text = if (isExpanded) {
|
|
|
|
|
stringResource(R.string.review_quality_check_highlights_show_less)
|
|
|
|
@ -359,6 +367,17 @@ private fun HighlightTitle(highlightType: HighlightType) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private fun Modifier.extendWidthToParentBorder(): Modifier = this.layout { measurable, constraints ->
|
|
|
|
|
val placeable = measurable.measure(
|
|
|
|
|
constraints.copy(
|
|
|
|
|
maxWidth = constraints.maxWidth + combinedParentHorizontalPadding.roundToPx(),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
layout(placeable.width, placeable.height) {
|
|
|
|
|
placeable.place(0, 0)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private fun HighlightType.toHighlight() =
|
|
|
|
|
when (this) {
|
|
|
|
|
HighlightType.QUALITY -> Highlight.QUALITY
|
|
|
|
|