parent
b98d76fd25
commit
b7063062f8
4 changed files with 26 additions and 1 deletions
|
@ -3374,6 +3374,9 @@ public class OsmandSettings {
|
||||||
public final CommonPreference<Integer> OSMAND_THEME =
|
public final CommonPreference<Integer> OSMAND_THEME =
|
||||||
new IntPreference("osmand_theme", OSMAND_LIGHT_THEME).makeProfile().cache();
|
new IntPreference("osmand_theme", OSMAND_LIGHT_THEME).makeProfile().cache();
|
||||||
|
|
||||||
|
public final OsmandPreference<Boolean> OPEN_ONLY_HEADER_STATE_ROUTE_CALCULATED =
|
||||||
|
new BooleanPreference("open_only_header_route_calculated", false).makeProfile();
|
||||||
|
|
||||||
public boolean isLightActionBar() {
|
public boolean isLightActionBar() {
|
||||||
return isLightContent();
|
return isLightContent();
|
||||||
}
|
}
|
||||||
|
|
|
@ -742,6 +742,8 @@ public abstract class ContextMenuFragment extends BaseOsmAndFragment {
|
||||||
int newMenuState = getCurrentMenuState();
|
int newMenuState = getCurrentMenuState();
|
||||||
boolean needMapAdjust = currentMenuState != newMenuState && newMenuState != MenuState.FULL_SCREEN;
|
boolean needMapAdjust = currentMenuState != newMenuState && newMenuState != MenuState.FULL_SCREEN;
|
||||||
|
|
||||||
|
updateMenuState(currentMenuState, newMenuState);
|
||||||
|
|
||||||
applyPosY(currentY, needCloseMenu, needMapAdjust, currentMenuState, newMenuState, 0, animated);
|
applyPosY(currentY, needCloseMenu, needMapAdjust, currentMenuState, newMenuState, 0, animated);
|
||||||
|
|
||||||
ContextMenuFragmentListener listener = this.listener;
|
ContextMenuFragmentListener listener = this.listener;
|
||||||
|
@ -750,6 +752,9 @@ public abstract class ContextMenuFragment extends BaseOsmAndFragment {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void updateMenuState(int currentMenuState, int newMenuState) {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private int getPosY(final int currentY, boolean needCloseMenu, int previousState) {
|
private int getPosY(final int currentY, boolean needCloseMenu, int previousState) {
|
||||||
if (needCloseMenu) {
|
if (needCloseMenu) {
|
||||||
|
|
|
@ -445,7 +445,12 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener
|
||||||
fragment.updateInfo();
|
fragment.updateInfo();
|
||||||
if (!routeCalculationInProgress) {
|
if (!routeCalculationInProgress) {
|
||||||
fragment.hideRouteCalculationProgressBar();
|
fragment.hideRouteCalculationProgressBar();
|
||||||
|
if(!app.getSettings().OPEN_ONLY_HEADER_STATE_ROUTE_CALCULATED.
|
||||||
|
getModeValue(app.getRoutingHelper().getAppMode())) {
|
||||||
fragment.openMenuHalfScreen();
|
fragment.openMenuHalfScreen();
|
||||||
|
} else {
|
||||||
|
fragment.openMenuHeaderOnly();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -186,6 +186,18 @@ public class MapRouteInfoMenuFragment extends ContextMenuFragment {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void updateMenuState(int currentMenuState, int newMenuState) {
|
||||||
|
if(getMyApplication().getRoutingHelper().isRouteCalculated() ) {
|
||||||
|
ApplicationMode mV = getMyApplication().getRoutingHelper().getAppMode();
|
||||||
|
if (newMenuState == MenuState.HEADER_ONLY && currentMenuState == MenuState.HALF_SCREEN) {
|
||||||
|
getSettings().OPEN_ONLY_HEADER_STATE_ROUTE_CALCULATED.setModeValue(mV,true);
|
||||||
|
} else if (currentMenuState == MenuState.HEADER_ONLY && newMenuState == MenuState.HALF_SCREEN) {
|
||||||
|
getSettings().OPEN_ONLY_HEADER_STATE_ROUTE_CALCULATED.resetModeToDefault(mV);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void setViewY(int y, boolean animated, boolean adjustMapPos) {
|
protected void setViewY(int y, boolean animated, boolean adjustMapPos) {
|
||||||
super.setViewY(y, animated, adjustMapPos);
|
super.setViewY(y, animated, adjustMapPos);
|
||||||
|
|
Loading…
Reference in a new issue