Fix widgets showing up after route between points dialog

This commit is contained in:
Dima-1 2020-09-09 18:47:02 +03:00
parent 240e532bde
commit f2d64a7464

View file

@ -165,7 +165,6 @@ public class GpxApproximationFragment extends ContextMenuScrollFragment
params.gravity = Gravity.BOTTOM | Gravity.START;
mainView.findViewById(R.id.control_buttons).setLayoutParams(params);
}
enterGpxApproximationMode();
runLayoutListener();
calculateGpxApproximation();
@ -193,7 +192,6 @@ public class GpxApproximationFragment extends ContextMenuScrollFragment
if (gpxApproximator != null) {
gpxApproximator.cancelApproximation();
}
exitGpxApproximationMode();
if (!applyApproximation) {
Fragment fragment = getTargetFragment();
if (fragment instanceof GpxApproximationFragmentListener) {
@ -276,28 +274,6 @@ public class GpxApproximationFragment extends ContextMenuScrollFragment
}
}
private void enterGpxApproximationMode() {
MapActivity mapActivity = getMapActivity();
if (mapActivity != null) {
boolean portrait = AndroidUiHelper.isOrientationPortrait(mapActivity);
AndroidUiHelper.setVisibility(mapActivity, portrait ? View.INVISIBLE : View.GONE,
R.id.map_left_widgets_panel,
R.id.map_right_widgets_panel,
R.id.map_center_info);
}
}
private void exitGpxApproximationMode() {
MapActivity mapActivity = getMapActivity();
if (mapActivity != null) {
AndroidUiHelper.setVisibility(mapActivity, View.VISIBLE,
R.id.map_left_widgets_panel,
R.id.map_right_widgets_panel,
R.id.map_center_info,
R.id.map_search_button);
}
}
@Override
public boolean shouldShowMapControls(int menuState) {
return (menuState & (MenuState.HEADER_ONLY | MenuState.HALF_SCREEN)) != 0;