Merge pull request #4362 from osmandapp/gpx_track_info

Gpx track info
This commit is contained in:
Alexey 2017-08-30 13:52:03 +03:00 committed by GitHub
commit d3a3d51a24
2 changed files with 8 additions and 2 deletions

View file

@ -6,6 +6,7 @@ import android.database.sqlite.SQLiteOpenHelper;
import android.text.format.DateFormat;
import net.osmand.PlatformUtil;
import net.osmand.data.LatLon;
import net.osmand.plus.GPXDatabase.GpxDataItem;
import net.osmand.plus.GPXUtilities;
import net.osmand.plus.GPXUtilities.GPXFile;
import net.osmand.plus.GPXUtilities.GPXTrackAnalysis;
@ -226,6 +227,11 @@ public class SavingTrackHelper extends SQLiteOpenHelper {
warnings.add(warn);
return warnings;
}
GPXFile gpx = data.get(f);
GPXTrackAnalysis analysis = gpx.getAnalysis(fout.lastModified());
GpxDataItem item = new GpxDataItem(fout, analysis);
ctx.getGpxDatabase().add(item);
}
}
}

View file

@ -467,7 +467,7 @@ public class GpxUiHelper {
final ContextMenuItem item = adapter.getItem(position);
GPXInfo info = list.get(position);
udpateGpxInfoView(v, item, info, getDataItem(info), showCurrentGpx && position == 0, app);
updateGpxInfoView(v, item, info, getDataItem(info), showCurrentGpx && position == 0, app);
if (item.getSelected() == null) {
v.findViewById(R.id.check_item).setVisibility(View.GONE);
@ -704,7 +704,7 @@ public class GpxUiHelper {
return dlg;
}
public static void udpateGpxInfoView(View v, ContextMenuItem item, GPXInfo info, GpxDataItem dataItem, boolean currentlyRecordingTrack, OsmandApplication app) {
public static void updateGpxInfoView(View v, ContextMenuItem item, GPXInfo info, GpxDataItem dataItem, boolean currentlyRecordingTrack, OsmandApplication app) {
TextView viewName = ((TextView) v.findViewById(R.id.name));
viewName.setText(item.getTitle().replace("/", "").trim());
ImageView icon = (ImageView) v.findViewById(R.id.icon);