diff --git a/OsmAnd/res/layout/card_bottom_divider.xml b/OsmAnd/res/layout/card_bottom_divider.xml
new file mode 100644
index 0000000000..864a1aaf4c
--- /dev/null
+++ b/OsmAnd/res/layout/card_bottom_divider.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/layout/card_top_divider.xml b/OsmAnd/res/layout/card_top_divider.xml
new file mode 100644
index 0000000000..32ffcaefba
--- /dev/null
+++ b/OsmAnd/res/layout/card_top_divider.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/src/net/osmand/AndroidUtils.java b/OsmAnd/src/net/osmand/AndroidUtils.java
index 3ddd1c48be..13c09b2557 100644
--- a/OsmAnd/src/net/osmand/AndroidUtils.java
+++ b/OsmAnd/src/net/osmand/AndroidUtils.java
@@ -91,6 +91,14 @@ public class AndroidUtils {
setBackground(ctx, view, night, R.drawable.dashboard_button_light, R.drawable.dashboard_button_dark);
}
+ public static void setBackgroundColor(Context ctx, View view, boolean night, int lightResId, int darkResId) {
+ view.setBackgroundColor(ctx.getResources().getColor(night ? darkResId : lightResId));
+ }
+
+ public static void setListItemBackground(Context ctx, View view, boolean night) {
+ setBackgroundColor(ctx, view, night, R.color.bg_color_light, R.color.bg_color_dark);
+ }
+
public static void setTextPrimaryColor(Context ctx, TextView textView, boolean night) {
textView.setTextColor(night ?
ctx.getResources().getColor(R.color.primary_text_dark)
diff --git a/OsmAnd/src/net/osmand/plus/ContextMenuAdapter.java b/OsmAnd/src/net/osmand/plus/ContextMenuAdapter.java
index 311ae84364..fd19a1a540 100644
--- a/OsmAnd/src/net/osmand/plus/ContextMenuAdapter.java
+++ b/OsmAnd/src/net/osmand/plus/ContextMenuAdapter.java
@@ -346,6 +346,7 @@ public class ContextMenuAdapter {
}
if (convertView == null || (!lid.equals(convertView.getTag()))) {
convertView = activity.getLayoutInflater().inflate(lid, parent, false);
+ AndroidUtils.setListItemBackground(ctx, convertView, !holoLight);
convertView.setTag(lid);
}
TextView tv = (TextView) convertView.findViewById(R.id.title);
diff --git a/OsmAnd/src/net/osmand/plus/activities/actions/AppModeDialog.java b/OsmAnd/src/net/osmand/plus/activities/actions/AppModeDialog.java
index 868a90dab6..abfc74892a 100644
--- a/OsmAnd/src/net/osmand/plus/activities/actions/AppModeDialog.java
+++ b/OsmAnd/src/net/osmand/plus/activities/actions/AppModeDialog.java
@@ -46,6 +46,13 @@ public class AppModeDialog {
public static View prepareAppModeView(Activity a, final List values , final Set selected,
ViewGroup parent, final boolean singleSelection, boolean drawer, boolean useMapTheme, final View.OnClickListener onClickListener) {
View ll = a.getLayoutInflater().inflate(R.layout.mode_toggles, parent);
+ if (useMapTheme) {
+ AndroidUtils.setListItemBackground(a, ll,
+ ((OsmandApplication) a.getApplication()).getDaynightHelper().isNightModeForMapControls());
+ } else {
+ AndroidUtils.setListItemBackground(a, ll,
+ !((OsmandApplication) a.getApplication()).getSettings().isLightContent());
+ }
final View[] buttons = new View[values.size()];
int k = 0;
for(ApplicationMode ma : values) {
diff --git a/OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java b/OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java
index 7dbf12d4e3..5275136351 100644
--- a/OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java
+++ b/OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java
@@ -154,7 +154,8 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks {
public enum DashboardActionButtonType {
MY_LOCATION,
- NAVIGATE
+ NAVIGATE,
+ ROUTE
}
private class DashboardActionButton {
@@ -191,13 +192,26 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks {
mFlexibleBlurSpaceHeight = mapActivity.getResources().getDimensionPixelSize(
R.dimen.dashboard_map_toolbar);
// Set padding view for ListView. This is the flexible space.
- paddingView = new View(mapActivity);
+ paddingView = new FrameLayout(mapActivity);
AbsListView.LayoutParams lp = new AbsListView.LayoutParams(AbsListView.LayoutParams.MATCH_PARENT,
mFlexibleSpaceImageHeight);
paddingView.setLayoutParams(lp);
// This is required to disable header's list selector effect
paddingView.setClickable(true);
paddingView.setOnClickListener(listener);
+
+ FrameLayout shadowContainer = new FrameLayout(mapActivity);
+ FrameLayout.LayoutParams fl = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT,
+ FrameLayout.LayoutParams.MATCH_PARENT);
+ fl.gravity = Gravity.BOTTOM;
+ shadowContainer.setLayoutParams(fl);
+ ImageView shadow = new ImageView(mapActivity);
+ shadow.setImageDrawable(mapActivity.getResources().getDrawable(R.drawable.bg_shadow_onmap));
+ shadow.setLayoutParams(new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT,
+ FrameLayout.LayoutParams.WRAP_CONTENT, Gravity.BOTTOM));
+ shadow.setScaleType(ScaleType.FIT_XY);
+ shadowContainer.addView(shadow);
+ ((FrameLayout)paddingView).addView(shadowContainer);
listView.addHeaderView(paddingView);
listBackgroundView = mapActivity.findViewById(R.id.dash_list_background);
}
@@ -378,8 +392,19 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks {
}
};
+ DashboardActionButton routeButton = new DashboardActionButton();
+ routeButton.icon = mapActivity.getResources().getDrawable(R.drawable.map_directions);
+ routeButton.onClickListener = new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ mapActivity.getMapLayers().getMapControlsLayer().doRoute();
+ hideDashboard();
+ }
+ };
+
actionButtons.put(DashboardActionButtonType.MY_LOCATION, myLocationButton);
actionButtons.put(DashboardActionButtonType.NAVIGATE, navigateButton);
+ actionButtons.put(DashboardActionButtonType.ROUTE, routeButton);
}
private void setActionButton(DashboardType type) {
@@ -391,6 +416,21 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks {
button = actionButtons.get(DashboardActionButtonType.MY_LOCATION);
} else if (type == DashboardType.ROUTE_PREFERENCES) {
button = actionButtons.get(DashboardActionButtonType.NAVIGATE);
+ } else if (type == DashboardType.WAYPOINTS || type == DashboardType.WAYPOINTS_EDIT || type == DashboardType.WAYPOINTS_FLAT) {
+ boolean routePlanningMode = false;
+ RoutingHelper rh = mapActivity.getRoutingHelper();
+ if (rh.isRoutePlanningMode()) {
+ routePlanningMode = true;
+ } else if ((rh.isRouteCalculated() || rh.isRouteBeingCalculated()) && !rh.isFollowingMode()) {
+ routePlanningMode = true;
+ }
+ boolean routeFollowingMode = !routePlanningMode && rh.isFollowingMode();
+
+ if (routePlanningMode || routeFollowingMode) {
+ button = actionButtons.get(DashboardActionButtonType.NAVIGATE);
+ } else {
+ button = actionButtons.get(DashboardActionButtonType.ROUTE);
+ }
}
if (button != null) {
@@ -528,22 +568,30 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks {
private void applyDayNightMode() {
if (nightMode) {
if (listBackgroundView != null) {
- listBackgroundView.setBackgroundColor(mapActivity.getResources().getColor(R.color.bg_color_dark));
+ listBackgroundView.setBackgroundColor(mapActivity.getResources().getColor(R.color.ctx_menu_info_view_bg_dark));
} else {
- listView.setBackgroundColor(mapActivity.getResources().getColor(R.color.bg_color_dark));
+ listView.setBackgroundColor(mapActivity.getResources().getColor(R.color.ctx_menu_info_view_bg_dark));
+ }
+ if (visibleType != DashboardType.WAYPOINTS) {
+ Drawable d = new ColorDrawable(mapActivity.getResources().getColor(R.color.dashboard_divider_dark));
+ listView.setDivider(d);
+ listView.setDividerHeight(dpToPx(1f));
+ } else {
+ listView.setDivider(null);
}
- Drawable d = new ColorDrawable(mapActivity.getResources().getColor(R.color.dashboard_divider_dark));
- listView.setDivider(d);
- listView.setDividerHeight(dpToPx(1f));
} else {
if (listBackgroundView != null) {
- listBackgroundView.setBackgroundColor(mapActivity.getResources().getColor(R.color.bg_color_light));
+ listBackgroundView.setBackgroundColor(mapActivity.getResources().getColor(R.color.ctx_menu_info_view_bg_light));
} else {
- listView.setBackgroundColor(mapActivity.getResources().getColor(R.color.bg_color_light));
+ listView.setBackgroundColor(mapActivity.getResources().getColor(R.color.ctx_menu_info_view_bg_light));
+ }
+ if (visibleType != DashboardType.WAYPOINTS) {
+ Drawable d = new ColorDrawable(mapActivity.getResources().getColor(R.color.dashboard_divider_light));
+ listView.setDivider(d);
+ listView.setDividerHeight(dpToPx(1f));
+ } else {
+ listView.setDivider(null);
}
- Drawable d = new ColorDrawable(mapActivity.getResources().getColor(R.color.dashboard_divider_light));
- listView.setDivider(d);
- listView.setDividerHeight(dpToPx(1f));
}
}
@@ -865,6 +913,9 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks {
private boolean isActionButtonVisible() {
return visibleType == DashboardType.DASHBOARD
+ || visibleType == DashboardType.WAYPOINTS
+ || visibleType == DashboardType.WAYPOINTS_EDIT
+ || visibleType == DashboardType.WAYPOINTS_FLAT
|| visibleType == DashboardType.LIST_MENU
|| visibleType == DashboardType.ROUTE_PREFERENCES
|| visibleType == DashboardType.CONFIGURE_SCREEN;
diff --git a/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java b/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java
index ce33a919cc..3d209ecd47 100644
--- a/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java
+++ b/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java
@@ -4,6 +4,8 @@ import android.app.Activity;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.DialogInterface.OnDismissListener;
+import android.graphics.drawable.ColorDrawable;
+import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
import android.support.v4.app.FragmentActivity;
import android.support.v7.app.AlertDialog;
@@ -59,7 +61,7 @@ public class WaypointDialogHelper {
}
public static void updatePointInfoView(final OsmandApplication app, final Activity activity,
- View localView, final LocationPointWrapper ps,
+ View localView, final LocationPointWrapper ps,
final boolean mapCenter, final boolean nightMode) {
WaypointHelper wh = app.getWaypointHelper();
final LocationPoint point = ps.getPoint();
@@ -101,11 +103,11 @@ public class WaypointDialogHelper {
descr = pd.getName();
}
- if(textShadow != null) {
+ if (textShadow != null) {
textShadow.setText(descr);
}
text.setText(descr);
-
+
// ((Spannable) text.getText()).setSpan(
// new ForegroundColorSpan(ctx.getResources().getColor(R.color.color_distance)), 0, distance.length() - 1,
// 0);
@@ -116,7 +118,7 @@ public class WaypointDialogHelper {
final boolean edit, final List deletedPoints,
final MapActivity ctx, final int[] running, final boolean flat, final boolean nightMode) {
final List