forked from mirrors/gecko-dev
Bug 1907820 - Fix dragging sheet behaviour for all elements in the microsurvey r=android-reviewers,twhite
Differential Revision: https://phabricator.services.mozilla.com/D216674
This commit is contained in:
parent
ed0853de48
commit
1736937b20
1 changed files with 27 additions and 30 deletions
|
|
@ -66,7 +66,10 @@ fun MicrosurveyBottomSheet(
|
||||||
shape = bottomSheetShape,
|
shape = bottomSheetShape,
|
||||||
) {
|
) {
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier.padding(vertical = 8.dp),
|
modifier = Modifier
|
||||||
|
.padding(vertical = 8.dp)
|
||||||
|
.nestedScroll(rememberNestedScrollInteropConnection())
|
||||||
|
.verticalScroll(rememberScrollState()),
|
||||||
) {
|
) {
|
||||||
BottomSheetHandle(
|
BottomSheetHandle(
|
||||||
onRequestDismiss = {},
|
onRequestDismiss = {},
|
||||||
|
|
@ -81,37 +84,31 @@ fun MicrosurveyBottomSheet(
|
||||||
onCloseButtonClicked()
|
onCloseButtonClicked()
|
||||||
}
|
}
|
||||||
|
|
||||||
Column(
|
if (isSubmitted) {
|
||||||
modifier = Modifier
|
MicrosurveyCompleted()
|
||||||
.nestedScroll(rememberNestedScrollInteropConnection())
|
} else {
|
||||||
.verticalScroll(rememberScrollState()),
|
MicroSurveyContent(
|
||||||
) {
|
question = question,
|
||||||
if (isSubmitted) {
|
icon = icon,
|
||||||
MicrosurveyCompleted()
|
answers = answers,
|
||||||
} else {
|
selectedAnswer = selectedAnswer,
|
||||||
MicroSurveyContent(
|
onSelectionChange = { selectedAnswer = it },
|
||||||
question = question,
|
|
||||||
icon = icon,
|
|
||||||
answers = answers,
|
|
||||||
selectedAnswer = selectedAnswer,
|
|
||||||
onSelectionChange = { selectedAnswer = it },
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
Spacer(modifier = Modifier.height(24.dp))
|
|
||||||
|
|
||||||
MicroSurveyFooter(
|
|
||||||
isSubmitted = isSubmitted,
|
|
||||||
isContentAnswerSelected = selectedAnswer != null,
|
|
||||||
onPrivacyPolicyLinkClick = onPrivacyPolicyLinkClick,
|
|
||||||
onButtonClick = {
|
|
||||||
selectedAnswer?.let {
|
|
||||||
onSubmitButtonClicked(it)
|
|
||||||
isSubmitted = true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Spacer(modifier = Modifier.height(24.dp))
|
||||||
|
|
||||||
|
MicroSurveyFooter(
|
||||||
|
isSubmitted = isSubmitted,
|
||||||
|
isContentAnswerSelected = selectedAnswer != null,
|
||||||
|
onPrivacyPolicyLinkClick = onPrivacyPolicyLinkClick,
|
||||||
|
onButtonClick = {
|
||||||
|
selectedAnswer?.let {
|
||||||
|
onSubmitButtonClicked(it)
|
||||||
|
isSubmitted = true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue