diff --git a/OsmAnd/res/layout-land/menu_obj_selection_fragment.xml b/OsmAnd/res/layout-land/menu_obj_selection_fragment.xml index 600e297f8c..5102244cbd 100644 --- a/OsmAnd/res/layout-land/menu_obj_selection_fragment.xml +++ b/OsmAnd/res/layout-land/menu_obj_selection_fragment.xml @@ -26,6 +26,7 @@ android:dividerHeight="0dp"/> diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 2780b25267..d4552f4772 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -9,6 +9,7 @@ 3. All your modified/created strings are in the top of the file (to make easier find what\'s translated). PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy --> + Without name What\'s here: parked at Pick up until diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/AdditionalActionsBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/AdditionalActionsBottomSheetDialogFragment.java index 4af9abc7c7..cd5da18e10 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/AdditionalActionsBottomSheetDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/AdditionalActionsBottomSheetDialogFragment.java @@ -140,7 +140,8 @@ public class AdditionalActionsBottomSheetDialogFragment extends net.osmand.plus. if (!portrait) { final Window window = getDialog().getWindow(); WindowManager.LayoutParams params = window.getAttributes(); - params.width = getActivity().getResources().getDimensionPixelSize(R.dimen.landscape_bottom_sheet_dialog_fragment_width); + params.width = getResources().getDimensionPixelSize(R.dimen.landscape_bottom_sheet_dialog_fragment_width) + + AndroidUtils.dpToPx(getContext(), 16); // 8 dp is shadow width on each side window.setAttributes(params); } } diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java index 385b600190..4bda4d120e 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java @@ -583,6 +583,16 @@ public abstract class MenuController extends BaseMenuController { return null; } + public void clearIcon(boolean left) { + if (left) { + leftIcon = null; + leftIconId = 0; + } else { + rightIcon = null; + rightIconId = 0; + } + } + public void updateStateListDrawableIcon(@DrawableRes int resId, boolean left) { if (left) { leftIcon = enabled ? getStateListDrawable(resId) : null; diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java index ce158b58b1..6fec9e2f51 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java @@ -234,8 +234,11 @@ public class AmenityMenuBuilder extends MenuBuilder { }); button.setAllCaps(true); button.setText(R.string.context_menu_read_full_article); - Drawable compoundDrawable = app.getIconsCache().getIcon(R.drawable.ic_action_read_text, light ? R.color.ctx_menu_controller_button_text_color_light_n : R.color.ctx_menu_controller_button_text_color_dark_n); - button.setCompoundDrawablesWithIntrinsicBounds(compoundDrawable, null, null, null); + Drawable normal = app.getIconsCache().getIcon(R.drawable.ic_action_read_text, + light ? R.color.ctx_menu_controller_button_text_color_light_n : R.color.ctx_menu_controller_button_text_color_dark_n); + Drawable pressed = app.getIconsCache().getIcon(R.drawable.ic_action_read_text, + light ? R.color.ctx_menu_controller_button_text_color_light_p : R.color.ctx_menu_controller_button_text_color_dark_p); + button.setCompoundDrawablesWithIntrinsicBounds(AndroidUtils.createStateListDrawable(normal, pressed), null, null, null); button.setCompoundDrawablePadding(dpToPx(8f)); llText.addView(button); } diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AmenityMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AmenityMenuController.java index ec3460ba28..1fdef001f4 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AmenityMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AmenityMenuController.java @@ -73,7 +73,7 @@ public class AmenityMenuController extends MenuController { } }; leftTitleButtonController.caption = getMapActivity().getString(R.string.context_menu_read_article); - leftTitleButtonController.leftIcon = getIcon(R.drawable.ic_action_read_text, isLight() ? R.color.ctx_menu_controller_button_text_color_light_n : R.color.ctx_menu_controller_button_text_color_dark_n); + leftTitleButtonController.updateStateListDrawableIcon(R.drawable.ic_action_read_text, true); } openingHoursInfo = processOpeningHours(amenity); diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapDataMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapDataMenuController.java index a0735a80b2..c46251e66c 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapDataMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapDataMenuController.java @@ -115,7 +115,7 @@ public class MapDataMenuController extends MenuController { } }; leftDownloadButtonController.caption = getMapActivity().getString(R.string.shared_string_download); - leftDownloadButtonController.leftIconId = R.drawable.ic_action_import; + leftDownloadButtonController.updateStateListDrawableIcon(R.drawable.ic_action_import, true); rightDownloadButtonController = new TitleButtonController() { @Override @@ -142,7 +142,7 @@ public class MapDataMenuController extends MenuController { } }; rightDownloadButtonController.caption = getMapActivity().getString(R.string.download_select_map_types); - rightDownloadButtonController.leftIconId = R.drawable.ic_plugin_srtm; + rightDownloadButtonController.updateStateListDrawableIcon(R.drawable.ic_plugin_srtm, true); bottomTitleButtonController = new TitleButtonController() { @Override @@ -159,7 +159,7 @@ public class MapDataMenuController extends MenuController { } }; bottomTitleButtonController.caption = getMapActivity().getString(R.string.shared_string_delete); - bottomTitleButtonController.leftIconId = R.drawable.ic_action_delete_dark; + bottomTitleButtonController.updateStateListDrawableIcon(R.drawable.ic_action_delete_dark, true); titleProgressController = new TitleProgressController() { @Override @@ -367,7 +367,7 @@ public class MapDataMenuController extends MenuController { } leftDownloadButtonController.visible = true; - leftDownloadButtonController.leftIconId = R.drawable.ic_action_import; + leftDownloadButtonController.updateStateListDrawableIcon(R.drawable.ic_action_import, true); if (backuped) { leftDownloadButtonController.caption = getMapActivity().getString(R.string.local_index_mi_restore); } else if (indexItem != null) { @@ -375,7 +375,7 @@ public class MapDataMenuController extends MenuController { || indexItem.getType() == DownloadActivityType.HILLSHADE_FILE) && srtmDisabled) { leftDownloadButtonController.caption = getMapActivity().getString(R.string.get_plugin); - leftDownloadButtonController.leftIconId = 0; + leftDownloadButtonController.clearIcon(true); } else if (indexItem.isOutdated()) { leftDownloadButtonController.caption = getMapActivity().getString(R.string.shared_string_update); } else if (!downloaded) { diff --git a/OsmAnd/src/net/osmand/plus/mapillary/MapillaryVectorLayer.java b/OsmAnd/src/net/osmand/plus/mapillary/MapillaryVectorLayer.java index 2fb5cf0407..abc928ba8b 100644 --- a/OsmAnd/src/net/osmand/plus/mapillary/MapillaryVectorLayer.java +++ b/OsmAnd/src/net/osmand/plus/mapillary/MapillaryVectorLayer.java @@ -199,7 +199,7 @@ class MapillaryVectorLayer extends MapTileLayer implements MapillaryLayer, ICont } String userKey = settings.MAPILLARY_FILTER_USER_KEY.get(); HashMap userData = (HashMap) data; - long capturedAt = (long) userData.get("captured_at"); + long capturedAt = ((Number) userData.get("captured_at")).longValue(); long from = settings.MAPILLARY_FILTER_FROM_DATE.get(); long to = settings.MAPILLARY_FILTER_TO_DATE.get(); diff --git a/OsmAnd/src/net/osmand/plus/osmedit/EditPOIMenuController.java b/OsmAnd/src/net/osmand/plus/osmedit/EditPOIMenuController.java index 4808a06256..7d0d3b90e2 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/EditPOIMenuController.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/EditPOIMenuController.java @@ -1,7 +1,6 @@ package net.osmand.plus.osmedit; import android.content.DialogInterface; -import android.graphics.drawable.Drawable; import android.support.v7.app.AlertDialog; import net.osmand.data.PointDescription; @@ -43,7 +42,7 @@ public class EditPOIMenuController extends MenuController { } }; leftTitleButtonController.caption = getMapActivity().getString(R.string.shared_string_upload); - leftTitleButtonController.leftIconId = R.drawable.ic_action_export; + leftTitleButtonController.updateStateListDrawableIcon(R.drawable.ic_action_export, true); rightTitleButtonController = new TitleButtonController() { @Override @@ -73,7 +72,7 @@ public class EditPOIMenuController extends MenuController { } }; rightTitleButtonController.caption = getMapActivity().getString(R.string.shared_string_delete); - rightTitleButtonController.leftIconId = R.drawable.ic_action_delete_dark; + rightTitleButtonController.updateStateListDrawableIcon(R.drawable.ic_action_delete_dark, true); category = getCategory(); @@ -196,12 +195,6 @@ public class EditPOIMenuController extends MenuController { } private String getCategory() { - String category = ""; - if (osmPoint.getGroup() == OsmPoint.Group.POI) { - category = ((OpenstreetmapPoint) osmPoint).getEntity().getTag(EditPoiData.POI_TYPE_TAG); - } else if (osmPoint.getGroup() == OsmPoint.Group.BUG) { - category = getMapActivity().getString(R.string.osn_bug_name); - } - return category; + return OsmEditingPlugin.getCategory(osmPoint, getMapActivity()); } } diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmBugMenuController.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmBugMenuController.java index 02df976545..c97d9354c8 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OsmBugMenuController.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmBugMenuController.java @@ -39,7 +39,7 @@ public class OsmBugMenuController extends MenuController { } else { leftTitleButtonController.caption = getMapActivity().getString(R.string.poi_dialog_reopen); } - leftTitleButtonController.leftIconId = R.drawable.ic_action_note_dark; + leftTitleButtonController.updateStateListDrawableIcon(R.drawable.ic_action_note_dark, true); rightTitleButtonController = new TitleButtonController() { @Override @@ -50,7 +50,7 @@ public class OsmBugMenuController extends MenuController { } }; rightTitleButtonController.caption = getMapActivity().getString(R.string.shared_string_close); - rightTitleButtonController.leftIconId = R.drawable.ic_action_remove_dark; + rightTitleButtonController.updateStateListDrawableIcon(R.drawable.ic_action_remove_dark, true); updateData(); } diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java index 7c3aa390ab..4c63bcb5cf 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java @@ -445,6 +445,19 @@ public class OsmEditingPlugin extends OsmandPlugin { } } + public static String getCategory(OsmPoint osmPoint, Context context) { + String category = ""; + if (osmPoint.getGroup() == OsmPoint.Group.POI) { + category = ((OpenstreetmapPoint) osmPoint).getEntity().getTag(EditPoiData.POI_TYPE_TAG); + if (Algorithms.isEmpty(category)) { + category = context.getString(R.string.shared_string_without_name); + } + } else if (osmPoint.getGroup() == OsmPoint.Group.BUG) { + category = context.getString(R.string.osn_bug_name); + } + return category; + } + public static String getPrefix(OsmPoint osmPoint) { return (osmPoint.getGroup() == OsmPoint.Group.POI ? "POI" : "Bug") + " id: " + osmPoint.getId() + " "; } diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsAdapter.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsAdapter.java index 1a88db662c..450a9ce993 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsAdapter.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsAdapter.java @@ -301,11 +301,7 @@ public class OsmEditsAdapter extends ArrayAdapter { } private String getCategory(OsmPoint point) { - String category = ""; - if (point.getGroup() == OsmPoint.Group.POI) { - category = ((OpenstreetmapPoint) point).getEntity().getTag(EditPoiData.POI_TYPE_TAG); - } - return category; + return OsmEditingPlugin.getCategory(point, getContext()); } private String getDescription(OsmPoint point) { @@ -322,20 +318,12 @@ public class OsmEditsAdapter extends ArrayAdapter { String category = getCategory(point); - String comment = ""; - if (point.getGroup() == OsmPoint.Group.BUG) { - comment = getContext().getString(R.string.osn_bug_name); - } - String prefix = OsmEditingPlugin.getPrefix(point); String description = ""; if (!Algorithms.isEmpty(action)) { description += action + " • "; } - if (!Algorithms.isEmpty(comment)) { - description += comment + " • "; - } if (!Algorithms.isEmpty(category)) { description += category + " • "; } diff --git a/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingPositionMenuController.java b/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingPositionMenuController.java index 61badd42bb..4d1351c1ec 100644 --- a/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingPositionMenuController.java +++ b/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingPositionMenuController.java @@ -1,7 +1,6 @@ package net.osmand.plus.parkingpoint; import android.graphics.drawable.Drawable; -import android.text.TextUtils; import net.osmand.data.PointDescription; import net.osmand.plus.OsmandPlugin; @@ -32,7 +31,7 @@ public class ParkingPositionMenuController extends MenuController { } }; leftTitleButtonController.caption = getMapActivity().getString(R.string.shared_string_delete); - leftTitleButtonController.leftIconId = R.drawable.ic_action_delete_dark; + leftTitleButtonController.updateStateListDrawableIcon(R.drawable.ic_action_delete_dark, true); } private void buildParkingDescription(MapActivity mapActivity) {