Fix back navigation when FirstRunFragment is shown
This commit is contained in:
parent
22b3ace3aa
commit
7f934c8209
1 changed files with 5 additions and 2 deletions
|
@ -6,6 +6,7 @@
|
||||||
package com.stevesoltys.seedvault.settings
|
package com.stevesoltys.seedvault.settings
|
||||||
|
|
||||||
import android.app.Dialog
|
import android.app.Dialog
|
||||||
|
import android.content.DialogInterface
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import androidx.fragment.app.DialogFragment
|
import androidx.fragment.app.DialogFragment
|
||||||
|
@ -16,7 +17,6 @@ import com.stevesoltys.seedvault.restore.RestoreActivity
|
||||||
class FirstRunFragment : DialogFragment() {
|
class FirstRunFragment : DialogFragment() {
|
||||||
|
|
||||||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
||||||
isCancelable = false // is what really works, specifying it for the dialog only doesn't
|
|
||||||
return MaterialAlertDialogBuilder(requireContext())
|
return MaterialAlertDialogBuilder(requireContext())
|
||||||
.setMessage(R.string.first_start_text)
|
.setMessage(R.string.first_start_text)
|
||||||
.setPositiveButton(R.string.setup_button) { dialog, _ ->
|
.setPositiveButton(R.string.setup_button) { dialog, _ ->
|
||||||
|
@ -31,7 +31,10 @@ class FirstRunFragment : DialogFragment() {
|
||||||
dialog.dismiss()
|
dialog.dismiss()
|
||||||
requireActivity().finish()
|
requireActivity().finish()
|
||||||
}
|
}
|
||||||
.setCancelable(false)
|
|
||||||
.create()
|
.create()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onCancel(dialog: DialogInterface) {
|
||||||
|
requireActivity().finish()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue