diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java index f67c0d4998..ca8e8b7ccd 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java @@ -598,7 +598,7 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL historyStack.add(menuData); } if (!(menuController instanceof MapDataMenuController)) { - menuController.buildMapDownloadButton(latLon); + menuController.buildMapDownloadButtonAndSizeInfo(latLon); } return true; } else { diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java index 0e431acecf..c60648e633 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java @@ -1501,7 +1501,7 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo if (created) { menu.updateData(); updateButtonsAndProgress(); - runLayoutListener(); + refreshTitle(); } } diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java index 592f3db084..68dc0567b7 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java @@ -4,6 +4,7 @@ import android.graphics.drawable.Drawable; import android.os.AsyncTask; import android.support.annotation.NonNull; import android.support.v4.content.ContextCompat; +import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.LinearLayout; @@ -433,14 +434,23 @@ public abstract class MenuController extends BaseMenuController { } public int getAdditionalInfoColor() { + if (indexItem != null) { + return R.color.icon_color; + } return 0; } public String getAdditionalInfoStr() { + if (indexItem != null) { + return getMapActivity().getString(R.string.file_size_in_mb, indexItem.getArchiveSizeMB()); + } return ""; } public int getAdditionalInfoIconRes() { + if (indexItem != null) { + return R.drawable.ic_sdcard_16; + } return 0; } @@ -646,7 +656,7 @@ public abstract class MenuController extends BaseMenuController { } } - public void buildMapDownloadButton(final LatLon latLon) { + public void buildMapDownloadButtonAndSizeInfo(final LatLon latLon) { new AsyncTask() { ResourceManager rm; diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AmenityMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AmenityMenuController.java index c29722c162..ec3460ba28 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AmenityMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AmenityMenuController.java @@ -150,7 +150,7 @@ public class AmenityMenuController extends MenuController { if (openingHoursInfo != null) { return openingHoursInfo.isOpened() ? R.color.ctx_menu_amenity_opened_text_color : R.color.ctx_menu_amenity_closed_text_color; } - return 0; + return super.getAdditionalInfoColor(); } @Override @@ -158,7 +158,7 @@ public class AmenityMenuController extends MenuController { if (openingHoursInfo != null) { return openingHoursInfo.getInfo(getMapActivity()); } - return ""; + return super.getAdditionalInfoStr(); } @Override @@ -166,7 +166,7 @@ public class AmenityMenuController extends MenuController { if (openingHoursInfo != null) { return R.drawable.ic_action_opening_hour_16; } - return 0; + return super.getAdditionalInfoIconRes(); } public static String getTypeStr(Amenity amenity) {