diff --git a/OsmAnd/res/drawable/context_menu_controller_bg_dark.xml b/OsmAnd/res/drawable/context_menu_controller_bg_dark.xml
new file mode 100644
index 0000000000..703b0f414f
--- /dev/null
+++ b/OsmAnd/res/drawable/context_menu_controller_bg_dark.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/drawable/context_menu_controller_bg_light.xml b/OsmAnd/res/drawable/context_menu_controller_bg_light.xml
new file mode 100644
index 0000000000..703b0f414f
--- /dev/null
+++ b/OsmAnd/res/drawable/context_menu_controller_bg_light.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
\ 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 b1667436ee..e369123cc8 100644
--- a/OsmAnd/res/layout/map_context_menu_fragment.xml
+++ b/OsmAnd/res/layout/map_context_menu_fragment.xml
@@ -163,25 +163,30 @@
android:layout_marginTop="@dimen/context_menu_buttons_top_margin"
android:clickable="true"
android:minHeight="@dimen/context_menu_action_buttons_h"
- android:orientation="vertical"
+ android:orientation="horizontal"
android:paddingBottom="@dimen/context_menu_buttons_padding_bottom"
- android:paddingLeft="62dp"
- android:paddingRight="2dp"
android:visibility="gone"
tools:visibility="visible">
+ android:layout_marginLeft="@dimen/context_menu_padding_margin_medium"
+ android:layout_marginRight="@dimen/context_menu_padding_margin_medium"
+ android:id="@+id/title_button_view"
+ android:background="?attr/ctx_menu_controller_bg"
+ android:layout_width="0dp"
+ android:layout_weight="1"
+ android:layout_height="@dimen/context_menu_controller_height"
+ android:orientation="horizontal">
-
@@ -191,46 +196,38 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="-4dp"
- android:clickable="true"
android:gravity="center_vertical"
android:textColor="?android:textColorSecondary"
android:textSize="@dimen/default_desc_text_size"
tools:text="— 00:26"/>
-
+ android:layout_height="match_parent"
+ tools:visibility="gone">
63dp
12dp
9dp
+ 54dp
90dp
18dp
diff --git a/OsmAnd/res/values/attrs.xml b/OsmAnd/res/values/attrs.xml
index 9690d6d7a6..1a07d726ba 100644
--- a/OsmAnd/res/values/attrs.xml
+++ b/OsmAnd/res/values/attrs.xml
@@ -24,6 +24,7 @@
+
diff --git a/OsmAnd/res/values/sizes.xml b/OsmAnd/res/values/sizes.xml
index b23b595fb2..0143b84203 100644
--- a/OsmAnd/res/values/sizes.xml
+++ b/OsmAnd/res/values/sizes.xml
@@ -132,6 +132,7 @@
48dp
8dp
6dp
+ 36dp
62dp
12dp
diff --git a/OsmAnd/res/values/styles.xml b/OsmAnd/res/values/styles.xml
index bf31b96ede..a38374fd9f 100644
--- a/OsmAnd/res/values/styles.xml
+++ b/OsmAnd/res/values/styles.xml
@@ -131,6 +131,7 @@
- @color/divider_color
- @drawable/dashboard_button_light
- @color/ctx_menu_info_view_bg_light
+ - @drawable/context_menu_controller_bg_light
- @color/search_background_dark
- @drawable/ic_action_mode_back
- @style/WhiteActionMode
@@ -316,6 +317,7 @@
- @color/dashboard_divider_dark
- @drawable/dashboard_button_dark
- @color/ctx_menu_info_view_bg_dark
+ - @drawable/context_menu_controller_bg_dark
- @color/color_white
- @drawable/switch_ex_background_dark
- @color/switch_ex_button_text_dark
diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java
index 8c88935d2d..dcccf98229 100644
--- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java
+++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java
@@ -1064,14 +1064,6 @@ 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 8c5bd24a16..d6bd583248 100644
--- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java
+++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java
@@ -146,8 +146,8 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
}
// Left title button
- final Button leftTitleButton = (Button) view.findViewById(R.id.title_button);
- leftTitleButton.setOnClickListener(new View.OnClickListener() {
+ final View leftTitleButtonView = view.findViewById(R.id.title_button_view);
+ leftTitleButtonView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
TitleButtonController leftTitleButtonController = menu.getLeftTitleButtonController();
@@ -158,8 +158,8 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
});
// Right title button
- final Button rightTitleButton = (Button) view.findViewById(R.id.title_button_right);
- rightTitleButton.setOnClickListener(new View.OnClickListener() {
+ final View rightTitleButtonView = view.findViewById(R.id.title_button_right_view);
+ rightTitleButtonView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
TitleButtonController rightTitleButtonController = menu.getRightTitleButtonController();
@@ -169,18 +169,6 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
}
});
- // 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() {
@@ -363,11 +351,11 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
AndroidUtils.setTextSecondaryColor(getMapActivity(),
(TextView) view.findViewById(R.id.distance), nightMode);
- ((Button) view.findViewById(R.id.title_button))
+ ((TextView) view.findViewById(R.id.title_button))
.setTextColor(!nightMode ? getResources().getColor(R.color.map_widget_blue) : getResources().getColor(R.color.osmand_orange));
AndroidUtils.setTextSecondaryColor(getMapActivity(),
(TextView) view.findViewById(R.id.title_button_right_text), nightMode);
- ((Button) view.findViewById(R.id.title_button_right))
+ ((TextView) view.findViewById(R.id.title_button_right))
.setTextColor(!nightMode ? getResources().getColor(R.color.map_widget_blue) : getResources().getColor(R.color.osmand_orange));
AndroidUtils.setTextSecondaryColor(getMapActivity(),
@@ -672,53 +660,55 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
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);
+ final View leftTitleButtonView = view.findViewById(R.id.title_button_view);
+ final TextView leftTitleButton = (TextView) view.findViewById(R.id.title_button);
final TextView titleButtonRightText = (TextView) view.findViewById(R.id.title_button_right_text);
if (leftTitleButtonController != null) {
leftTitleButton.setText(leftTitleButtonController.caption);
- leftTitleButton.setVisibility(leftTitleButtonController.visible ? View.VISIBLE : View.GONE);
+ if (leftTitleButtonController.visible) {
+ leftTitleButtonView.setVisibility(View.VISIBLE);
+ Drawable leftIcon = leftTitleButtonController.getLeftIcon();
+ if (leftIcon != null) {
+ leftTitleButton.setCompoundDrawablesWithIntrinsicBounds(leftIcon, null, null, null);
+ leftTitleButton.setCompoundDrawablePadding(dpToPx(8f));
+ }
- Drawable leftIcon = leftTitleButtonController.getLeftIcon();
- if (leftIcon != null) {
- leftTitleButton.setCompoundDrawablesWithIntrinsicBounds(leftIcon, null, null, null);
- leftTitleButton.setCompoundDrawablePadding(dpToPx(8f));
- }
-
- if (leftTitleButtonController.needRightText) {
- titleButtonRightText.setText(leftTitleButtonController.rightTextCaption);
- titleButtonRightText.setVisibility(View.VISIBLE);
+ if (leftTitleButtonController.needRightText) {
+ titleButtonRightText.setText(leftTitleButtonController.rightTextCaption);
+ titleButtonRightText.setVisibility(View.VISIBLE);
+ } else {
+ titleButtonRightText.setVisibility(View.GONE);
+ }
} else {
- titleButtonRightText.setVisibility(View.GONE);
+ leftTitleButtonView.setVisibility(View.INVISIBLE);
}
} else {
- leftTitleButton.setVisibility(View.GONE);
+ leftTitleButtonView.setVisibility(View.INVISIBLE);
titleButtonRightText.setVisibility(View.GONE);
}
// Right title button
- final Button rightTitleButton = (Button) view.findViewById(R.id.title_button_right);
+ final View rightTitleButtonView = view.findViewById(R.id.title_button_right_view);
+ final TextView rightTitleButton = (TextView) view.findViewById(R.id.title_button_right);
if (rightTitleButtonController != null) {
rightTitleButton.setText(rightTitleButtonController.caption);
- rightTitleButton.setVisibility(rightTitleButtonController.visible ? View.VISIBLE : View.GONE);
+ rightTitleButtonView.setVisibility(rightTitleButtonController.visible ? View.VISIBLE : View.INVISIBLE);
Drawable leftIcon = rightTitleButtonController.getLeftIcon();
rightTitleButton.setCompoundDrawablesWithIntrinsicBounds(leftIcon, null, null, null);
rightTitleButton.setCompoundDrawablePadding(dpToPx(8f));
} else {
- rightTitleButton.setVisibility(View.GONE);
+ rightTitleButtonView.setVisibility(View.INVISIBLE);
}
// Top Right title button
@@ -734,21 +724,6 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
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)
diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java
index 93fa812e59..084003c21a 100644
--- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java
+++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java
@@ -99,7 +99,6 @@ public abstract class MenuController extends BaseMenuController {
protected TitleButtonController leftTitleButtonController;
protected TitleButtonController rightTitleButtonController;
protected TitleButtonController topRightTitleButtonController;
- protected TitleButtonController leftSubtitleButtonController;
protected TitleButtonController leftDownloadButtonController;
protected TitleButtonController rightDownloadButtonController;
@@ -323,10 +322,6 @@ public abstract class MenuController extends BaseMenuController {
return topRightTitleButtonController;
}
- public TitleButtonController getLeftSubtitleButtonController() {
- return leftSubtitleButtonController;
- }
-
public TitleButtonController getLeftDownloadButtonController() {
return leftDownloadButtonController;
}
diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/FavouritePointMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/FavouritePointMenuController.java
index f9f16681ad..85f968cf9d 100644
--- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/FavouritePointMenuController.java
+++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/FavouritePointMenuController.java
@@ -33,7 +33,7 @@ public class FavouritePointMenuController extends MenuController {
MapMarkerMenuController markerMenuController =
new MapMarkerMenuController(mapActivity, mapMarker.getPointDescription(mapActivity), mapMarker);
leftTitleButtonController = markerMenuController.getLeftTitleButtonController();
- leftSubtitleButtonController = markerMenuController.getLeftSubtitleButtonController();
+ rightTitleButtonController = markerMenuController.getRightTitleButtonController();
}
}
diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapMarkerMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapMarkerMenuController.java
index ef194d4144..8fe3450b8a 100644
--- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapMarkerMenuController.java
+++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapMarkerMenuController.java
@@ -35,15 +35,15 @@ public class MapMarkerMenuController extends MenuController {
leftTitleButtonController.caption = getMapActivity().getString(R.string.mark_passed);
leftTitleButtonController.leftIconId = isLight() ? R.drawable.passed_icon_light : R.drawable.passed_icon_dark;
- leftSubtitleButtonController = new TitleButtonController() {
+ rightTitleButtonController = 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();
+ rightTitleButtonController.caption = getMapActivity().getString(R.string.show_on_top_bar);
+ rightTitleButtonController.leftIcon = createShowOnTopbarIcon();
}
private Drawable createShowOnTopbarIcon() {
diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/WptPtMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/WptPtMenuController.java
index cf57c719e6..7dd8e99911 100644
--- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/WptPtMenuController.java
+++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/WptPtMenuController.java
@@ -29,7 +29,7 @@ public class WptPtMenuController extends MenuController {
MapMarkerMenuController markerMenuController =
new MapMarkerMenuController(mapActivity, mapMarker.getPointDescription(mapActivity), mapMarker);
leftTitleButtonController = markerMenuController.getLeftTitleButtonController();
- leftSubtitleButtonController = markerMenuController.getLeftSubtitleButtonController();
+ rightTitleButtonController = markerMenuController.getRightTitleButtonController();
}
}