diff --git a/app/src/main/java/org/y20k/trackbook/Keys.kt b/app/src/main/java/org/y20k/trackbook/Keys.kt index d01f216..d56d173 100644 --- a/app/src/main/java/org/y20k/trackbook/Keys.kt +++ b/app/src/main/java/org/y20k/trackbook/Keys.kt @@ -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 diff --git a/app/src/main/java/org/y20k/trackbook/MapFragment.kt b/app/src/main/java/org/y20k/trackbook/MapFragment.kt index 8412dea..4f4f64e 100644 --- a/app/src/main/java/org/y20k/trackbook/MapFragment.kt +++ b/app/src/main/java/org/y20k/trackbook/MapFragment.kt @@ -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()