Rename DIALOG_EMPTY_RECORDING -> DIALOG_RESUME_EMPTY_RECORDING.

This commit is contained in:
voussoir 2022-04-06 21:27:43 -07:00
parent 7cb9904ab9
commit b7f641515a
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB
2 changed files with 8 additions and 5 deletions

View file

@ -70,7 +70,7 @@ object Keys {
const val STATE_THEME_DARK_MODE: String = "stateDarkMode"
// dialog types
const val DIALOG_EMPTY_RECORDING: Int = 0
const val DIALOG_RESUME_EMPTY_RECORDING: Int = 0
const val DIALOG_DELETE_TRACK: Int = 1
const val DIALOG_DELETE_NON_STARRED: Int = 2
const val DIALOG_DELETE_CURRENT_RECORDING: Int = 3

View file

@ -185,7 +185,7 @@ class MapFragment : Fragment(), YesNoDialog.YesNoDialogListener, MapOverlayHelpe
override fun onYesNoDialog(type: Int, dialogResult: Boolean, payload: Int, payloadString: String) {
super.onYesNoDialog(type, dialogResult, payload, payloadString)
when (type) {
Keys.DIALOG_EMPTY_RECORDING -> {
Keys.DIALOG_RESUME_EMPTY_RECORDING -> {
when (dialogResult) {
// user tapped resume
true -> {
@ -276,9 +276,12 @@ class MapFragment : Fragment(), YesNoDialog.YesNoDialogListener, MapOverlayHelpe
/* Saves track - shows dialog, if recording is still empty */
private fun saveTrack() {
if (track.wayPoints.isEmpty()) {
YesNoDialog(this as YesNoDialog.YesNoDialogListener).show(context = activity as Context, type = Keys.DIALOG_EMPTY_RECORDING, message = R.string.dialog_error_empty_recording_message, yesButton = R.string.dialog_error_empty_recording_button_resume)
} else {
if (track.wayPoints.isEmpty())
{
YesNoDialog(this as YesNoDialog.YesNoDialogListener).show(context = activity as Context, type = Keys.DIALOG_RESUME_EMPTY_RECORDING, message = R.string.dialog_error_empty_recording_message, yesButton = R.string.dialog_error_empty_recording_button_resume)
}
else
{
CoroutineScope(IO).launch {
// step 1: create and store filenames for json and gpx files
track.trackUriString = FileHelper.getTrackFileUri(activity as Context, track).toString()