From 2c2d693b1f3c57062acfddb01655b365ec02801e Mon Sep 17 00:00:00 2001 From: d-kunin Date: Tue, 10 Sep 2013 13:19:44 +0300 Subject: [PATCH] [feature] custom button title support --- lib/src/com/mapswithme/maps/api/Const.java | 1 + lib/src/com/mapswithme/maps/api/MwmRequest.java | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/src/com/mapswithme/maps/api/Const.java b/lib/src/com/mapswithme/maps/api/Const.java index 609f338..72d0418 100644 --- a/lib/src/com/mapswithme/maps/api/Const.java +++ b/lib/src/com/mapswithme/maps/api/Const.java @@ -35,6 +35,7 @@ public class Const public static final String EXTRA_CALLER_PENDING_INTENT = AUTHORITY + ".pending_intent"; public static final String EXTRA_RETURN_ON_BALLOON_CLICK = AUTHORITY + ".return_on_balloon_click"; public static final String EXTRA_PICK_POINT = AUTHORITY + ".pick_point"; + public static final String EXTRA_CUSTOM_BUTTON_NAME = AUTHORITY + ".custom_button_name"; /* Response extras */ diff --git a/lib/src/com/mapswithme/maps/api/MwmRequest.java b/lib/src/com/mapswithme/maps/api/MwmRequest.java index 10a65da..b922828 100644 --- a/lib/src/com/mapswithme/maps/api/MwmRequest.java +++ b/lib/src/com/mapswithme/maps/api/MwmRequest.java @@ -22,15 +22,25 @@ public class MwmRequest private double mZoomLevel = 1; private boolean mReturnOnBalloonClick; private boolean mPickPoint = false; + private String mCustomButtonName = ""; // ** + public MwmRequest setCustomButtonName(String buttonName) + { + if (buttonName != null) + mCustomButtonName = buttonName; + else + mCustomButtonName = ""; + return this; + } + public MwmRequest setTitle(String title) { mTitle = title; return this; } - MwmRequest setPickPointMode(boolean pickPoint) + public MwmRequest setPickPointMode(boolean pickPoint) { mPickPoint = pickPoint; return this; @@ -84,6 +94,8 @@ public class MwmRequest mwmIntent.putExtra(Const.EXTRA_RETURN_ON_BALLOON_CLICK, mReturnOnBalloonClick); // pick point mwmIntent.putExtra(Const.EXTRA_PICK_POINT, mPickPoint); + // custom button name + mwmIntent.putExtra(Const.EXTRA_CUSTOM_BUTTON_NAME, mCustomButtonName); final boolean hasIntent = mPendingIntent != null; mwmIntent.putExtra(Const.EXTRA_HAS_PENDING_INTENT, hasIntent);