forked from organicmaps/organicmaps
[and, api] API update: pick point
This commit is contained in:
parent
7f27a2d030
commit
9b4b83abac
3 changed files with 37 additions and 4 deletions
|
@ -94,7 +94,7 @@ public class MapObjectFragment extends Fragment
|
|||
|
||||
mCategory = bookmark.getCategoryId();
|
||||
mBmkIndex = bookmark.getBookmarkId();
|
||||
mScale = bookmark.getScale();
|
||||
mScale = bookmark.getScale();
|
||||
|
||||
mType = MapObjectType.BOOKMARK;
|
||||
}
|
||||
|
@ -225,6 +225,33 @@ public class MapObjectFragment extends Fragment
|
|||
super.onResume();
|
||||
|
||||
adaptUI();
|
||||
|
||||
setUpPickPoint();
|
||||
}
|
||||
|
||||
private void setUpPickPoint()
|
||||
{
|
||||
if (ParsedMmwRequest.hasRequest())
|
||||
{
|
||||
final ParsedMmwRequest request = ParsedMmwRequest.getCurrentRequest();
|
||||
if (request.isPickPointMode())
|
||||
{
|
||||
UiUtils.show(mOpenWith);
|
||||
request.setPointData(mLat, mLon, mName, "");
|
||||
|
||||
mOpenWith.setOnClickListener(new OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(View v)
|
||||
{
|
||||
onOpenWithClicked();
|
||||
}
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
mOpenWith.setOnClickListener(this);
|
||||
}
|
||||
|
||||
private void adaptUI()
|
||||
|
|
|
@ -13,6 +13,7 @@ public class Const
|
|||
public static final String EXTRA_HAS_PENDING_INTENT = AUTHORITY + ".has_pen_intent";
|
||||
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";
|
||||
|
||||
|
||||
/* Response extras */
|
||||
|
|
|
@ -23,6 +23,8 @@ public class ParsedMmwRequest
|
|||
private PendingIntent mPendingIntent;
|
||||
// return on ballon click
|
||||
private boolean mReturnOnBalloonClick;
|
||||
// pick point mode
|
||||
private boolean mPickPoint;
|
||||
|
||||
// response data
|
||||
private boolean mHasPoint;
|
||||
|
@ -30,9 +32,10 @@ public class ParsedMmwRequest
|
|||
private double mLon;
|
||||
|
||||
|
||||
public double getLat() { return mLat; }
|
||||
public double getLon() { return mLon; }
|
||||
public String getName() { return mName;}
|
||||
public double getLat() { return mLat; }
|
||||
public double getLon() { return mLon; }
|
||||
public String getName() { return mName;}
|
||||
public boolean isPickPointMode() { return mPickPoint; }
|
||||
|
||||
private String mName;
|
||||
private String mId;
|
||||
|
@ -48,6 +51,8 @@ public class ParsedMmwRequest
|
|||
request.mCallerInfo = data.getParcelableExtra(Const.EXTRA_CALLER_APP_INFO);
|
||||
request.mTitle = data.getStringExtra(Const.EXTRA_TITLE);
|
||||
request.mReturnOnBalloonClick = data.getBooleanExtra(Const.EXTRA_RETURN_ON_BALLOON_CLICK, false);
|
||||
request.mPickPoint = data.getBooleanExtra(Const.EXTRA_PICK_POINT, false);
|
||||
|
||||
if (data.getBooleanExtra(Const.EXTRA_HAS_PENDING_INTENT, false))
|
||||
{
|
||||
request.mPendingIntent = data.getParcelableExtra(Const.EXTRA_CALLER_PENDING_INTENT);
|
||||
|
|
Loading…
Add table
Reference in a new issue