From 40e55858cac6a0cd563becbcb188c5f32ead669f Mon Sep 17 00:00:00 2001 From: sonora Date: Sun, 26 Jun 2016 09:48:48 +0200 Subject: [PATCH] Sort gps_info to bottom of the stack (very technical) --- OsmAnd/src/net/osmand/plus/ApplicationMode.java | 6 +++--- .../src/net/osmand/plus/views/MapInfoLayer.java | 16 +++++++++------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/ApplicationMode.java b/OsmAnd/src/net/osmand/plus/ApplicationMode.java index 5dc94c8840..5dbb44af47 100644 --- a/OsmAnd/src/net/osmand/plus/ApplicationMode.java +++ b/OsmAnd/src/net/osmand/plus/ApplicationMode.java @@ -77,17 +77,17 @@ public class ApplicationMode { regWidget("time", exceptDefault); regWidget("speed", exceptPedestrianAndDefault); regWidget("max_speed", CAR); - regWidget("gps_info", none); regWidget("altitude", pedestrianBicycle); + regWidget("gps_info", none); // top - regWidget("compass", all); regWidget("config", none); + regWidget("layers", none); + regWidget("compass", all); regWidget("street_name", exceptAirBoatDefault); regWidget("back_to_location", all); regWidget("monitoring_services", none); regWidget("bgService", none); - regWidget("layers", none); } diff --git a/OsmAnd/src/net/osmand/plus/views/MapInfoLayer.java b/OsmAnd/src/net/osmand/plus/views/MapInfoLayer.java index ad6181da82..638171e65c 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapInfoLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapInfoLayer.java @@ -118,11 +118,11 @@ public class MapInfoLayer extends OsmandMapLayer { NextTurnInfoWidget bigInfoControl = ric.createNextInfoControl(map, app, false); registerSideWidget(bigInfoControl, R.drawable.ic_action_next_turn, R.string.map_widget_next_turn, "next_turn", true, 5); NextTurnInfoWidget smallInfoControl = ric.createNextInfoControl(map, app, true); - registerSideWidget(smallInfoControl, R.drawable.ic_action_next_turn, R.string.map_widget_next_turn_small, "next_turn_small", true, - 10); + registerSideWidget(smallInfoControl, R.drawable.ic_action_next_turn, R.string.map_widget_next_turn_small, "next_turn_small", true, 10); NextTurnInfoWidget nextNextInfoControl = ric.createNextNextInfoControl(map, app, true); registerSideWidget(nextNextInfoControl, R.drawable.ic_action_next_turn, R.string.map_widget_next_next_turn, "next_next_turn",true, 15); - // right stack + + // register right stack TextInfoWidget intermediateDist = ric.createIntermediateDistanceControl(map); registerSideWidget(intermediateDist, R.drawable.ic_action_intermediate, R.string.map_widget_intermediate_distance, "intermediate_distance", false, 3); TextInfoWidget dist = ric.createDistanceControl(map); @@ -144,12 +144,12 @@ public class MapInfoLayer extends OsmandMapLayer { TextInfoWidget speed = ric.createSpeedControl(map); registerSideWidget(speed, R.drawable.ic_action_speed, R.string.map_widget_speed, "speed", false, 15); - TextInfoWidget gpsInfo = mic.createGPSInfoControl(map); - registerSideWidget(gpsInfo, R.drawable.ic_action_gps_info, R.string.map_widget_gps_info, "gps_info", false, 17); TextInfoWidget maxspeed = ric.createMaxSpeedControl(map); registerSideWidget(maxspeed, R.drawable.ic_action_speed_limit, R.string.map_widget_max_speed, "max_speed", false, 18); TextInfoWidget alt = mic.createAltitudeControl(map); registerSideWidget(alt, R.drawable.ic_action_altitude, R.string.map_widget_altitude, "altitude", false, 20); + TextInfoWidget gpsInfo = mic.createGPSInfoControl(map); + registerSideWidget(gpsInfo, R.drawable.ic_action_gps_info, R.string.map_widget_gps_info, "gps_info", false, 23); TextInfoWidget plainTime = ric.createPlainTimeControl(map); registerSideWidget(plainTime, R.drawable.ic_action_time, R.string.map_widget_plain_time, "plain_time", false, 25); TextInfoWidget battery = ric.createBatteryControl(map); @@ -157,12 +157,14 @@ public class MapInfoLayer extends OsmandMapLayer { } public void recreateControls() { - rightStack.removeAllViews(); - mapInfoControls.populateStackControl(rightStack, settings.getApplicationMode(), false, expanded); leftStack.removeAllViews(); mapInfoControls.populateStackControl(leftStack, settings.getApplicationMode(), true, expanded); leftStack.requestLayout(); + + rightStack.removeAllViews(); + mapInfoControls.populateStackControl(rightStack, settings.getApplicationMode(), false, expanded); rightStack.requestLayout(); + expand.setVisibility(mapInfoControls.hasCollapsibles(settings.getApplicationMode())? View.VISIBLE : View.GONE); this.expand.setImageResource(expanded ? R.drawable.map_up :