forked from organicmaps/organicmaps
[android] process new intents. need for screenshoots automatizations
This commit is contained in:
parent
761cebe16e
commit
373dff28ea
3 changed files with 45 additions and 0 deletions
|
@ -1106,4 +1106,13 @@ extern "C"
|
|||
|
||||
return env->NewObject(objClazz, methodID, j_name, lat, lon, j_type);
|
||||
}
|
||||
|
||||
JNIEXPORT jobject JNICALL
|
||||
Java_com_mapswithme_maps_Framework_nativeActivateUserMark(JNIEnv * env, jclass clazz, jdouble lat, jdouble lon)
|
||||
{
|
||||
::Framework * fr = g_framework->NativeFramework();
|
||||
m2::PointD pxPoint = fr->GtoP(MercatorBounds::FromLatLon(lat, lon));
|
||||
UserMark const * mark = fr->GetUserMark(pxPoint, true);
|
||||
fr->GetBalloonManager().OnShowMark(mark);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -159,6 +159,7 @@ public class Framework
|
|||
private native static String nativeGetGe0Url(double lat, double lon, double zoomLevel, String name);
|
||||
private native static String nativeGetNameAndAddress4Point(double lat, double lon);
|
||||
public native static MapObject nativeGetMapObjectForPoint(double lat, double lon);
|
||||
public native static void nativeActivateUserMark(double lat, double lon);
|
||||
|
||||
private native static void nativeConnectBalloonListeners(OnBalloonListener listener);
|
||||
private native static void nativeClearBalloonListeners();
|
||||
|
|
|
@ -72,6 +72,11 @@ public class MWMActivity extends NvEventQueueActivity
|
|||
private static final String PRO_VERSION_DIALOG_MSG = "pro_version_dialog_msg";
|
||||
private static final int PROMO_DIALOG = 110002;
|
||||
private final static String EXTRA_CONSUMED = "mwm.extra.intent.processed";
|
||||
private final static String EXTRA_SCREENSHOTS_TASK = "screenshots_task";
|
||||
private final static String SCREENSHOTS_TASK_LOCATE = "locate_task";
|
||||
private final static String SCREENSHOTS_TASK_PPP = "show_place_page";
|
||||
private final static String EXTRA_LAT = "lat";
|
||||
private final static String EXTRA_LON = "lon";
|
||||
// Need it for search
|
||||
private static final String EXTRA_SEARCH_RES_SINGLE = "search_res_index";
|
||||
// Map tasks that we run AFTER rendering initialized
|
||||
|
@ -192,6 +197,28 @@ public class MWMActivity extends NvEventQueueActivity
|
|||
});
|
||||
}
|
||||
|
||||
private void checkUserMarkActivation()
|
||||
{
|
||||
final Intent intent = getIntent();
|
||||
if (intent != null && intent.hasExtra(EXTRA_SCREENSHOTS_TASK))
|
||||
{
|
||||
final String value = intent.getStringExtra(EXTRA_SCREENSHOTS_TASK);
|
||||
if (value.equals(SCREENSHOTS_TASK_PPP))
|
||||
{
|
||||
final double lat = Double.parseDouble(intent.getStringExtra(EXTRA_LAT));
|
||||
final double lon = Double.parseDouble(intent.getStringExtra(EXTRA_LON));
|
||||
mToolbar.getHandler().postDelayed(new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
Framework.nativeActivateUserMark(lat, lon);
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void OnRenderingInitialized()
|
||||
{
|
||||
|
@ -208,6 +235,7 @@ public class MWMActivity extends NvEventQueueActivity
|
|||
checkKitkatMigrationMove();
|
||||
checkFacebookDialog();
|
||||
checkBuyProDialog();
|
||||
checkUserMarkActivation();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -676,6 +704,13 @@ public class MWMActivity extends NvEventQueueActivity
|
|||
mSearchController.onCreate(this);
|
||||
|
||||
setUpToolbars();
|
||||
|
||||
if (intent != null && intent.hasExtra(EXTRA_SCREENSHOTS_TASK))
|
||||
{
|
||||
String value = intent.getStringExtra(EXTRA_SCREENSHOTS_TASK);
|
||||
if (value.equals(SCREENSHOTS_TASK_LOCATE))
|
||||
onMyPositionClicked(null);
|
||||
}
|
||||
}
|
||||
|
||||
private void setUpToolbars()
|
||||
|
|
Loading…
Add table
Reference in a new issue