Search in sources :

Example 1 with AGpxFileDetails

use of net.osmand.aidl.gpx.AGpxFileDetails in project Osmand by osmandapp.

the class OsmandAidlApi method getImportedGpx.

boolean getImportedGpx(List<AGpxFile> files) {
    List<GpxDataItem> gpxDataItems = app.getGpxDbHelper().getItems();
    for (GpxDataItem dataItem : gpxDataItems) {
        File file = dataItem.getFile();
        if (file.exists()) {
            String fileName = file.getName();
            boolean active = app.getSelectedGpxHelper().getSelectedFileByPath(file.getAbsolutePath()) != null;
            long modifiedTime = dataItem.getFileLastModifiedTime();
            long fileSize = file.length();
            AGpxFileDetails details = null;
            GPXTrackAnalysis analysis = dataItem.getAnalysis();
            if (analysis != null) {
                details = createGpxFileDetails(analysis);
            }
            files.add(new AGpxFile(fileName, modifiedTime, fileSize, active, details));
        }
    }
    return true;
}
Also used : GpxDataItem(net.osmand.plus.track.helpers.GPXDatabase.GpxDataItem) AGpxFileDetails(net.osmand.aidl.gpx.AGpxFileDetails) GPXTrackAnalysis(net.osmand.GPXUtilities.GPXTrackAnalysis) AGpxFile(net.osmand.aidl.gpx.AGpxFile) GPXFile(net.osmand.GPXUtilities.GPXFile) SelectedGpxFile(net.osmand.plus.track.helpers.GpxSelectionHelper.SelectedGpxFile) ASqliteDbFile(net.osmand.aidl.tiles.ASqliteDbFile) File(java.io.File) ASelectedGpxFile(net.osmand.aidl.gpx.ASelectedGpxFile) AGpxFile(net.osmand.aidl.gpx.AGpxFile)

Aggregations

File (java.io.File)1 GPXFile (net.osmand.GPXUtilities.GPXFile)1 GPXTrackAnalysis (net.osmand.GPXUtilities.GPXTrackAnalysis)1 AGpxFile (net.osmand.aidl.gpx.AGpxFile)1 AGpxFileDetails (net.osmand.aidl.gpx.AGpxFileDetails)1 ASelectedGpxFile (net.osmand.aidl.gpx.ASelectedGpxFile)1 ASqliteDbFile (net.osmand.aidl.tiles.ASqliteDbFile)1 GpxDataItem (net.osmand.plus.track.helpers.GPXDatabase.GpxDataItem)1 SelectedGpxFile (net.osmand.plus.track.helpers.GpxSelectionHelper.SelectedGpxFile)1