forked from organicmaps/organicmaps
[android] Skip location centering when activity is resumed.
This commit is contained in:
parent
f6a0998f6e
commit
7760bc5ef5
2 changed files with 15 additions and 4 deletions
|
@ -218,4 +218,11 @@ extern "C"
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_mapswithme_maps_MWMActivity_nativeSkipLocationCentering(JNIEnv * env, jobject thiz)
|
||||
{
|
||||
g_framework->NativeFramework()->SkipLocationCentering();
|
||||
}
|
||||
|
||||
} // extern "C"
|
||||
|
|
|
@ -586,11 +586,14 @@ public class MWMActivity extends NvEventQueueActivity implements LocationService
|
|||
@Override
|
||||
protected void onResume()
|
||||
{
|
||||
View button = findViewById(R.id.map_button_myposition);
|
||||
if (button.isSelected())
|
||||
final View v = findViewById(R.id.map_button_myposition);
|
||||
if (v != null && v.isSelected())
|
||||
{
|
||||
// Change button appearance to "looking for position"
|
||||
button.setBackgroundResource(R.drawable.myposition_button_normal);
|
||||
// change button appearance to "looking for position"
|
||||
v.setBackgroundResource(R.drawable.myposition_button_normal);
|
||||
|
||||
// do not move map's viewport to a location when this activity is resumed
|
||||
nativeSkipLocationCentering();
|
||||
|
||||
// and remember to start locationService updates in OnRenderingInitialized
|
||||
m_shouldStartLocationService = true;
|
||||
|
@ -774,4 +777,5 @@ public class MWMActivity extends NvEventQueueActivity implements LocationService
|
|||
private native void nativeCheckForProVersion(String serverURL);
|
||||
|
||||
private native boolean nativeIsInChina(double lat, double lon);
|
||||
private native void nativeSkipLocationCentering();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue