diff --git a/OsmAnd/res/drawable-hdpi/ic_empty_state_favorites_day_result.webp b/OsmAnd/res/drawable-hdpi/ic_empty_state_favorites_day_result.webp
deleted file mode 100644
index 6db48f407d..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/ic_empty_state_favorites_day_result.webp and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/ic_empty_state_favorites_night_result.webp b/OsmAnd/res/drawable-hdpi/ic_empty_state_favorites_night_result.webp
deleted file mode 100644
index 0f21da9838..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/ic_empty_state_favorites_night_result.webp and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/ic_empty_state_trip_day_result.webp b/OsmAnd/res/drawable-hdpi/ic_empty_state_trip_day_result.webp
deleted file mode 100644
index 04f9b45167..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/ic_empty_state_trip_day_result.webp and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/ic_empty_state_trip_night_result.webp b/OsmAnd/res/drawable-hdpi/ic_empty_state_trip_night_result.webp
deleted file mode 100644
index 8714f59f62..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/ic_empty_state_trip_night_result.webp and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/ic_empty_state_favorites_day_result.webp b/OsmAnd/res/drawable-mdpi/ic_empty_state_favorites_day_result.webp
deleted file mode 100644
index 22a7a38665..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/ic_empty_state_favorites_day_result.webp and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/ic_empty_state_favorites_night_result.webp b/OsmAnd/res/drawable-mdpi/ic_empty_state_favorites_night_result.webp
deleted file mode 100644
index ef7a84a52b..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/ic_empty_state_favorites_night_result.webp and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/ic_empty_state_trip_day_result.webp b/OsmAnd/res/drawable-mdpi/ic_empty_state_trip_day_result.webp
deleted file mode 100644
index 6ba8fe9604..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/ic_empty_state_trip_day_result.webp and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/ic_empty_state_trip_night_result.webp b/OsmAnd/res/drawable-mdpi/ic_empty_state_trip_night_result.webp
deleted file mode 100644
index f7785ff473..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/ic_empty_state_trip_night_result.webp and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/ic_empty_state_favorites_day_result.webp b/OsmAnd/res/drawable-xhdpi/ic_empty_state_favorites_day_result.webp
deleted file mode 100644
index 52526237ed..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/ic_empty_state_favorites_day_result.webp and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/ic_empty_state_favorites_night_result.webp b/OsmAnd/res/drawable-xhdpi/ic_empty_state_favorites_night_result.webp
deleted file mode 100644
index 89ce142463..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/ic_empty_state_favorites_night_result.webp and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/ic_empty_state_trip_day_result.webp b/OsmAnd/res/drawable-xhdpi/ic_empty_state_trip_day_result.webp
deleted file mode 100644
index 52f76f28ba..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/ic_empty_state_trip_day_result.webp and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/ic_empty_state_trip_night_result.webp b/OsmAnd/res/drawable-xhdpi/ic_empty_state_trip_night_result.webp
deleted file mode 100644
index c1bc13c7ba..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/ic_empty_state_trip_night_result.webp and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/ic_empty_state_favorites_day_result.webp b/OsmAnd/res/drawable-xxhdpi/ic_empty_state_favorites_day_result.webp
deleted file mode 100644
index bc7b7631a7..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/ic_empty_state_favorites_day_result.webp and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/ic_empty_state_favorites_night_result.webp b/OsmAnd/res/drawable-xxhdpi/ic_empty_state_favorites_night_result.webp
deleted file mode 100644
index e28b0e2c27..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/ic_empty_state_favorites_night_result.webp and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/ic_empty_state_trip_day_result.webp b/OsmAnd/res/drawable-xxhdpi/ic_empty_state_trip_day_result.webp
deleted file mode 100644
index 3fbe5e418c..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/ic_empty_state_trip_day_result.webp and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/ic_empty_state_trip_night_result.webp b/OsmAnd/res/drawable-xxhdpi/ic_empty_state_trip_night_result.webp
deleted file mode 100644
index 1aa2b42b4f..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/ic_empty_state_trip_night_result.webp and /dev/null differ
diff --git a/OsmAnd/res/drawable/passed_icon_dark.xml b/OsmAnd/res/drawable/passed_icon_dark.xml
new file mode 100644
index 0000000000..99997007bd
--- /dev/null
+++ b/OsmAnd/res/drawable/passed_icon_dark.xml
@@ -0,0 +1,11 @@
+
+
+ -
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/drawable/passed_icon_light.xml b/OsmAnd/res/drawable/passed_icon_light.xml
new file mode 100644
index 0000000000..ac91b37dec
--- /dev/null
+++ b/OsmAnd/res/drawable/passed_icon_light.xml
@@ -0,0 +1,11 @@
+
+
+ -
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/layout/map_context_menu_fragment.xml b/OsmAnd/res/layout/map_context_menu_fragment.xml
index 1924bf56a3..bf1a78ede6 100644
--- a/OsmAnd/res/layout/map_context_menu_fragment.xml
+++ b/OsmAnd/res/layout/map_context_menu_fragment.xml
@@ -166,20 +166,69 @@
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+ Tapping anywhere on the map hides the interface and toggles the full screen mode.
+ Tap on map hides interface
+ Show on Top Bar
+ Mark passed
can be imported as Favorites points, or as track file.
Import as GPX file
Import as Favorites
@@ -66,7 +70,7 @@
Map marker moved to active
List
Groups
- Passed: %1$s
+ Last used: %1$s
Make active
Today
Yesterday
diff --git a/OsmAnd/src/net/osmand/AndroidUtils.java b/OsmAnd/src/net/osmand/AndroidUtils.java
index 4961b279be..e676cd4ec3 100644
--- a/OsmAnd/src/net/osmand/AndroidUtils.java
+++ b/OsmAnd/src/net/osmand/AndroidUtils.java
@@ -243,6 +243,38 @@ public class AndroidUtils {
return new PointF(centroidX, centroidY);
}
+ public static void showSystemUI(Activity activity) {
+ if (Build.VERSION.SDK_INT >= 19 && !isSystemUiVisible(activity)) {
+ switchSystemUiVisibility(activity);
+ }
+ }
+
+ public static void hideSystemUI(Activity activity) {
+ if (Build.VERSION.SDK_INT >= 19 && isSystemUiVisible(activity)) {
+ switchSystemUiVisibility(activity);
+ }
+ }
+
+ public static boolean isSystemUiVisible(Activity activity) {
+ if (Build.VERSION.SDK_INT >= 19) {
+ int uiOptions = activity.getWindow().getDecorView().getSystemUiVisibility();
+ return !((uiOptions | View.SYSTEM_UI_FLAG_FULLSCREEN) == uiOptions);
+ }
+ return true;
+ }
+
+ public static void switchSystemUiVisibility(Activity activity) {
+ if (Build.VERSION.SDK_INT < 19) {
+ return;
+ }
+ View decorView = activity.getWindow().getDecorView();
+ int uiOptions = decorView.getSystemUiVisibility();
+ uiOptions ^= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
+ uiOptions ^= View.SYSTEM_UI_FLAG_FULLSCREEN;
+ uiOptions ^= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
+ decorView.setSystemUiVisibility(uiOptions);
+ }
+
public static > Map sortByValue(Map map) {
List> list = new LinkedList<>(map.entrySet());
Collections.sort(list, new Comparator>() {
diff --git a/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java b/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java
index 4307c25421..cc1964d0e4 100644
--- a/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java
+++ b/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java
@@ -795,6 +795,16 @@ public class MapMarkersHelper {
}
}
+ public void moveMarkerToTop(MapMarker marker) {
+ int i = mapMarkers.indexOf(marker);
+ if (i != -1 && mapMarkers.size() > 1) {
+ mapMarkers.remove(i);
+ mapMarkers.add(0, marker);
+ reorderActiveMarkersIfNeeded();
+ refresh();
+ }
+ }
+
public void moveMapMarker(MapMarker marker, LatLon latLon) {
if (marker != null) {
LatLon point = new LatLon(latLon.getLatitude(), latLon.getLongitude());
diff --git a/OsmAnd/src/net/osmand/plus/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/OsmandSettings.java
index 9c8fcf4d5e..96dac1b2f4 100644
--- a/OsmAnd/src/net/osmand/plus/OsmandSettings.java
+++ b/OsmAnd/src/net/osmand/plus/OsmandSettings.java
@@ -902,6 +902,8 @@ public class OsmandSettings {
public final OsmandPreference DO_NOT_USE_ANIMATIONS = new BooleanPreference("do_not_use_animations", false).makeGlobal().cache();
public final OsmandPreference DO_NOT_SEND_ANONYMOUS_APP_USAGE = new BooleanPreference("do_not_send_anonymous_app_usage", false).makeGlobal().cache();
+ public final OsmandPreference MAP_EMPTY_STATE_ALLOWED = new BooleanPreference("map_empty_state_allowed", true).makeGlobal().cache();
+
public final CommonPreference TEXT_SCALE = new FloatPreference("text_scale", 1f).makeProfile().cache();
diff --git a/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java b/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java
index 461f6ff0e6..0f0c1523ff 100644
--- a/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java
+++ b/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java
@@ -164,7 +164,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
}
View emptyView = view.findViewById(android.R.id.empty);
ImageView emptyImageView = (ImageView) emptyView.findViewById(R.id.empty_state_image_view);
- emptyImageView.setImageResource(app.getSettings().isLightContent() ? R.drawable.ic_empty_state_favorites_day_result : R.drawable.ic_empty_state_favorites_night_result);
+ emptyImageView.setImageResource(app.getSettings().isLightContent() ? R.drawable.ic_empty_state_favorites_day : R.drawable.ic_empty_state_favorites_night);
Button importButton = (Button) emptyView.findViewById(R.id.import_button);
importButton.setOnClickListener(new View.OnClickListener() {
@Override
diff --git a/OsmAnd/src/net/osmand/plus/activities/SettingsGeneralActivity.java b/OsmAnd/src/net/osmand/plus/activities/SettingsGeneralActivity.java
index 3ccdba5893..69b2de8259 100644
--- a/OsmAnd/src/net/osmand/plus/activities/SettingsGeneralActivity.java
+++ b/OsmAnd/src/net/osmand/plus/activities/SettingsGeneralActivity.java
@@ -496,6 +496,7 @@ public class SettingsGeneralActivity extends SettingsBaseActivity implements OnR
misc.addPreference(createCheckBoxPreference(settings.DO_NOT_SHOW_STARTUP_MESSAGES, R.string.do_not_show_startup_messages, R.string.do_not_show_startup_messages_desc));
misc.addPreference(createCheckBoxPreference(settings.DO_NOT_USE_ANIMATIONS, R.string.do_not_use_animations, R.string.do_not_use_animations_descr));
misc.addPreference(createCheckBoxPreference(settings.USE_MAGNETIC_FIELD_SENSOR_COMPASS, R.string.use_magnetic_sensor, R.string.use_magnetic_sensor_descr));
+ misc.addPreference(createCheckBoxPreference(settings.MAP_EMPTY_STATE_ALLOWED, R.string.tap_on_map_to_hide_interface, R.string.tap_on_map_to_hide_interface_descr));
}
diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java
index 916fb34fb6..3d989f1929 100644
--- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java
+++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java
@@ -1035,6 +1035,14 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL
}
}
+ public TitleButtonController getLeftSubtitleButtonController() {
+ if (menuController != null) {
+ return menuController.getLeftSubtitleButtonController();
+ } else {
+ return null;
+ }
+ }
+
public TitleButtonController getLeftDownloadButtonController() {
if (menuController != null) {
return menuController.getLeftDownloadButtonController();
diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java
index b0d958737e..3d3a0a3658 100644
--- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java
+++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java
@@ -175,6 +175,18 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
}
});
+ // Left subtitle button
+ final Button leftSubtitleButton = (Button) view.findViewById(R.id.subtitle_button);
+ leftSubtitleButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ TitleButtonController leftSubtitleButtonController = menu.getLeftSubtitleButtonController();
+ if (leftSubtitleButtonController != null) {
+ leftSubtitleButtonController.buttonPressed();
+ }
+ }
+ });
+
// Left download button
final Button leftDownloadButton = (Button) view.findViewById(R.id.download_button_left);
leftDownloadButton.setOnClickListener(new View.OnClickListener() {
@@ -686,14 +698,17 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
TitleButtonController leftTitleButtonController = menu.getLeftTitleButtonController();
TitleButtonController rightTitleButtonController = menu.getRightTitleButtonController();
TitleButtonController topRightTitleButtonController = menu.getTopRightTitleButtonController();
+ TitleButtonController leftSubtitleButtonController = menu.getLeftSubtitleButtonController();
TitleButtonController leftDownloadButtonController = menu.getLeftDownloadButtonController();
TitleButtonController rightDownloadButtonController = menu.getRightDownloadButtonController();
TitleProgressController titleProgressController = menu.getTitleProgressController();
// Title buttons
boolean showTitleButtonsContainer = (leftTitleButtonController != null || rightTitleButtonController != null);
+ boolean showTitleDivider = leftSubtitleButtonController != null;
final View titleButtonsContainer = view.findViewById(R.id.title_button_container);
titleButtonsContainer.setVisibility(showTitleButtonsContainer ? View.VISIBLE : View.GONE);
+ view.findViewById(R.id.title_divider).setVisibility(showTitleDivider ? View.VISIBLE : View.GONE);
// Left title button
final Button leftTitleButton = (Button) view.findViewById(R.id.title_button);
@@ -705,7 +720,7 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
Drawable leftIcon = leftTitleButtonController.getLeftIcon();
if (leftIcon != null) {
leftTitleButton.setCompoundDrawablesWithIntrinsicBounds(leftIcon, null, null, null);
- leftTitleButton.setCompoundDrawablePadding(dpToPx(4f));
+ leftTitleButton.setCompoundDrawablePadding(dpToPx(8f));
}
if (leftTitleButtonController.needRightText) {
@@ -727,7 +742,7 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
Drawable leftIcon = rightTitleButtonController.getLeftIcon();
rightTitleButton.setCompoundDrawablesWithIntrinsicBounds(leftIcon, null, null, null);
- rightTitleButton.setCompoundDrawablePadding(dpToPx(4f));
+ rightTitleButton.setCompoundDrawablePadding(dpToPx(8f));
} else {
rightTitleButton.setVisibility(View.GONE);
}
@@ -740,11 +755,26 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
Drawable leftIcon = topRightTitleButtonController.getLeftIcon();
topRightTitleButton.setCompoundDrawablesWithIntrinsicBounds(leftIcon, null, null, null);
- topRightTitleButton.setCompoundDrawablePadding(dpToPx(4f));
+ topRightTitleButton.setCompoundDrawablePadding(dpToPx(8f));
} else {
topRightTitleButton.setVisibility(View.GONE);
}
+ // Left subtitle button
+ final Button leftSubtitleButton = (Button) view.findViewById(R.id.subtitle_button);
+ if (leftSubtitleButtonController != null) {
+ leftSubtitleButton.setText(leftSubtitleButtonController.caption);
+ leftSubtitleButton.setVisibility(leftSubtitleButtonController.visible ? View.VISIBLE : View.GONE);
+
+ Drawable leftIcon = leftSubtitleButtonController.getLeftIcon();
+ if (leftIcon != null) {
+ leftSubtitleButton.setCompoundDrawablesWithIntrinsicBounds(leftIcon, null, null, null);
+ leftSubtitleButton.setCompoundDrawablePadding(dpToPx(8f));
+ }
+ } else {
+ leftSubtitleButton.setVisibility(View.GONE);
+ }
+
// Download buttons
boolean showDownloadButtonsContainer =
((leftDownloadButtonController != null && leftDownloadButtonController.visible)
@@ -772,7 +802,7 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
Drawable leftIcon = leftDownloadButtonController.getLeftIcon();
if (leftIcon != null) {
leftDownloadButton.setCompoundDrawablesWithIntrinsicBounds(leftIcon, null, null, null);
- leftDownloadButton.setCompoundDrawablePadding(dpToPx(4f));
+ leftDownloadButton.setCompoundDrawablePadding(dpToPx(8f));
}
} else {
leftDownloadButton.setVisibility(View.GONE);
@@ -786,7 +816,7 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
Drawable leftIcon = rightDownloadButtonController.getLeftIcon();
rightDownloadButton.setCompoundDrawablesWithIntrinsicBounds(leftIcon, null, null, null);
- rightDownloadButton.setCompoundDrawablePadding(dpToPx(4f));
+ rightDownloadButton.setCompoundDrawablePadding(dpToPx(8f));
} else {
rightDownloadButton.setVisibility(View.GONE);
}
diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java
index 894018ab7c..b5828dc67b 100644
--- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java
+++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java
@@ -3,6 +3,7 @@ package net.osmand.plus.mapcontextmenu;
import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
import android.support.annotation.NonNull;
+import android.support.v4.content.ContextCompat;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.LinearLayout;
@@ -98,6 +99,7 @@ public abstract class MenuController extends BaseMenuController {
protected TitleButtonController leftTitleButtonController;
protected TitleButtonController rightTitleButtonController;
protected TitleButtonController topRightTitleButtonController;
+ protected TitleButtonController leftSubtitleButtonController;
protected TitleButtonController leftDownloadButtonController;
protected TitleButtonController rightDownloadButtonController;
@@ -321,6 +323,10 @@ public abstract class MenuController extends BaseMenuController {
return topRightTitleButtonController;
}
+ public TitleButtonController getLeftSubtitleButtonController() {
+ return leftSubtitleButtonController;
+ }
+
public TitleButtonController getLeftDownloadButtonController() {
return leftDownloadButtonController;
}
@@ -495,10 +501,18 @@ public abstract class MenuController extends BaseMenuController {
public boolean needRightText = false;
public String rightTextCaption = "";
public boolean visible = true;
+ public boolean needColorizeIcon = true;
+ public Drawable leftIcon;
public Drawable getLeftIcon() {
+ if (leftIcon != null) {
+ return leftIcon;
+ }
if (leftIconId != 0) {
- return getIcon(leftIconId, isLight() ? R.color.map_widget_blue : R.color.osmand_orange);
+ if (needColorizeIcon) {
+ return getIcon(leftIconId, isLight() ? R.color.map_widget_blue : R.color.osmand_orange);
+ }
+ return ContextCompat.getDrawable(getMapActivity(), leftIconId);
} else {
return null;
}
diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapMarkerMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapMarkerMenuController.java
index 875b8f0fdb..3eeaca8c90 100644
--- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapMarkerMenuController.java
+++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapMarkerMenuController.java
@@ -1,8 +1,10 @@
package net.osmand.plus.mapcontextmenu.controllers;
import android.graphics.drawable.Drawable;
+import android.graphics.drawable.LayerDrawable;
import net.osmand.data.PointDescription;
+import net.osmand.plus.IconsCache;
import net.osmand.plus.MapMarkersHelper;
import net.osmand.plus.MapMarkersHelper.MapMarker;
import net.osmand.plus.R;
@@ -21,6 +23,7 @@ public class MapMarkerMenuController extends MenuController {
this.mapMarker = mapMarker;
builder.setShowNearestWiki(true);
final MapMarkersHelper markersHelper = mapActivity.getMyApplication().getMapMarkersHelper();
+
leftTitleButtonController = new TitleButtonController() {
@Override
public void buttonPressed() {
@@ -28,8 +31,27 @@ public class MapMarkerMenuController extends MenuController {
getMapActivity().getContextMenu().close();
}
};
- leftTitleButtonController.caption = getMapActivity().getString(R.string.shared_string_remove);
- leftTitleButtonController.leftIconId = R.drawable.ic_action_delete_dark;
+ leftTitleButtonController.needColorizeIcon = false;
+ leftTitleButtonController.caption = getMapActivity().getString(R.string.mark_passed);
+ leftTitleButtonController.leftIconId = isLight() ? R.drawable.passed_icon_light : R.drawable.passed_icon_dark;
+
+ leftSubtitleButtonController = new TitleButtonController() {
+ @Override
+ public void buttonPressed() {
+ markersHelper.moveMarkerToTop(getMapMarker());
+ getMapActivity().getContextMenu().close();
+ }
+ };
+ leftSubtitleButtonController.caption = getMapActivity().getString(R.string.show_on_top_bar);
+ leftSubtitleButtonController.leftIcon = createShowOnTopbarIcon();
+ }
+
+ private Drawable createShowOnTopbarIcon() {
+ IconsCache ic = getMapActivity().getMyApplication().getIconsCache();
+ Drawable background = ic.getIcon(R.drawable.ic_action_device_top,
+ isLight() ? R.color.on_map_icon_color : R.color.ctx_menu_info_text_dark);
+ Drawable topbar = ic.getIcon(R.drawable.ic_action_device_topbar, R.color.dashboard_blue);
+ return new LayerDrawable(new Drawable[]{background, topbar});
}
@Override
diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MapRouteInfoMenuFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MapRouteInfoMenuFragment.java
index 1ceedaa33c..d63975be85 100644
--- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MapRouteInfoMenuFragment.java
+++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/MapRouteInfoMenuFragment.java
@@ -4,7 +4,6 @@ import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
-import android.support.v4.app.FragmentTransaction;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/PlanRouteFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/PlanRouteFragment.java
index 4911ec30d9..0da40daccd 100644
--- a/OsmAnd/src/net/osmand/plus/mapmarkers/PlanRouteFragment.java
+++ b/OsmAnd/src/net/osmand/plus/mapmarkers/PlanRouteFragment.java
@@ -362,10 +362,8 @@ public class PlanRouteFragment extends Fragment implements OsmAndLocationListene
public void onResume() {
super.onResume();
MapActivity mapActivity = getMapActivity();
- if (mapActivity != null) {
- mapActivity.getMyApplication().getLocationProvider().addLocationListener(this);
- }
- getMapActivity().getMapLayers().getMapControlsLayer().showMapControls();
+ mapActivity.getMyApplication().getLocationProvider().addLocationListener(this);
+ mapActivity.getMapLayers().getMapControlsLayer().showMapControls();
}
@Override
diff --git a/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java b/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java
index 034001de31..d487fe6961 100644
--- a/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java
+++ b/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java
@@ -330,7 +330,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
listView.addFooterView(footerView);
emptyView = v.findViewById(android.R.id.empty);
ImageView emptyImageView = (ImageView) emptyView.findViewById(R.id.empty_state_image_view);
- emptyImageView.setImageResource(app.getSettings().isLightContent() ? R.drawable.ic_empty_state_trip_day_result : R.drawable.ic_empty_state_trip_night_result);
+ emptyImageView.setImageResource(app.getSettings().isLightContent() ? R.drawable.ic_empty_state_trip_day : R.drawable.ic_empty_state_trip_night);
Button importButton = (Button) emptyView.findViewById(R.id.import_button);
importButton.setOnClickListener(new View.OnClickListener() {
@Override
diff --git a/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java b/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java
index 350c284eb4..84ddef5780 100644
--- a/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java
+++ b/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java
@@ -811,8 +811,8 @@ public class ContextMenuLayer extends OsmandMapLayer {
boolean processed = hideVisibleMenues();
processed |= menu.onSingleTapOnMap();
- if (!processed) {
- activity.getMapLayers().getMapControlsLayer().switchMapControlsVisibility();
+ if (!processed && activity.getMyApplication().getSettings().MAP_EMPTY_STATE_ALLOWED.get()) {
+ activity.getMapLayers().getMapControlsLayer().switchMapControlsVisibility(true);
}
return false;
}
diff --git a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java
index 6c397b09d6..0c82a4a19e 100644
--- a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java
+++ b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java
@@ -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;
@@ -659,7 +658,9 @@ public class MapControlsLayer extends OsmandMapLayer {
public void showMapControls() {
mapActivity.findViewById(R.id.MapHudButtonsOverlay).setVisibility(View.VISIBLE);
+ AndroidUtils.showSystemUI(mapActivity);
}
+
public void hideMapControls() {
mapActivity.findViewById(R.id.MapHudButtonsOverlay).setVisibility(View.INVISIBLE);
}
@@ -673,7 +674,7 @@ public class MapControlsLayer extends OsmandMapLayer {
return mapActivity.findViewById(R.id.MapHudButtonsOverlay).getVisibility() == View.VISIBLE;
}
- public void switchMapControlsVisibility() {
+ public void switchMapControlsVisibility(boolean switchSystemUiVisibility) {
if (app.getRoutingHelper().isFollowingMode() || app.getRoutingHelper().isPauseNavigation()
|| mapActivity.getMeasurementToolFragment() != null
|| mapActivity.getPlanRouteFragment() != null
@@ -682,6 +683,9 @@ public class MapControlsLayer extends OsmandMapLayer {
}
if (isMapControlsVisible()) {
hideMapControls();
+ if (switchSystemUiVisibility) {
+ AndroidUtils.hideSystemUI(mapActivity);
+ }
} else {
showMapControls();
}