Fix map zoom update for analyze track
This commit is contained in:
parent
e225ad7b03
commit
80381c1c22
1 changed files with 10 additions and 2 deletions
|
@ -23,6 +23,7 @@ import net.osmand.plus.R;
|
||||||
import net.osmand.plus.activities.MapActivity;
|
import net.osmand.plus.activities.MapActivity;
|
||||||
import net.osmand.plus.base.BaseOsmAndFragment;
|
import net.osmand.plus.base.BaseOsmAndFragment;
|
||||||
import net.osmand.plus.helpers.AndroidUiHelper;
|
import net.osmand.plus.helpers.AndroidUiHelper;
|
||||||
|
import net.osmand.plus.mapcontextmenu.MapContextMenu;
|
||||||
|
|
||||||
public class TrackDetailsMenuFragment extends BaseOsmAndFragment {
|
public class TrackDetailsMenuFragment extends BaseOsmAndFragment {
|
||||||
public static final String TAG = "TrackDetailsMenuFragment";
|
public static final String TAG = "TrackDetailsMenuFragment";
|
||||||
|
@ -91,7 +92,14 @@ public class TrackDetailsMenuFragment extends BaseOsmAndFragment {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
updateInfo(false);
|
MapContextMenu contextMenu = mapActivity.getContextMenu();
|
||||||
|
final boolean forceFitTrackOnMap;
|
||||||
|
if (contextMenu.isActive()) {
|
||||||
|
forceFitTrackOnMap = !(contextMenu.getPointDescription() != null && contextMenu.getPointDescription().isGpxPoint());
|
||||||
|
} else {
|
||||||
|
forceFitTrackOnMap = true;
|
||||||
|
}
|
||||||
|
updateInfo(forceFitTrackOnMap);
|
||||||
|
|
||||||
ViewTreeObserver vto = mainView.getViewTreeObserver();
|
ViewTreeObserver vto = mainView.getViewTreeObserver();
|
||||||
vto.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
vto.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
||||||
|
@ -105,7 +113,7 @@ public class TrackDetailsMenuFragment extends BaseOsmAndFragment {
|
||||||
obs.removeGlobalOnLayoutListener(this);
|
obs.removeGlobalOnLayoutListener(this);
|
||||||
}
|
}
|
||||||
if (getMapActivity() != null) {
|
if (getMapActivity() != null) {
|
||||||
updateInfo(false);
|
updateInfo(forceFitTrackOnMap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue