Search in sources :

Example 6 with GpxDataItemCallback

use of net.osmand.plus.track.helpers.GpxDbHelper.GpxDataItemCallback in project Osmand by osmandapp.

the class GpxUiHelper method getDataItem.

private static GpxDataItem getDataItem(@NonNull final OsmandApplication app, @NonNull final GPXFile gpxFile) {
    GpxDataItemCallback itemCallback = new GpxDataItemCallback() {

        @Override
        public boolean isCancelled() {
            return false;
        }

        @Override
        public void onGpxDataItemReady(GpxDataItem item) {
            addAppearanceToGpx(gpxFile, item);
            saveAndShareGpx(app, gpxFile);
        }
    };
    return app.getGpxDbHelper().getItem(new File(gpxFile.path), itemCallback);
}
Also used : GpxDataItemCallback(net.osmand.plus.track.helpers.GpxDbHelper.GpxDataItemCallback) GpxDataItem(net.osmand.plus.track.helpers.GPXDatabase.GpxDataItem) GPXFile(net.osmand.GPXUtilities.GPXFile) SelectedGpxFile(net.osmand.plus.track.helpers.GpxSelectionHelper.SelectedGpxFile) File(java.io.File)

Aggregations

GpxDataItem (net.osmand.plus.track.helpers.GPXDatabase.GpxDataItem)6 GpxDataItemCallback (net.osmand.plus.track.helpers.GpxDbHelper.GpxDataItemCallback)6 File (java.io.File)5 SelectedGpxFile (net.osmand.plus.track.helpers.GpxSelectionHelper.SelectedGpxFile)5 GPXFile (net.osmand.GPXUtilities.GPXFile)4 Nullable (androidx.annotation.Nullable)2 SpannableString (android.text.SpannableString)1 View (android.view.View)1 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)1 OnBackPressedCallback (androidx.activity.OnBackPressedCallback)1 GPXTrackAnalysis (net.osmand.GPXUtilities.GPXTrackAnalysis)1 TrackDrawInfo (net.osmand.plus.track.TrackDrawInfo)1 FilteredSelectedGpxFile (net.osmand.plus.track.helpers.FilteredSelectedGpxFile)1 GpxDbHelper (net.osmand.plus.track.helpers.GpxDbHelper)1