Enter fullscreen mode after single tap on map
This commit is contained in:
parent
aaa9753785
commit
9e88a67182
2 changed files with 17 additions and 2 deletions
|
@ -812,7 +812,9 @@ public class ContextMenuLayer extends OsmandMapLayer {
|
|||
boolean processed = hideVisibleMenues();
|
||||
processed |= menu.onSingleTapOnMap();
|
||||
if (!processed) {
|
||||
activity.getMapLayers().getMapControlsLayer().switchMapControlsVisibility();
|
||||
MapControlsLayer controlsLayer = activity.getMapLayers().getMapControlsLayer();
|
||||
controlsLayer.switchMapControlsVisibility();
|
||||
controlsLayer.switchStatusbarAndNavbarVisibility();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -48,7 +48,6 @@ import net.osmand.plus.dialogs.DirectionsDialogs;
|
|||
import net.osmand.plus.mapcontextmenu.MapContextMenu;
|
||||
import net.osmand.plus.mapcontextmenu.other.MapRouteInfoMenu;
|
||||
import net.osmand.plus.mapcontextmenu.other.TrackDetailsMenu;
|
||||
import net.osmand.plus.measurementtool.MeasurementToolFragment;
|
||||
import net.osmand.plus.routing.RoutingHelper;
|
||||
import net.osmand.plus.views.corenative.NativeCoreContext;
|
||||
|
||||
|
@ -687,6 +686,20 @@ public class MapControlsLayer extends OsmandMapLayer {
|
|||
}
|
||||
}
|
||||
|
||||
public void switchStatusbarAndNavbarVisibility() {
|
||||
int uiOptions = mapActivity.getWindow().getDecorView().getSystemUiVisibility();
|
||||
if (Build.VERSION.SDK_INT >= 14) {
|
||||
uiOptions ^= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 16) {
|
||||
uiOptions ^= View.SYSTEM_UI_FLAG_FULLSCREEN;
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 19) {
|
||||
uiOptions ^= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
|
||||
}
|
||||
mapActivity.getWindow().getDecorView().setSystemUiVisibility(uiOptions);
|
||||
}
|
||||
|
||||
public void startNavigation() {
|
||||
OsmandApplication app = mapActivity.getMyApplication();
|
||||
RoutingHelper routingHelper = app.getRoutingHelper();
|
||||
|
|
Loading…
Reference in a new issue