Rename DIALOG_EMPTY_RECORDING -> DIALOG_RESUME_EMPTY_RECORDING.
This commit is contained in:
parent
7cb9904ab9
commit
b7f641515a
2 changed files with 8 additions and 5 deletions
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue