Skip to content

Commit

Permalink
Merge pull request #4891 from Helium314/Helium314-patch-2
Browse files Browse the repository at this point in the history
Use collectSurfaceDescriptionIfNecessary in AddPathSurfaceForm
  • Loading branch information
matkoniecz committed Mar 20, 2023
2 parents 3d8db79 + ec1b3e0 commit 84a5f6e
Showing 1 changed file with 2 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,9 @@ class AddPathSurfaceForm : AImageListQuestForm<Surface, SurfaceOrIsStepsAnswer>(

override fun onClickOk(selectedItems: List<Surface>) {
val value = selectedItems.single()
if (value.shouldBeDescribed) {
AlertDialog.Builder(requireContext())
.setMessage(R.string.quest_surface_detailed_answer_impossible_confirmation)
.setPositiveButton(R.string.quest_generic_confirmation_yes) { _, _ ->
DescribeGenericSurfaceDialog(requireContext()) { description ->
applyAnswer(SurfaceAnswer(SurfaceAndNote(value, description)))
}.show()
}
.setNegativeButton(android.R.string.cancel, null)
.show()
return
collectSurfaceDescriptionIfNecessary(requireContext(), value) {
applyAnswer(SurfaceAnswer(SurfaceAndNote(value, it)))
}
applyAnswer(SurfaceAnswer(SurfaceAndNote(value)))
}

private fun createConvertToStepsAnswer(): AnswerItem? {
Expand Down

0 comments on commit 84a5f6e

Please sign in to comment.