From 96252736c42ea7811f5e112167df59350800c79a Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Thu, 2 Apr 2015 00:46:58 +0200 Subject: [PATCH] Refresh dashboard --- OsmAnd/src/net/osmand/plus/activities/MapActivity.java | 10 +++++++++- .../net/osmand/plus/monitoring/DashTrackFragment.java | 10 +++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java index a622f96c17..984ee88438 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java @@ -208,7 +208,9 @@ public class MapActivity extends AccessibleActivity { System.err.println("OnCreate for MapActivity took " + (System.currentTimeMillis() - tm) + " ms"); } mapView.refreshMap(true); - + if(dashboardOnMap != null) { + dashboardOnMap.updateLocation(true, true, false); + } } private void checkAppInitialization() { @@ -231,6 +233,9 @@ public class MapActivity extends AccessibleActivity { } if(event == InitEvents.MAPS_INITIALIZED) { mapView.refreshMap(true); + if(dashboardOnMap != null) { + dashboardOnMap.updateLocation(true, true, false); + } } } @@ -240,6 +245,9 @@ public class MapActivity extends AccessibleActivity { setupOpenGLView(false); } mapView.refreshMap(true); + if(dashboardOnMap != null) { + dashboardOnMap.updateLocation(true, true, false); + } findViewById(R.id.init_progress).setVisibility(View.GONE); findViewById(R.id.drawer_layout).invalidate(); } diff --git a/OsmAnd/src/net/osmand/plus/monitoring/DashTrackFragment.java b/OsmAnd/src/net/osmand/plus/monitoring/DashTrackFragment.java index dbb90dea6b..06a73a4031 100644 --- a/OsmAnd/src/net/osmand/plus/monitoring/DashTrackFragment.java +++ b/OsmAnd/src/net/osmand/plus/monitoring/DashTrackFragment.java @@ -152,12 +152,12 @@ public class DashTrackFragment extends DashBaseFragment { }); ImageButton showOnMap = ((ImageButton) v.findViewById(R.id.show_on_map)); showOnMap.setVisibility(View.VISIBLE); - updateShowOnMap(app, f, showOnMap); + updateShowOnMap(app, f, v, showOnMap); tracks.addView(v); } } - private void updateShowOnMap(final OsmandApplication app, final File f, final ImageButton showOnMap) { + private void updateShowOnMap(final OsmandApplication app, final File f, View v, final ImageButton showOnMap) { final GpxSelectionHelper selectedGpxHelper = app.getSelectedGpxHelper(); final SelectedGpxFile selected = selectedGpxHelper.getSelectedFileByPath(f.getAbsolutePath()); if(selected != null) { @@ -166,7 +166,11 @@ public class DashTrackFragment extends DashBaseFragment { @Override public void onClick(View v) { selectedGpxHelper.selectGpxFile(selected.getGpxFile(), false, false); - updateShowOnMap(app, f, showOnMap); + AvailableGPXFragment.GpxInfo info = new AvailableGPXFragment.GpxInfo(); + info.subfolder = ""; + info.file = f; + AvailableGPXFragment.udpateGpxInfoView(v, info, app, true); + updateShowOnMap(app, f, v, showOnMap); } }); } else {