-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...oid/quest/src/main/java/org/smartregister/fhircore/quest/ui/dialog/AlertDialogFragment.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package org.smartregister.fhircore.quest.ui.dialog | ||
|
||
import android.app.Dialog | ||
import android.os.Bundle | ||
import androidx.fragment.app.DialogFragment | ||
import androidx.navigation.fragment.navArgs | ||
import org.smartregister.fhircore.engine.ui.base.AlertDialogue | ||
import org.smartregister.fhircore.quest.ui.shared.QuestionnaireHandler | ||
|
||
class AlertDialogFragment() : DialogFragment() { | ||
|
||
private val alertDialogFragmentArgs by navArgs<AlertDialogFragmentArgs>() | ||
|
||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { | ||
return AlertDialogue.showCancelAlert( | ||
context = requireContext(), | ||
message = | ||
org.smartregister.fhircore.engine.R.string | ||
.questionnaire_in_progress_alert_back_pressed_message, | ||
title = org.smartregister.fhircore.engine.R.string.questionnaire_alert_back_pressed_title, | ||
confirmButtonListener = { | ||
if (requireContext() is QuestionnaireHandler) { | ||
(requireContext() as QuestionnaireHandler).launchQuestionnaire( | ||
context = requireContext(), | ||
questionnaireConfig = alertDialogFragmentArgs.questionnaireConfig, | ||
actionParams = listOf(), | ||
) | ||
} | ||
}, | ||
confirmButtonText = | ||
org.smartregister.fhircore.engine.R.string.questionnaire_alert_open_draft_button_title, | ||
neutralButtonListener = {}, | ||
neutralButtonText = | ||
org.smartregister.fhircore.engine.R.string.questionnaire_alert_neutral_button_title, | ||
negativeButtonListener = { this.dismiss() }, | ||
negativeButtonText = | ||
org.smartregister.fhircore.engine.R.string.questionnaire_alert_delete_draft_button_title, | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters