addresses #81 - saves gpx files without a file manager present check
This commit is contained in:
parent
420c18082c
commit
11610cca87
1 changed files with 7 additions and 13 deletions
|
@ -25,7 +25,6 @@ import android.content.Intent
|
||||||
import android.content.pm.PackageManager
|
import android.content.pm.PackageManager
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.os.Vibrator
|
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
|
@ -77,12 +76,12 @@ class TrackFragment : Fragment(), RenameTrackDialog.RenameTrackListener, YesNoDi
|
||||||
layout.shareButton.setOnClickListener {
|
layout.shareButton.setOnClickListener {
|
||||||
openSaveGpxDialog()
|
openSaveGpxDialog()
|
||||||
}
|
}
|
||||||
layout.shareButton.setOnLongClickListener {
|
// layout.shareButton.setOnLongClickListener {
|
||||||
val v = (activity as Context).getSystemService(Context.VIBRATOR_SERVICE) as Vibrator
|
// val v = (activity as Context).getSystemService(Context.VIBRATOR_SERVICE) as Vibrator
|
||||||
v.vibrate(50)
|
// v.vibrate(50)
|
||||||
shareGpxTrack()
|
// shareGpxTrack()
|
||||||
return@setOnLongClickListener true
|
// return@setOnLongClickListener true
|
||||||
}
|
// }
|
||||||
// set up delete button
|
// set up delete button
|
||||||
layout.deleteButton.setOnClickListener {
|
layout.deleteButton.setOnClickListener {
|
||||||
val dialogMessage: String = "${getString(R.string.dialog_yes_no_message_delete_recording)}\n\n- ${layout.trackNameView.text}"
|
val dialogMessage: String = "${getString(R.string.dialog_yes_no_message_delete_recording)}\n\n- ${layout.trackNameView.text}"
|
||||||
|
@ -183,12 +182,7 @@ class TrackFragment : Fragment(), RenameTrackDialog.RenameTrackListener, YesNoDi
|
||||||
putExtra(Intent.EXTRA_TITLE, FileHelper.getGpxFileName(track))
|
putExtra(Intent.EXTRA_TITLE, FileHelper.getGpxFileName(track))
|
||||||
}
|
}
|
||||||
// file gets saved in onActivityResult
|
// file gets saved in onActivityResult
|
||||||
val packageManager: PackageManager? = activity?.packageManager
|
startActivityForResult(intent, Keys.REQUEST_SAVE_GPX)
|
||||||
if (packageManager != null && intent.resolveActivity(packageManager) != null) {
|
|
||||||
startActivityForResult(intent, Keys.REQUEST_SAVE_GPX)
|
|
||||||
} else {
|
|
||||||
Toast.makeText(activity as Context, R.string.toast_message_install_file_helper, Toast.LENGTH_LONG).show()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue