diff --git a/OsmAnd/res/layout-land/map_hud_bottom.xml b/OsmAnd/res/layout-land/map_hud_bottom.xml
index ccaf65e5ac..fac98f7489 100644
--- a/OsmAnd/res/layout-land/map_hud_bottom.xml
+++ b/OsmAnd/res/layout-land/map_hud_bottom.xml
@@ -80,13 +80,6 @@
android:visibility="gone"
layout="@layout/recording_note_fragment" />
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/layout-land/plan_route_settings.xml b/OsmAnd/res/layout-land/plan_route_settings.xml
new file mode 100644
index 0000000000..7e6ff14e2e
--- /dev/null
+++ b/OsmAnd/res/layout-land/plan_route_settings.xml
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/layout/map_hud_bottom.xml b/OsmAnd/res/layout/map_hud_bottom.xml
index 234893bbb3..6088fe7e4c 100644
--- a/OsmAnd/res/layout/map_hud_bottom.xml
+++ b/OsmAnd/res/layout/map_hud_bottom.xml
@@ -195,7 +195,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
-
-
-
+
+
+
+
+
+
+ android:layout_gravity="left">
diff --git a/OsmAnd/res/layout/plan_route_info.xml b/OsmAnd/res/layout/plan_route_info.xml
index ffa3bc30c1..2daa2b592c 100644
--- a/OsmAnd/res/layout/plan_route_info.xml
+++ b/OsmAnd/res/layout/plan_route_info.xml
@@ -3,51 +3,58 @@
android:id="@+id/plan_route_info"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
- android:background="?attr/bg_color"
+ android:background="?attr/bottom_menu_view_bg"
android:orientation="vertical" >
+ android:layout_height="@dimen/list_item_height"
+ android:orientation="vertical">
-
-
-
-
-
-
-
-
-
-
-
+ android:layout_height="wrap_content">
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -125,7 +132,7 @@
@@ -158,7 +165,7 @@
@@ -212,15 +219,18 @@
android:src="@drawable/ic_next" />
-
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/layout/plan_route_settings.xml b/OsmAnd/res/layout/plan_route_settings.xml
index 584f36affa..591bb88ed7 100644
--- a/OsmAnd/res/layout/plan_route_settings.xml
+++ b/OsmAnd/res/layout/plan_route_settings.xml
@@ -2,61 +2,59 @@
-
+
+
+
+ android:orientation="horizontal">
-
+
-
+
-
+
+
+
+
-
-
-
-
-
-
-
+
-
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/layout/recording_note_fragment.xml b/OsmAnd/res/layout/recording_note_fragment.xml
index 29a580c947..2d84eacd22 100644
--- a/OsmAnd/res/layout/recording_note_fragment.xml
+++ b/OsmAnd/res/layout/recording_note_fragment.xml
@@ -5,7 +5,6 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_below="@id/map_route_preparation_layout"
android:layout_gravity="bottom"
android:background="?attr/bottom_menu_view_bg"
android:clickable="true"
diff --git a/OsmAnd/res/values-large/sizes.xml b/OsmAnd/res/values-large/sizes.xml
index 690e645b5f..1187d4062d 100644
--- a/OsmAnd/res/values-large/sizes.xml
+++ b/OsmAnd/res/values-large/sizes.xml
@@ -33,8 +33,9 @@
9dp
9dp
150dp
-
-
+ 48dp
+
+
3dp
3dp
4dp
diff --git a/OsmAnd/res/values/sizes.xml b/OsmAnd/res/values/sizes.xml
index 3282a0f8ed..e21f98920e 100644
--- a/OsmAnd/res/values/sizes.xml
+++ b/OsmAnd/res/values/sizes.xml
@@ -54,7 +54,8 @@
60dp
54dp
48dp
-
+ 48dp
+
40dp
52dp
44dp
diff --git a/OsmAnd/src/net/osmand/plus/activities/ShowRouteInfoActivity.java b/OsmAnd/src/net/osmand/plus/activities/ShowRouteInfoActivity.java
index 48631a273c..81dccaf93c 100644
--- a/OsmAnd/src/net/osmand/plus/activities/ShowRouteInfoActivity.java
+++ b/OsmAnd/src/net/osmand/plus/activities/ShowRouteInfoActivity.java
@@ -22,7 +22,7 @@ import net.osmand.plus.R;
import net.osmand.plus.routing.RouteDirectionInfo;
import net.osmand.plus.routing.RoutingHelper;
import net.osmand.plus.views.TurnPathHelper;
-import net.osmand.plus.views.controls.MapRouteInfoControl;
+import net.osmand.plus.mapcontextmenu.other.MapRouteInfoControl;
import net.osmand.util.Algorithms;
import android.content.Intent;
import android.net.Uri;
diff --git a/OsmAnd/src/net/osmand/plus/activities/actions/AppModeDialog.java b/OsmAnd/src/net/osmand/plus/activities/actions/AppModeDialog.java
index d23694d7da..ec14b9bbf3 100644
--- a/OsmAnd/src/net/osmand/plus/activities/actions/AppModeDialog.java
+++ b/OsmAnd/src/net/osmand/plus/activities/actions/AppModeDialog.java
@@ -103,13 +103,14 @@ public class AppModeDialog {
static private View createToggle(LayoutInflater layoutInflater, OsmandApplication ctx, LinearLayout layout, ApplicationMode mode){
- int metrics = (int) ctx.getResources().getDimension(R.dimen.list_item_height);
- View tb = layoutInflater.inflate(R.layout.mode_view, null);
+ int metricsX = (int) ctx.getResources().getDimension(R.dimen.map_mode_button_width);
+ int metricsY = (int) ctx.getResources().getDimension(R.dimen.list_item_height);
+ View tb = layoutInflater.inflate(R.layout.mode_view, null);
tb.findViewById(R.id.app_mode_icon).setContentDescription(mode.toHumanString(ctx));
ImageView iv = (ImageView) tb.findViewById(R.id.app_mode_icon);
iv.setImageDrawable(ctx.getIconsCache().getIcon(mode.getSmallIconDark(), R.color.osmand_orange));
// tb.setCompoundDrawablesWithIntrinsicBounds(null, ctx.getIconsCache().getIcon(mode.getIconId(), R.color.app_mode_icon_color), null, null);
- LayoutParams lp = new LinearLayout.LayoutParams(metrics, metrics);
+ LayoutParams lp = new LinearLayout.LayoutParams(metricsX, metricsY);
// lp.setMargins(left, 0, 0, 0);
layout.addView(tb, lp);
return tb;
diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java
index d4a372ea5c..065565b456 100644
--- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java
+++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java
@@ -259,6 +259,10 @@ public class MapContextMenu extends MenuTitleController {
}
}
+ public void showMinimized(LatLon latLon, PointDescription pointDescription, Object object) {
+ init(latLon, pointDescription, object);
+ }
+
public void close() {
if (active) {
active = false;
diff --git a/OsmAnd/src/net/osmand/plus/views/controls/MapRouteInfoControl.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MapRouteInfoControl.java
similarity index 93%
rename from OsmAnd/src/net/osmand/plus/views/controls/MapRouteInfoControl.java
rename to OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MapRouteInfoControl.java
index c469543cf9..763bacd5f4 100644
--- a/OsmAnd/src/net/osmand/plus/views/controls/MapRouteInfoControl.java
+++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MapRouteInfoControl.java
@@ -1,4 +1,4 @@
-package net.osmand.plus.views.controls;
+package net.osmand.plus.mapcontextmenu.other;
import android.app.Dialog;
import android.content.DialogInterface;
@@ -42,7 +42,6 @@ import net.osmand.plus.routing.RoutingHelper;
import net.osmand.plus.routing.RoutingHelper.IRouteInformationListener;
import net.osmand.plus.views.MapControlsLayer;
import net.osmand.plus.views.OsmandMapTileView;
-import net.osmand.plus.views.controls.MapRoutePreferencesControl.RoutePrepareDialog;
import java.util.ArrayList;
import java.util.HashSet;
@@ -82,7 +81,7 @@ public class MapRouteInfoControl implements IRouteInformationListener {
} else {
getTargets().setStartPoint(latlon, true, null);
}
- contextMenu.show(latlon, null, null);
+ contextMenu.showMinimized(latlon, null, null);
showDialog();
return true;
}
@@ -120,7 +119,6 @@ public class MapRouteInfoControl implements IRouteInformationListener {
}
private void updateInfo(final View main) {
- updateWptBtn(main);
updateViaView(main);
updateFromSpinner(main);
updateToSpinner(main);
@@ -150,22 +148,6 @@ public class MapRouteInfoControl implements IRouteInformationListener {
}
}
- private void updateWptBtn(final View parentView) {
- ImageView wptBtn = (ImageView) parentView.findViewById(R.id.waypoints);
- wptBtn.setImageDrawable(mapActivity.getMyApplication().getIconsCache()
- .getContentIcon(R.drawable.map_action_waypoints));
- wptBtn.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- if (getTargets().checkPointToNavigateShort()) {
- hideDialog();
- mapActivity.getMapActions().openIntermediatePointsDialog();
- }
- }
-
- });
- }
-
private void updateApplicationModes(final View parentView) {
final OsmandSettings settings = mapActivity.getMyApplication().getSettings();
ApplicationMode am = settings.APPLICATION_MODE.get();
@@ -339,9 +321,7 @@ public class MapRouteInfoControl implements IRouteInformationListener {
if (routingHelper.getRouteDirections().size() > directionInfo) {
RouteDirectionInfo info = routingHelper.getRouteDirections().get(directionInfo);
net.osmand.Location l = routingHelper.getLocationFromRouteDirection(info);
- contextMenu.show(new LatLon(l.getLatitude(), l.getLongitude()), null, info);
-// contextMenuLayer.setLocation(new LatLon(l.getLatitude(), l.getLongitude()),
-// info.getDescriptionRoute(ctx));
+ contextMenu.showMinimized(new LatLon(l.getLatitude(), l.getLongitude()), null, info);
mapView.getAnimatedDraggingThread().startMoving(l.getLatitude(), l.getLongitude(),
mapView.getZoom(), true);
}
@@ -364,8 +344,7 @@ public class MapRouteInfoControl implements IRouteInformationListener {
directionInfo++;
RouteDirectionInfo info = routingHelper.getRouteDirections().get(directionInfo);
net.osmand.Location l = routingHelper.getLocationFromRouteDirection(info);
- contextMenu.show(new LatLon(l.getLatitude(), l.getLongitude()), null, info);
-// contextMenuLayer.setLocation(new LatLon(l.getLatitude(), l.getLongitude()), info.getDescriptionRoute(ctx));
+ contextMenu.showMinimized(new LatLon(l.getLatitude(), l.getLongitude()), null, info);
mapView.getAnimatedDraggingThread().startMoving(l.getLatitude(), l.getLongitude(), mapView.getZoom(), true);
}
mapView.refreshMap();
@@ -550,10 +529,10 @@ public class MapRouteInfoControl implements IRouteInformationListener {
public void hideDialog() {
Dialog dialog = this.dialog;
if (dialog != null) {
- if(dialog instanceof RoutePrepareDialog &&
- ((RoutePrepareDialog) dialog).getListener() != null) {
- ((RoutePrepareDialog) dialog).getListener().onDismiss(dialog);
- ((RoutePrepareDialog) dialog).cancelDismissListener();
+ if(dialog instanceof MapRoutePreferencesControl.RoutePrepareDialog &&
+ ((MapRoutePreferencesControl.RoutePrepareDialog) dialog).getListener() != null) {
+ ((MapRoutePreferencesControl.RoutePrepareDialog) dialog).getListener().onDismiss(dialog);
+ ((MapRoutePreferencesControl.RoutePrepareDialog) dialog).cancelDismissListener();
}
dialog.dismiss();
this.dialog = null;
diff --git a/OsmAnd/src/net/osmand/plus/views/controls/MapRoutePreferencesControl.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MapRoutePreferencesControl.java
similarity index 98%
rename from OsmAnd/src/net/osmand/plus/views/controls/MapRoutePreferencesControl.java
rename to OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MapRoutePreferencesControl.java
index 0b900c2d23..cf3fd13fbb 100644
--- a/OsmAnd/src/net/osmand/plus/views/controls/MapRoutePreferencesControl.java
+++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MapRoutePreferencesControl.java
@@ -1,4 +1,4 @@
-package net.osmand.plus.views.controls;
+package net.osmand.plus.mapcontextmenu.other;
import java.io.File;
import java.util.ArrayList;
@@ -36,6 +36,8 @@ import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnDismissListener;
import android.content.Intent;
+import android.graphics.Color;
+import android.graphics.drawable.ColorDrawable;
import android.support.v7.widget.PopupMenu;
import android.view.Gravity;
import android.view.MenuItem;
@@ -150,15 +152,15 @@ public class MapRoutePreferencesControl {
public OnDismissListener getListener() {
return listener;
}
-
+
@Override
public void setOnDismissListener(OnDismissListener l) {
this.listener = l;
super.setOnDismissListener(new OnDismissListener() {
-
+
@Override
public void onDismiss(DialogInterface dialog) {
- if(listener != null) {
+ if (listener != null) {
listener.onDismiss(dialog);
}
}
@@ -188,13 +190,14 @@ public class MapRoutePreferencesControl {
lp.width = (int) mapActivity.getResources().getDimension(R.dimen.map_route_planning_land_width);
lp.gravity = Gravity.LEFT;
}
- dialog.getContext().setTheme(R.style.Dialog_Fullscreen);
+ //dialog.getContext().setTheme(R.style.Dialog_Fullscreen);
dialog.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
dialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(ll, new LayoutParams(WindowManager.LayoutParams.MATCH_PARENT,
portrait ? WindowManager.LayoutParams.WRAP_CONTENT : WindowManager.LayoutParams.MATCH_PARENT));
dialog.setCanceledOnTouchOutside(true);
dialog.getWindow().setAttributes(lp);
+ dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
if (maxHeight != -1) {
ll.getViewTreeObserver().addOnGlobalLayoutListener(new OnGlobalLayoutListener() {
boolean wrap = true;
diff --git a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java
index 8aeb169365..6bb0d6e9cf 100644
--- a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java
+++ b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java
@@ -26,7 +26,6 @@ import android.widget.TextView;
import net.londatiga.android.ActionItem;
import net.londatiga.android.QuickAction;
-import net.osmand.PlatformUtil;
import net.osmand.core.android.MapRendererContext;
import net.osmand.data.LatLon;
import net.osmand.data.RotatedTileBox;
@@ -37,24 +36,22 @@ import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.OsmandSettings.CommonPreference;
import net.osmand.plus.R;
+import net.osmand.plus.TargetPointsHelper;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.activities.search.SearchAddressFragment;
import net.osmand.plus.dashboard.DashboardOnMap.DashboardType;
import net.osmand.plus.helpers.AndroidUiHelper;
+import net.osmand.plus.mapcontextmenu.other.MapRouteInfoControl;
+import net.osmand.plus.mapcontextmenu.other.MapRoutePreferencesControl;
import net.osmand.plus.routing.RoutingHelper;
-import net.osmand.plus.views.controls.MapRouteInfoControl;
-import net.osmand.plus.views.controls.MapRoutePreferencesControl;
import net.osmand.plus.views.corenative.NativeCoreContext;
-import org.apache.commons.logging.Log;
-
import java.util.ArrayList;
import java.util.List;
import gnu.trove.list.array.TIntArrayList;
public class MapControlsLayer extends OsmandMapLayer {
- private static final Log LOG = PlatformUtil.getLog(MapControlsLayer.class);
private static final int TIMEOUT_TO_SHOW_BUTTONS = 7000;
public static final int REQUEST_ADDRESS_SELECT = 2;
@@ -67,7 +64,7 @@ public class MapControlsLayer extends OsmandMapLayer {
return mc;
}
- private List controls = new ArrayList();
+ private List controls = new ArrayList<>();
private final MapActivity mapActivity;
private int shadowColor = -1;
// private RulerControl rulerControl;
@@ -80,11 +77,8 @@ public class MapControlsLayer extends OsmandMapLayer {
private MapRoutePreferencesControl optionsRouteControlDialog;
private MapRouteInfoControl mapRouteInfoControlDialog;
- private View routePreparationLayout;
private MapHudButton backToLocationControl;
private MapHudButton menuControl;
- private MapHudButton optionsRouteControl;
- private MapHudButton routeGoControl;
private MapHudButton compassHud;
private float cachedRotate = 0;
private static long startCounter;
@@ -100,7 +94,6 @@ public class MapControlsLayer extends OsmandMapLayer {
private MapHudButton mapZoomOut;
private MapHudButton mapZoomIn;
private MapHudButton layersHud;
- private MapHudButton mapDashControl;
private long lastZoom;
public MapControlsLayer(MapActivity activity) {
@@ -196,7 +189,7 @@ public class MapControlsLayer extends OsmandMapLayer {
private void initTopControls() {
View configureMap = mapActivity.findViewById(R.id.map_layers_button);
- layersHud = createHudButton((ImageView) configureMap, R.drawable.map_layer_dark)
+ layersHud = createHudButton(configureMap, R.drawable.map_layer_dark)
.setIconsId(R.drawable.map_layer_dark, R.drawable.map_layer_night)
.setBg(R.drawable.btn_inset_circle_trans, R.drawable.btn_inset_circle_night);
controls.add(layersHud);
@@ -209,7 +202,7 @@ public class MapControlsLayer extends OsmandMapLayer {
});
View compass = mapActivity.findViewById(R.id.map_compass_button);
- compassHud = createHudButton((ImageView) compass, R.drawable.map_compass).setIconColorId(0).
+ compassHud = createHudButton(compass, R.drawable.map_compass).setIconColorId(0).
setBg(R.drawable.btn_inset_circle_trans, R.drawable.btn_inset_circle_night);
compassHud.compass = true;
controls.add(compassHud);
@@ -224,93 +217,11 @@ public class MapControlsLayer extends OsmandMapLayer {
}
private void initRouteControls() {
- routePreparationLayout = mapActivity.findViewById(R.id.map_route_preparation_layout);
- View dashRouteButton = mapActivity.findViewById(R.id.map_dashboard_route_button);
- final boolean dash = settings.SHOW_DASHBOARD_ON_MAP_SCREEN.get();
- mapDashControl = createHudButton((ImageView) dashRouteButton,
- dash ? R.drawable.map_dashboard : R.drawable.map_drawer).setBg(
- R.drawable.btn_flat, R.drawable.btn_flat_night);
- controls.add(mapDashControl);
-
- dashRouteButton.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- if (dash) {
- mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.DASHBOARD);
- } else {
- mapActivity.openDrawer();
- }
- }
-
-
- });
-
- View cancelRouteButton = mapActivity.findViewById(R.id.map_cancel_route_button);
- controls.add(createHudButton((ImageView) cancelRouteButton, R.drawable.map_action_cancel).setBg(
- R.drawable.btn_flat, R.drawable.btn_flat_night));
-
- cancelRouteButton.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- clickRouteCancel();
- }
-
-
- });
mapRouteInfoControlDialog = new MapRouteInfoControl(mapActivity, this);
-
- View waypointsButton = mapActivity.findViewById(R.id.map_waypoints_route_button);
- controls.add(createHudButton((ImageView) waypointsButton, R.drawable.map_action_waypoints).setBg(
- R.drawable.btn_flat, R.drawable.btn_flat_night));
- waypointsButton.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- clickRouteWaypoints();
- }
-
-
- });
-
- View optionsRouteButton = mapActivity.findViewById(R.id.map_options_route_button);
- optionsRouteControl = createHudButton((ImageView) optionsRouteButton, R.drawable.map_action_settings
- ).setBg(R.drawable.btn_flat, R.drawable.btn_flat_night);
optionsRouteControlDialog = new MapRoutePreferencesControl(mapActivity, this);
- controls.add(optionsRouteControl);
- optionsRouteButton.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- clickRouteParams();
- }
- });
-
- TextView routeGoButton = (TextView) mapActivity.findViewById(R.id.map_go_route_button);
-
- routeGoControl = createHudButton(routeGoButton,
- R.drawable.map_start_navigation).setIconColorId(R.color.color_myloc_distance).setBg(
- R.drawable.btn_flat, R.drawable.btn_flat_night);
- controls.add(routeGoControl);
- routeGoButton.setText(mapActivity.getString(R.string.shared_string_go));
- routeGoButton.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- clickRouteGo();
- }
- });
}
public void updateRouteButtons(View main, boolean routeInfo) {
- ImageView dashButton = (ImageView) main.findViewById(R.id.map_dashboard_route_button);
- dashButton.setImageDrawable(app.getIconsCache().getContentIcon(R.drawable.map_dashboard));
- dashButton.setVisibility(AndroidUiHelper.isOrientationPortrait(mapActivity) ?
- View.GONE : View.VISIBLE);
- dashButton.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- mapRouteInfoControlDialog.hideDialog();
- optionsRouteControlDialog.hideDialog();
- mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.DASHBOARD);
- }
- });
ImageView cancelRouteButton = (ImageView) main.findViewById(R.id.map_cancel_route_button);
cancelRouteButton.setImageDrawable(app.getIconsCache().getContentIcon(R.drawable.map_action_cancel));
cancelRouteButton.setOnClickListener(new View.OnClickListener() {
@@ -321,8 +232,7 @@ public class MapControlsLayer extends OsmandMapLayer {
});
ImageView waypointsButton = (ImageView) main.findViewById(R.id.map_waypoints_route_button);
- waypointsButton.setImageDrawable(routeInfo ? app.getIconsCache().getIcon(R.drawable.map_action_waypoints,
- R.color.osmand_orange) : app.getIconsCache().getContentIcon(R.drawable.map_action_waypoints));
+ waypointsButton.setImageDrawable(app.getIconsCache().getContentIcon(R.drawable.map_action_waypoints));
waypointsButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@@ -341,7 +251,7 @@ public class MapControlsLayer extends OsmandMapLayer {
});
TextView routeGoButton = (TextView) main.findViewById(R.id.map_go_route_button);
- routeGoButton.setCompoundDrawables(app.getIconsCache().getIcon(R.drawable.map_start_navigation, R.color.color_myloc_distance), null, null, null);
+ routeGoButton.setCompoundDrawablesWithIntrinsicBounds(app.getIconsCache().getIcon(R.drawable.map_start_navigation, R.color.color_myloc_distance), null, null, null);
routeGoButton.setText(AndroidUiHelper.isOrientationPortrait(mapActivity) ?
mapActivity.getString(R.string.shared_string_go) : "");
routeGoButton.setOnClickListener(new View.OnClickListener() {
@@ -358,6 +268,10 @@ public class MapControlsLayer extends OsmandMapLayer {
}
}
+ private TargetPointsHelper getTargets() {
+ return mapActivity.getMyApplication().getTargetPointsHelper();
+ }
+
protected void clickRouteParams() {
notifyClicked();
mapRouteInfoControlDialog.hideDialog();
@@ -365,9 +279,15 @@ public class MapControlsLayer extends OsmandMapLayer {
}
protected void clickRouteWaypoints() {
- notifyClicked();
- optionsRouteControlDialog.hideDialog();
- mapRouteInfoControlDialog.showHideDialog();
+ if (getTargets().checkPointToNavigateShort()) {
+ notifyClicked();
+ if (optionsRouteControlDialog.isDialogVisible()) {
+ optionsRouteControlDialog.hideDialog();
+ } else if (mapRouteInfoControlDialog.isDialogVisible()) {
+ mapRouteInfoControlDialog.hideDialog();
+ }
+ mapActivity.getMapActions().openIntermediatePointsDialog();
+ }
}
protected void clickRouteCancel() {
@@ -404,7 +324,7 @@ public class MapControlsLayer extends OsmandMapLayer {
private void initControls() {
View backToLocation = mapActivity.findViewById(R.id.map_my_location_button);
- backToLocationControl = createHudButton((ImageView) backToLocation, R.drawable.map_my_location)
+ backToLocationControl = createHudButton(backToLocation, R.drawable.map_my_location)
.setBg(R.drawable.btn_circle_blue);
controls.add(backToLocationControl);
@@ -425,7 +345,7 @@ public class MapControlsLayer extends OsmandMapLayer {
View backToMenuButton = mapActivity.findViewById(R.id.map_menu_button);
final boolean dash = settings.SHOW_DASHBOARD_ON_MAP_SCREEN.get();
- menuControl = createHudButton((ImageView) backToMenuButton,
+ menuControl = createHudButton(backToMenuButton,
!dash ? R.drawable.map_drawer : R.drawable.map_dashboard).setBg(
R.drawable.btn_round, R.drawable.btn_round_night);
controls.add(menuControl);
@@ -478,7 +398,7 @@ public class MapControlsLayer extends OsmandMapLayer {
if (!routingHelper.isFollowingMode() && !routingHelper.isRoutePlanningMode()) {
mapActivity.getMapActions().enterRoutePlanningMode(null, null);
} else {
- switchToRoutePlanningLayout();
+ showRouteInfoControlDialog();
}
}
@@ -503,7 +423,7 @@ public class MapControlsLayer extends OsmandMapLayer {
private void initZooms() {
final OsmandMapTileView view = mapActivity.getMapView();
View zoomInButton = mapActivity.findViewById(R.id.map_zoom_in_button);
- mapZoomIn = createHudButton((ImageView) zoomInButton, R.drawable.map_zoom_in).
+ mapZoomIn = createHudButton(zoomInButton, R.drawable.map_zoom_in).
setIconsId(R.drawable.map_zoom_in, R.drawable.map_zoom_in_night).setRoundTransparent();
controls.add(mapZoomIn);
zoomInButton.setOnClickListener(new View.OnClickListener() {
@@ -521,7 +441,7 @@ public class MapControlsLayer extends OsmandMapLayer {
final View.OnLongClickListener listener = MapControlsLayer.getOnClickMagnifierListener(view);
zoomInButton.setOnLongClickListener(listener);
View zoomOutButton = mapActivity.findViewById(R.id.map_zoom_out_button);
- mapZoomOut = createHudButton((ImageView) zoomOutButton, R.drawable.map_zoom_out).
+ mapZoomOut = createHudButton(zoomOutButton, R.drawable.map_zoom_out).
setIconsId(R.drawable.map_zoom_out, R.drawable.map_zoom_out_night).setRoundTransparent();
controls.add(mapZoomOut);
zoomOutButton.setOnClickListener(new View.OnClickListener() {
@@ -564,7 +484,7 @@ public class MapControlsLayer extends OsmandMapLayer {
@Deprecated
public void startCounter() {
- OsmandSettings settings = mapActivity.getMyApplication().getSettings();
+ //OsmandSettings settings = mapActivity.getMyApplication().getSettings();
int del = 0; // settings.DELAY_TO_START_NAVIGATION.get();
if (del <= 0) {
return;
@@ -627,15 +547,13 @@ public class MapControlsLayer extends OsmandMapLayer {
boolean dialogOpened = optionsRouteControlDialog.isDialogVisible() || mapRouteInfoControlDialog.isDialogVisible();
boolean showRouteCalculationControls = routePlanningMode ||
((System.currentTimeMillis() - touchEvent < TIMEOUT_TO_SHOW_BUTTONS) && routeFollowingMode);
- boolean showMenuButton = (showRouteCalculationControls && portrait) ||
- (!routeFollowingMode && !routePlanningMode);
updateMyLocation(rh, dialogOpened);
// routePlanningBtn.setIconResId(routeFollowingMode ? R.drawable.ic_action_gabout_dark : R.drawable.map_directions );
// routePlanningBtn.updateVisibility(showButtons && !routePlanningMode);
routePlanningBtn.setIconResId(R.drawable.map_directions);
- routePlanningBtn.updateVisibility(!routeFollowingMode && !routePlanningMode);
+ routePlanningBtn.updateVisibility(!dialogOpened);
- menuControl.updateVisibility(showMenuButton && !dialogOpened);
+ menuControl.updateVisibility(!dialogOpened);
mapZoomIn.updateVisibility(!dialogOpened);
mapZoomOut.updateVisibility(!dialogOpened);
compassHud.updateVisibility(!dialogOpened);
@@ -662,35 +580,21 @@ public class MapControlsLayer extends OsmandMapLayer {
zoomText.setText(getZoomLevel(tileBox));
}
}
- int vis = showRouteCalculationControls ? View.VISIBLE : View.GONE;
- if (showRouteCalculationControls) {
- ((TextView) routeGoControl.iv).setTextColor(textColor);
- String text = portrait ? mapActivity.getString(R.string.shared_string_go) : "";
- if (startCounter > 0) {
- int get = (int) ((startCounter - System.currentTimeMillis()) / 1000l);
- text += " (" + get + ")";
- }
- ((TextView) routeGoControl.iv).setText(text);
- }
- if (routePreparationLayout.getVisibility() != vis) {
- routePreparationLayout.setVisibility(vis);
- mapDashControl.updateVisibility(showRouteCalculationControls && !portrait);
- mapRouteInfoControlDialog.setVisible(showRouteCalculationControls);
- if (showRouteCalculationControls) {
- if (!mapActivity.getRoutingHelper().isFollowingMode()
- && !mapActivity.getRoutingHelper().isPauseNavigation()) {
- startCounter();
- }
- } else {
- stopCounter();
+ mapRouteInfoControlDialog.setVisible(showRouteCalculationControls);
+ if (showRouteCalculationControls) {
+ if (!mapActivity.getRoutingHelper().isFollowingMode()
+ && !mapActivity.getRoutingHelper().isPauseNavigation()) {
+ startCounter();
}
+ } else {
+ stopCounter();
}
updateCompass(isNight);
for (MapHudButton mc : controls) {
- mc.update(mapActivity.getMyApplication(), nightMode == null ? false : nightMode.isNightMode());
+ mc.update(mapActivity.getMyApplication(), nightMode != null && nightMode.isNightMode());
}
}
diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java
index a92471aa36..8973ad6940 100644
--- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java
+++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java
@@ -33,7 +33,7 @@ import net.osmand.plus.monitoring.OsmandMonitoringPlugin;
import net.osmand.plus.routing.RouteDirectionInfo;
import net.osmand.plus.routing.RoutingHelper;
import net.osmand.plus.views.OsmandMapLayer.DrawSettings;
-import net.osmand.plus.views.controls.MapRouteInfoControl;
+import net.osmand.plus.mapcontextmenu.other.MapRouteInfoControl;
import net.osmand.plus.views.mapwidgets.NextTurnInfoWidget.TurnDrawable;
import net.osmand.router.TurnType;
diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java
index d91547736b..94c63a80f2 100644
--- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java
+++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java
@@ -30,7 +30,7 @@ import net.osmand.plus.views.AnimateDraggingMapThread;
import net.osmand.plus.views.OsmandMapLayer.DrawSettings;
import net.osmand.plus.views.OsmandMapTileView;
import net.osmand.plus.views.TurnPathHelper;
-import net.osmand.plus.views.controls.MapRouteInfoControl;
+import net.osmand.plus.mapcontextmenu.other.MapRouteInfoControl;
import net.osmand.router.RouteResultPreparation;
import net.osmand.router.TurnType;
import net.osmand.util.Algorithms;