Refresh dashboard

This commit is contained in:
Victor Shcherb 2015-04-02 00:46:58 +02:00
parent 79b2d47ced
commit 96252736c4
2 changed files with 16 additions and 4 deletions

View file

@ -208,7 +208,9 @@ public class MapActivity extends AccessibleActivity {
System.err.println("OnCreate for MapActivity took " + (System.currentTimeMillis() - tm) + " ms"); System.err.println("OnCreate for MapActivity took " + (System.currentTimeMillis() - tm) + " ms");
} }
mapView.refreshMap(true); mapView.refreshMap(true);
if(dashboardOnMap != null) {
dashboardOnMap.updateLocation(true, true, false);
}
} }
private void checkAppInitialization() { private void checkAppInitialization() {
@ -231,6 +233,9 @@ public class MapActivity extends AccessibleActivity {
} }
if(event == InitEvents.MAPS_INITIALIZED) { if(event == InitEvents.MAPS_INITIALIZED) {
mapView.refreshMap(true); mapView.refreshMap(true);
if(dashboardOnMap != null) {
dashboardOnMap.updateLocation(true, true, false);
}
} }
} }
@ -240,6 +245,9 @@ public class MapActivity extends AccessibleActivity {
setupOpenGLView(false); setupOpenGLView(false);
} }
mapView.refreshMap(true); mapView.refreshMap(true);
if(dashboardOnMap != null) {
dashboardOnMap.updateLocation(true, true, false);
}
findViewById(R.id.init_progress).setVisibility(View.GONE); findViewById(R.id.init_progress).setVisibility(View.GONE);
findViewById(R.id.drawer_layout).invalidate(); findViewById(R.id.drawer_layout).invalidate();
} }

View file

@ -152,12 +152,12 @@ public class DashTrackFragment extends DashBaseFragment {
}); });
ImageButton showOnMap = ((ImageButton) v.findViewById(R.id.show_on_map)); ImageButton showOnMap = ((ImageButton) v.findViewById(R.id.show_on_map));
showOnMap.setVisibility(View.VISIBLE); showOnMap.setVisibility(View.VISIBLE);
updateShowOnMap(app, f, showOnMap); updateShowOnMap(app, f, v, showOnMap);
tracks.addView(v); 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 GpxSelectionHelper selectedGpxHelper = app.getSelectedGpxHelper();
final SelectedGpxFile selected = selectedGpxHelper.getSelectedFileByPath(f.getAbsolutePath()); final SelectedGpxFile selected = selectedGpxHelper.getSelectedFileByPath(f.getAbsolutePath());
if(selected != null) { if(selected != null) {
@ -166,7 +166,11 @@ public class DashTrackFragment extends DashBaseFragment {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
selectedGpxHelper.selectGpxFile(selected.getGpxFile(), false, false); 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 { } else {