diff --git a/OsmAnd/res/layout/live_updates_header.xml b/OsmAnd/res/layout/live_updates_header.xml index e7dcb77ded..2cbff37160 100644 --- a/OsmAnd/res/layout/live_updates_header.xml +++ b/OsmAnd/res/layout/live_updates_header.xml @@ -182,6 +182,7 @@ android:background="?attr/dashboard_divider"/> adapter, int itemId, int pos, boolean isChecked) { diff --git a/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesFragment.java b/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesFragment.java index 66914d8d44..bfe5b1b8dd 100644 --- a/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesFragment.java +++ b/OsmAnd/src/net/osmand/plus/liveupdates/LiveUpdatesFragment.java @@ -141,14 +141,20 @@ public class LiveUpdatesFragment extends BaseOsmAndFragment { } regionNameTextView.setText(countryName); - Button subscribeButton = (Button) subscriptionHeader.findViewById(R.id.subscribeButton); - subscribeButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - SubscriptionFragment subscriptionFragment = new SubscriptionFragment(); - subscriptionFragment.show(getChildFragmentManager(), SubscriptionFragment.TAG); - } - }); + View subscribeButtonRow = subscriptionHeader.findViewById(R.id.subscribeButtonRow); + if (InAppHelper.isSubscribedToLiveUpdates()) { + subscribeButtonRow.setVisibility(View.GONE); + } else { + subscribeButtonRow.setVisibility(View.VISIBLE); + Button subscribeButton = (Button) subscriptionHeader.findViewById(R.id.subscribeButton); + subscribeButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + SubscriptionFragment subscriptionFragment = new SubscriptionFragment(); + subscriptionFragment.show(getChildFragmentManager(), SubscriptionFragment.TAG); + } + }); + } subscriptionBanner.setVisibility(View.GONE); subscriptionInfo.setVisibility(View.VISIBLE); diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java index d6aea8dd3f..6263dcbe7f 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java @@ -386,7 +386,7 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents { }); final ImageButton buttonWaypoint = (ImageButton) view.findViewById(R.id.context_menu_route_button); - buttonWaypoint.setImageDrawable(iconsCache.getIcon(R.drawable.map_action_flag_dark, + buttonWaypoint.setImageDrawable(iconsCache.getIcon(R.drawable.map_action_waypoint, !nightMode ? R.color.icon_color : R.color.dashboard_subheader_text_dark)); AndroidUtils.setDashButtonBackground(getMapActivity(), buttonWaypoint, nightMode); buttonWaypoint.setOnClickListener(new View.OnClickListener() { @@ -721,16 +721,18 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents { int dy = 0; if (!menu.isLandscapeLayout()) { TextView line1 = (TextView) view.findViewById(R.id.context_menu_line1); + TextView line2 = (TextView) view.findViewById(R.id.context_menu_line2); if (menuTopViewHeight != 0) { - int titleHeight = line1.getLineCount() * line1.getLineHeight() + menuTitleTopBottomPadding; - if (titleHeight < line1.getMeasuredHeight()) { - titleHeight = line1.getMeasuredHeight(); + int titleHeight = line1.getLineCount() * line1.getLineHeight() + line2.getLineCount() * line2.getLineHeight() + menuTitleTopBottomPadding; + if (titleHeight < line1.getMeasuredHeight() + line2.getMeasuredHeight()) { + titleHeight = line1.getMeasuredHeight() + line2.getMeasuredHeight(); } newMenuTopViewHeight = menuTopViewHeightExcludingTitle + titleHeight; dy = Math.max(0, newMenuTopViewHeight - menuTopViewHeight - (newMenuTopShadowAllHeight - menuTopShadowAllHeight)); } else { - menuTopViewHeightExcludingTitle = newMenuTopViewHeight - line1.getMeasuredHeight(); - menuTitleTopBottomPadding = line1.getMeasuredHeight() - line1.getLineCount() * line1.getLineHeight(); + menuTopViewHeightExcludingTitle = newMenuTopViewHeight - line1.getMeasuredHeight() - line2.getMeasuredHeight(); + menuTitleTopBottomPadding = (line1.getMeasuredHeight() - line1.getLineCount() * line1.getLineHeight()) + + (line2.getMeasuredHeight() - line2.getLineCount() * line2.getLineHeight()); } } menuTopViewHeight = newMenuTopViewHeight; @@ -985,7 +987,7 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents { } else { cpy = cpyOrig; } - if (dx > 0 || center) { + if (dx >= 0 || center) { latlon = box.getLatLonFromPixel(cpx - dx, cpy - dy); } } diff --git a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java index 8595474bb4..f383ca7527 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java @@ -228,7 +228,7 @@ public class MapControlsLayer extends OsmandMapLayer { }); ImageView waypointsButton = (ImageView) main.findViewById(R.id.map_waypoints_route_button); - waypointsButton.setImageDrawable(app.getIconsCache().getContentIcon(R.drawable.map_action_waypoints, !nightMode)); + waypointsButton.setImageDrawable(app.getIconsCache().getContentIcon(R.drawable.map_action_waypoint, !nightMode)); AndroidUtils.setBackground(mapActivity, waypointsButton, nightMode, R.drawable.dashboard_button_light, R.drawable.dashboard_button_dark); waypointsButton.setOnClickListener(new View.OnClickListener() { @Override