|
|
@ -75,13 +75,6 @@ import androidx.compose.ui.platform.LocalInspectionMode
|
|
|
|
import androidx.compose.ui.platform.testTag
|
|
|
|
import androidx.compose.ui.platform.testTag
|
|
|
|
import androidx.compose.ui.res.painterResource
|
|
|
|
import androidx.compose.ui.res.painterResource
|
|
|
|
import androidx.compose.ui.res.stringResource
|
|
|
|
import androidx.compose.ui.res.stringResource
|
|
|
|
import androidx.compose.ui.semantics.clearAndSetSemantics
|
|
|
|
|
|
|
|
import androidx.compose.ui.semantics.contentDescription
|
|
|
|
|
|
|
|
import androidx.compose.ui.semantics.semantics
|
|
|
|
|
|
|
|
import androidx.compose.ui.semantics.stateDescription
|
|
|
|
|
|
|
|
import androidx.compose.ui.semantics.toggleableState
|
|
|
|
|
|
|
|
import androidx.compose.ui.state.ToggleableState.Off
|
|
|
|
|
|
|
|
import androidx.compose.ui.state.ToggleableState.On
|
|
|
|
|
|
|
|
import androidx.compose.ui.text.style.TextAlign
|
|
|
|
import androidx.compose.ui.text.style.TextAlign
|
|
|
|
import androidx.compose.ui.tooling.preview.PreviewParameter
|
|
|
|
import androidx.compose.ui.tooling.preview.PreviewParameter
|
|
|
|
import androidx.compose.ui.unit.dp
|
|
|
|
import androidx.compose.ui.unit.dp
|
|
|
@ -275,13 +268,7 @@ private fun LazyStaggeredGridScope.onboarding(
|
|
|
|
|
|
|
|
|
|
|
|
is OnboardingUiState.Shown -> {
|
|
|
|
is OnboardingUiState.Shown -> {
|
|
|
|
item(span = StaggeredGridItemSpan.FullLine, contentType = "onboarding") {
|
|
|
|
item(span = StaggeredGridItemSpan.FullLine, contentType = "onboarding") {
|
|
|
|
Column(
|
|
|
|
Column(modifier = interestsItemModifier) {
|
|
|
|
modifier = interestsItemModifier,
|
|
|
|
|
|
|
|
) {
|
|
|
|
|
|
|
|
Column(
|
|
|
|
|
|
|
|
modifier = Modifier
|
|
|
|
|
|
|
|
.semantics(mergeDescendants = true) { },
|
|
|
|
|
|
|
|
) {
|
|
|
|
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
text = stringResource(R.string.feature_foryou_onboarding_guidance_title),
|
|
|
|
text = stringResource(R.string.feature_foryou_onboarding_guidance_title),
|
|
|
|
textAlign = TextAlign.Center,
|
|
|
|
textAlign = TextAlign.Center,
|
|
|
@ -298,7 +285,6 @@ private fun LazyStaggeredGridScope.onboarding(
|
|
|
|
textAlign = TextAlign.Center,
|
|
|
|
textAlign = TextAlign.Center,
|
|
|
|
style = MaterialTheme.typography.bodyMedium,
|
|
|
|
style = MaterialTheme.typography.bodyMedium,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
TopicSelection(
|
|
|
|
TopicSelection(
|
|
|
|
onboardingUiState,
|
|
|
|
onboardingUiState,
|
|
|
|
onTopicCheckedChanged,
|
|
|
|
onTopicCheckedChanged,
|
|
|
@ -398,21 +384,7 @@ private fun SingleTopicButton(
|
|
|
|
Surface(
|
|
|
|
Surface(
|
|
|
|
modifier = Modifier
|
|
|
|
modifier = Modifier
|
|
|
|
.width(312.dp)
|
|
|
|
.width(312.dp)
|
|
|
|
.heightIn(min = 56.dp)
|
|
|
|
.heightIn(min = 56.dp),
|
|
|
|
.semantics(mergeDescendants = true) {
|
|
|
|
|
|
|
|
toggleableState = if (isSelected) {
|
|
|
|
|
|
|
|
On
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
Off
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
stateDescription = if (isSelected) {
|
|
|
|
|
|
|
|
"Following"
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
"Not Following"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
contentDescription = name
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
shape = RoundedCornerShape(corner = CornerSize(8.dp)),
|
|
|
|
shape = RoundedCornerShape(corner = CornerSize(8.dp)),
|
|
|
|
color = MaterialTheme.colorScheme.surface,
|
|
|
|
color = MaterialTheme.colorScheme.surface,
|
|
|
|
selected = isSelected,
|
|
|
|
selected = isSelected,
|
|
|
@ -422,9 +394,7 @@ private fun SingleTopicButton(
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
verticalAlignment = Alignment.CenterVertically,
|
|
|
|
verticalAlignment = Alignment.CenterVertically,
|
|
|
|
modifier = Modifier
|
|
|
|
modifier = Modifier.padding(start = 12.dp, end = 8.dp),
|
|
|
|
.padding(start = 12.dp, end = 8.dp)
|
|
|
|
|
|
|
|
.clearAndSetSemantics { },
|
|
|
|
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
TopicIcon(
|
|
|
|
TopicIcon(
|
|
|
|
imageUrl = imageUrl,
|
|
|
|
imageUrl = imageUrl,
|
|
|
@ -443,19 +413,13 @@ private fun SingleTopicButton(
|
|
|
|
icon = {
|
|
|
|
icon = {
|
|
|
|
Icon(
|
|
|
|
Icon(
|
|
|
|
imageVector = NiaIcons.Add,
|
|
|
|
imageVector = NiaIcons.Add,
|
|
|
|
contentDescription = stringResource(
|
|
|
|
contentDescription = name,
|
|
|
|
id = R.string.feature_foryou_topic_icon_add,
|
|
|
|
|
|
|
|
name,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
checkedIcon = {
|
|
|
|
checkedIcon = {
|
|
|
|
Icon(
|
|
|
|
Icon(
|
|
|
|
imageVector = NiaIcons.Check,
|
|
|
|
imageVector = NiaIcons.Check,
|
|
|
|
contentDescription = stringResource(
|
|
|
|
contentDescription = name,
|
|
|
|
id = R.string.feature_foryou_topic_icon_checked,
|
|
|
|
|
|
|
|
name,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
)
|
|
|
|
)
|
|
|
|