[android] #4365 - Improve test app examples related to InfoWindows
This commit is contained in:
@@ -1,37 +0,0 @@
|
||||
package com.mapbox.mapboxsdk.testapp.espresso;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.support.test.rule.ActivityTestRule;
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import com.mapbox.mapboxsdk.testapp.activity.InfoWindowConcurrentActivity;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
/**
|
||||
* Tests on InfoWindowConcurrentActivity
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class InfoWindowConcurrentActivityTest extends BaseTest {
|
||||
|
||||
@Rule
|
||||
public ActivityTestRule<InfoWindowConcurrentActivity> mActivityRule = new ActivityTestRule<>(InfoWindowConcurrentActivity.class);
|
||||
|
||||
private Activity mActivity = null;
|
||||
|
||||
@Before
|
||||
public void setActivity() {
|
||||
mActivity = mActivityRule.getActivity();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSanity() {
|
||||
checkViewIsDisplayed(R.id.infoWindowConcurrentMapView);
|
||||
}
|
||||
}
|
||||
@@ -31,14 +31,6 @@
|
||||
android:name="@string/category"
|
||||
android:value="@string/category_other" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".activity.InfoWindowAdapterActivity"
|
||||
android:description="@string/description_info_window_adapter"
|
||||
android:label="@string/activity_infowindow_adapter">
|
||||
<meta-data
|
||||
android:name="@string/category"
|
||||
android:value="@string/category_infowindow" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".activity.InfoWindowActivity"
|
||||
android:description="@string/description_info_window"
|
||||
@@ -47,11 +39,10 @@
|
||||
android:name="@string/category"
|
||||
android:value="@string/category_infowindow" />
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".activity.InfoWindowConcurrentActivity"
|
||||
android:description="@string/description_info_window_concurrent"
|
||||
android:label="@string/activity_info_window_concurrent">
|
||||
android:name=".activity.InfoWindowAdapterActivity"
|
||||
android:description="@string/description_info_window_adapter"
|
||||
android:label="@string/activity_infowindow_adapter">
|
||||
<meta-data
|
||||
android:name="@string/category"
|
||||
android:value="@string/category_infowindow" />
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.support.annotation.NonNull;
|
||||
import android.support.v7.app.ActionBar;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.widget.Toast;
|
||||
|
||||
@@ -19,10 +20,11 @@ import com.mapbox.mapboxsdk.maps.MapView;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
public class InfoWindowActivity extends AppCompatActivity {
|
||||
public class InfoWindowActivity extends AppCompatActivity implements OnMapReadyCallback, MapboxMap.OnInfoWindowCloseListener, MapboxMap.OnMapLongClickListener, MapboxMap.OnInfoWindowClickListener, MapboxMap.OnInfoWindowLongClickListener {
|
||||
|
||||
private MapView mMapView;
|
||||
private Marker mCustomMarker;
|
||||
private MapboxMap mapboxMap;
|
||||
private MapView mapView;
|
||||
private Marker customMarker;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@@ -38,121 +40,137 @@ public class InfoWindowActivity extends AppCompatActivity {
|
||||
actionBar.setDisplayShowHomeEnabled(true);
|
||||
}
|
||||
|
||||
mMapView = (MapView) findViewById(R.id.mapView);
|
||||
mMapView.setAccessToken(ApiAccess.getToken(this));
|
||||
mMapView.onCreate(savedInstanceState);
|
||||
mMapView.getMapAsync(new OnMapReadyCallback() {
|
||||
@Override
|
||||
public void onMapReady(@NonNull final MapboxMap mapboxMap) {
|
||||
mapboxMap.addMarker(new MarkerOptions()
|
||||
.title("Intersection")
|
||||
.snippet("H St NW with 15th St NW")
|
||||
.position(new LatLng(38.9002073, -77.03364419)));
|
||||
mapView = (MapView) findViewById(R.id.mapView);
|
||||
mapView.setAccessToken(ApiAccess.getToken(this));
|
||||
mapView.onCreate(savedInstanceState);
|
||||
mapView.getMapAsync(this);
|
||||
}
|
||||
|
||||
Marker marker = mapboxMap.addMarker(new MarkerOptions()
|
||||
.title("White House")
|
||||
.snippet("The official residence and principal workplace of the President of the United States, located at 1600 Pennsylvania Avenue NW in Washington, D.C. It has been the residence of every U.S. president since John Adams in 1800.")
|
||||
.position(new LatLng(38.897705003219784, -77.03655168667463)));
|
||||
@Override
|
||||
public void onMapReady(@NonNull MapboxMap mapboxMap) {
|
||||
this.mapboxMap = mapboxMap;
|
||||
addMarkers();
|
||||
addInfoWindowListeners();
|
||||
}
|
||||
|
||||
// open InfoWindow at startup!
|
||||
mapboxMap.selectMarker(marker);
|
||||
private void addMarkers() {
|
||||
mapboxMap.addMarker(new MarkerOptions()
|
||||
.title("Intersection")
|
||||
.snippet("H St NW with 15th St NW")
|
||||
.position(new LatLng(38.9002073, -77.03364419)));
|
||||
|
||||
mapboxMap.addMarker(new MarkerOptions().title("Intersection")
|
||||
.snippet("E St NW with 17th St NW")
|
||||
.position(new LatLng(38.8954236, -77.0394623)));
|
||||
mapboxMap.addMarker(new MarkerOptions().title("Intersection")
|
||||
.snippet("E St NW with 17th St NW")
|
||||
.position(new LatLng(38.8954236, -77.0394623)));
|
||||
|
||||
mapboxMap.setOnInfoWindowCloseListener(new MapboxMap.OnInfoWindowCloseListener() {
|
||||
@Override
|
||||
public void onInfoWindowClose(Marker marker) {
|
||||
Toast.makeText(getApplicationContext(), "OnClose: " + marker.getTitle(), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
});
|
||||
Marker marker = mapboxMap.addMarker(new MarkerOptions()
|
||||
.title("White House")
|
||||
.snippet("The official residence and principal workplace of the President of the United States, located at 1600 Pennsylvania Avenue NW in Washington, D.C. It has been the residence of every U.S. president since John Adams in 1800.")
|
||||
.position(new LatLng(38.897705003219784, -77.03655168667463)));
|
||||
|
||||
final DecimalFormat formatter = new DecimalFormat("#.#####");
|
||||
mapboxMap.setOnMapLongClickListener(new MapboxMap.OnMapLongClickListener() {
|
||||
@Override
|
||||
public void onMapLongClick(@NonNull LatLng point) {
|
||||
// Remove previous added marker
|
||||
if (mCustomMarker != null) {
|
||||
mapboxMap.removeAnnotation(mCustomMarker);
|
||||
mCustomMarker = null;
|
||||
}
|
||||
// open InfoWindow at startup
|
||||
mapboxMap.selectMarker(marker);
|
||||
}
|
||||
|
||||
// Add marker on long click location with default marker image
|
||||
mCustomMarker = mapboxMap.addMarker(new MarkerOptions()
|
||||
.title("Custom Marker")
|
||||
.snippet(formatter.format(point.getLatitude()) + ", " + formatter.format(point.getLongitude()))
|
||||
.position(point));
|
||||
}
|
||||
});
|
||||
private void addInfoWindowListeners() {
|
||||
mapboxMap.setOnInfoWindowCloseListener(this);
|
||||
mapboxMap.setOnMapLongClickListener(this);
|
||||
mapboxMap.setOnInfoWindowClickListener(this);
|
||||
mapboxMap.setOnInfoWindowLongClickListener(this);
|
||||
}
|
||||
|
||||
private void toggleConcurrentInfoWindow(boolean allowConcurrentInfoWindow) {
|
||||
mapboxMap.deselectMarkers();
|
||||
mapboxMap.setAllowConcurrentMultipleOpenInfoWindows(allowConcurrentInfoWindow);
|
||||
}
|
||||
|
||||
mapboxMap.setOnInfoWindowClickListener(new MapboxMap.OnInfoWindowClickListener() {
|
||||
@Override
|
||||
public boolean onInfoWindowClick(@NonNull Marker marker) {
|
||||
Toast.makeText(getApplicationContext(), "OnClick: " + marker.getTitle(), Toast.LENGTH_LONG).show();
|
||||
// return false to close the info window
|
||||
// return true to leave the info window open
|
||||
return false;
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public boolean onInfoWindowClick(@NonNull Marker marker) {
|
||||
Toast.makeText(getApplicationContext(), "OnClick: " + marker.getTitle(), Toast.LENGTH_LONG).show();
|
||||
// returning true will leave the info window open
|
||||
return false;
|
||||
}
|
||||
|
||||
mapboxMap.setOnInfoWindowLongClickListener(new MapboxMap.OnInfoWindowLongClickListener() {
|
||||
@Override
|
||||
public void onInfoWindowLongClick(Marker marker) {
|
||||
Toast.makeText(getApplicationContext(), "OnLongClick: " + marker.getTitle(), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void onInfoWindowClose(Marker marker) {
|
||||
Toast.makeText(getApplicationContext(), "OnClose: " + marker.getTitle(), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void onInfoWindowLongClick(Marker marker) {
|
||||
Toast.makeText(getApplicationContext(), "OnLongClick: " + marker.getTitle(), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapLongClick(@NonNull LatLng point) {
|
||||
if (customMarker != null) {
|
||||
// Remove previous added marker
|
||||
mapboxMap.removeAnnotation(customMarker);
|
||||
customMarker = null;
|
||||
}
|
||||
|
||||
// Add marker on long click location with default marker image
|
||||
customMarker = mapboxMap.addMarker(new MarkerOptions()
|
||||
.title("Custom Marker")
|
||||
.snippet(new DecimalFormat("#.#####").format(point.getLatitude()) + ", " + new DecimalFormat("#.#####").format(point.getLongitude()))
|
||||
.position(point));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
mMapView.onStart();
|
||||
mapView.onStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
mMapView.onResume();
|
||||
mapView.onResume();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
mMapView.onPause();
|
||||
mapView.onPause();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
mMapView.onStop();
|
||||
mapView.onStop();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onSaveInstanceState(Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
mMapView.onSaveInstanceState(outState);
|
||||
mapView.onSaveInstanceState(outState);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
mMapView.onDestroy();
|
||||
mapView.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLowMemory() {
|
||||
super.onLowMemory();
|
||||
mMapView.onLowMemory();
|
||||
mapView.onLowMemory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
getMenuInflater().inflate(R.menu.menu_infowindow, menu);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case R.id.action_toggle_concurrent_infowindow:
|
||||
toggleConcurrentInfoWindow(!item.isChecked());
|
||||
item.setChecked(!item.isChecked());
|
||||
return true;
|
||||
case android.R.id.home:
|
||||
onBackPressed();
|
||||
return true;
|
||||
|
||||
@@ -27,9 +27,9 @@ import com.mapbox.mapboxsdk.maps.MapView;
|
||||
|
||||
public class InfoWindowAdapterActivity extends AppCompatActivity {
|
||||
|
||||
private MapView mMapView;
|
||||
private IconFactory mIconFactory;
|
||||
private Drawable mIconDrawable;
|
||||
private MapView mapView;
|
||||
private IconFactory iconFactory;
|
||||
private Drawable iconDrawable;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@@ -45,100 +45,104 @@ public class InfoWindowAdapterActivity extends AppCompatActivity {
|
||||
actionBar.setDisplayShowHomeEnabled(true);
|
||||
}
|
||||
|
||||
mMapView = (MapView) findViewById(R.id.mapView);
|
||||
mMapView.setAccessToken(ApiAccess.getToken(this));
|
||||
mMapView.onCreate(savedInstanceState);
|
||||
iconFactory = IconFactory.getInstance(this);
|
||||
iconDrawable = ContextCompat.getDrawable(this, R.drawable.ic_location_city_24dp);
|
||||
|
||||
mIconFactory = IconFactory.getInstance(this);
|
||||
mIconDrawable = ContextCompat.getDrawable(this, R.drawable.ic_location_city_24dp);
|
||||
|
||||
mMapView.getMapAsync(new OnMapReadyCallback() {
|
||||
mapView = (MapView) findViewById(R.id.mapView);
|
||||
mapView.setAccessToken(ApiAccess.getToken(this));
|
||||
mapView.onCreate(savedInstanceState);
|
||||
mapView.getMapAsync(new OnMapReadyCallback() {
|
||||
@Override
|
||||
public void onMapReady(@NonNull MapboxMap mapboxMap) {
|
||||
// add markers
|
||||
mapboxMap.addMarker(generateCityStateMarker("Andorra", 42.505777, 1.52529, "#F44336"));
|
||||
mapboxMap.addMarker(generateCityStateMarker("Luxembourg", 49.815273, 6.129583, "#3F51B5"));
|
||||
mapboxMap.addMarker(generateCityStateMarker("Monaco", 43.738418, 7.424616, "#673AB7"));
|
||||
mapboxMap.addMarker(generateCityStateMarker("Vatican City", 41.902916, 12.453389, "#009688"));
|
||||
mapboxMap.addMarker(generateCityStateMarker("San Marino", 43.942360, 12.457777, "#795548"));
|
||||
mapboxMap.addMarker(generateCityStateMarker("Liechtenstein", 47.166000, 9.555373, "#FF5722"));
|
||||
|
||||
// add custom window adapter
|
||||
mapboxMap.setInfoWindowAdapter(new MapboxMap.InfoWindowAdapter() {
|
||||
|
||||
private int tenDp = (int) getResources().getDimension(R.dimen.attr_margin);
|
||||
|
||||
@Override
|
||||
public View getInfoWindow(@NonNull Marker marker) {
|
||||
TextView textView = new TextView(InfoWindowAdapterActivity.this);
|
||||
textView.setText(marker.getTitle());
|
||||
textView.setTextColor(Color.WHITE);
|
||||
|
||||
if(marker instanceof CityStateMarker){
|
||||
CityStateMarker cityStateMarker = (CityStateMarker)marker;
|
||||
textView.setBackgroundColor(Color.parseColor(cityStateMarker.getInfoWindowBackgroundColor()));
|
||||
}
|
||||
|
||||
textView.setPadding(tenDp, tenDp, tenDp, tenDp);
|
||||
return textView;
|
||||
}
|
||||
});
|
||||
addMarkers(mapboxMap);
|
||||
addCustomInfoWindowAdapter(mapboxMap);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void addMarkers(MapboxMap mapboxMap){
|
||||
mapboxMap.addMarker(generateCityStateMarker("Andorra", 42.505777, 1.52529, "#F44336"));
|
||||
mapboxMap.addMarker(generateCityStateMarker("Luxembourg", 49.815273, 6.129583, "#3F51B5"));
|
||||
mapboxMap.addMarker(generateCityStateMarker("Monaco", 43.738418, 7.424616, "#673AB7"));
|
||||
mapboxMap.addMarker(generateCityStateMarker("Vatican City", 41.902916, 12.453389, "#009688"));
|
||||
mapboxMap.addMarker(generateCityStateMarker("San Marino", 43.942360, 12.457777, "#795548"));
|
||||
mapboxMap.addMarker(generateCityStateMarker("Liechtenstein", 47.166000, 9.555373, "#FF5722"));
|
||||
}
|
||||
|
||||
private CityStateMarkerOptions generateCityStateMarker(String title, double lat, double lng, String color) {
|
||||
CityStateMarkerOptions marker = new CityStateMarkerOptions();
|
||||
marker.title(title);
|
||||
marker.position(new LatLng(lat, lng));
|
||||
marker.infoWindowBackground(color);
|
||||
|
||||
mIconDrawable.setColorFilter(Color.parseColor(color), PorterDuff.Mode.SRC_IN);
|
||||
Icon icon = mIconFactory.fromDrawable(mIconDrawable);
|
||||
iconDrawable.setColorFilter(Color.parseColor(color), PorterDuff.Mode.SRC_IN);
|
||||
Icon icon = iconFactory.fromDrawable(iconDrawable);
|
||||
marker.icon(icon);
|
||||
return marker;
|
||||
}
|
||||
|
||||
private void addCustomInfoWindowAdapter(MapboxMap mapboxMap){
|
||||
mapboxMap.setInfoWindowAdapter(new MapboxMap.InfoWindowAdapter() {
|
||||
|
||||
private int tenDp = (int) getResources().getDimension(R.dimen.attr_margin);
|
||||
|
||||
@Override
|
||||
public View getInfoWindow(@NonNull Marker marker) {
|
||||
TextView textView = new TextView(InfoWindowAdapterActivity.this);
|
||||
textView.setText(marker.getTitle());
|
||||
textView.setTextColor(Color.WHITE);
|
||||
|
||||
if (marker instanceof CityStateMarker) {
|
||||
CityStateMarker cityStateMarker = (CityStateMarker) marker;
|
||||
textView.setBackgroundColor(Color.parseColor(cityStateMarker.getInfoWindowBackgroundColor()));
|
||||
}
|
||||
|
||||
textView.setPadding(tenDp, tenDp, tenDp, tenDp);
|
||||
return textView;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
mMapView.onStart();
|
||||
mapView.onStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
mMapView.onResume();
|
||||
mapView.onResume();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
mMapView.onPause();
|
||||
mapView.onPause();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
mMapView.onStop();
|
||||
mapView.onStop();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onSaveInstanceState(Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
mMapView.onSaveInstanceState(outState);
|
||||
mapView.onSaveInstanceState(outState);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
mMapView.onDestroy();
|
||||
mapView.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLowMemory() {
|
||||
super.onLowMemory();
|
||||
mMapView.onLowMemory();
|
||||
mapView.onLowMemory();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -151,5 +155,4 @@ public class InfoWindowAdapterActivity extends AppCompatActivity {
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,114 +0,0 @@
|
||||
package com.mapbox.mapboxsdk.testapp.activity;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v7.app.ActionBar;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.view.MenuItem;
|
||||
|
||||
import com.mapbox.mapboxsdk.annotations.MarkerOptions;
|
||||
import com.mapbox.mapboxsdk.geometry.LatLng;
|
||||
import com.mapbox.mapboxsdk.maps.MapView;
|
||||
import com.mapbox.mapboxsdk.maps.MapboxMap;
|
||||
import com.mapbox.mapboxsdk.maps.OnMapReadyCallback;
|
||||
import com.mapbox.mapboxsdk.testapp.R;
|
||||
import com.mapbox.mapboxsdk.testapp.utils.ApiAccess;
|
||||
|
||||
public class InfoWindowConcurrentActivity extends AppCompatActivity {
|
||||
|
||||
private MapView mMapView;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_infowindow_concurrent);
|
||||
|
||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
if (actionBar != null) {
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
actionBar.setDisplayShowHomeEnabled(true);
|
||||
}
|
||||
|
||||
mMapView = (MapView) findViewById(R.id.infoWindowConcurrentMapView);
|
||||
mMapView.setAccessToken(ApiAccess.getToken(this));
|
||||
mMapView.onCreate(savedInstanceState);
|
||||
mMapView.getMapAsync(new OnMapReadyCallback() {
|
||||
@Override
|
||||
public void onMapReady(@NonNull MapboxMap mapboxMap) {
|
||||
mapboxMap.setAllowConcurrentMultipleOpenInfoWindows(true);
|
||||
|
||||
mapboxMap.addMarker(new MarkerOptions()
|
||||
.title("Intersection")
|
||||
.snippet("H St NW with 15th St NW")
|
||||
.position(new LatLng(38.9002073, -77.03364419)));
|
||||
|
||||
mapboxMap.addMarker(new MarkerOptions()
|
||||
.title("White House")
|
||||
.snippet("The official residence and principal workplace of the President of the United States, located at 1600 Pennsylvania Avenue NW in Washington, D.C. It has been the residence of every U.S. president since John Adams in 1800.")
|
||||
.position(new LatLng(38.897705003219784, -77.03655168667463)));
|
||||
|
||||
mapboxMap.addMarker(new MarkerOptions().title("Intersection")
|
||||
.snippet("E St NW with 17th St NW")
|
||||
.position(new LatLng(38.8954236, -77.0394623)));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
mMapView.onStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
mMapView.onResume();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
mMapView.onPause();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
mMapView.onStop();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onSaveInstanceState(Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
mMapView.onSaveInstanceState(outState);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
mMapView.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLowMemory() {
|
||||
super.onLowMemory();
|
||||
mMapView.onLowMemory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case android.R.id.home:
|
||||
onBackPressed();
|
||||
return true;
|
||||
default:
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<group android:checkableBehavior="all">
|
||||
<item
|
||||
android:title="@string/menuitem_title_concurrent_infowindow"
|
||||
android:id="@+id/action_toggle_concurrent_infowindow"
|
||||
app:showAsAction="never"
|
||||
android:checkable="true"/>
|
||||
</group>
|
||||
|
||||
</menu>
|
||||
@@ -6,14 +6,13 @@
|
||||
<!-- Test Activities -->
|
||||
<string name="activity_mapboxmap">MapboxMap Activity</string>
|
||||
<string name="activity_tilt">Map Tilt Activity</string>
|
||||
<string name="activity_infowindow_adapter">InfoWindow Adapter Activity</string>
|
||||
<string name="activity_map_fragment_suport">Support Map Fragment Activity</string>
|
||||
<string name="activity_map_fragment">Map Fragment Activity</string>
|
||||
<string name="activity_press_for_marker">Press For Marker Activity</string>
|
||||
<string name="activity_marker_in_bulk">Add Bulk Markers Activity</string>
|
||||
<string name="activity_manual_zoom">Manual Zoom Activity</string>
|
||||
<string name="activity_info_window">InfoWindow Activity</string>
|
||||
<string name="activity_info_window_concurrent">InfoWindow Activity (Concurrent) Activity</string>
|
||||
<string name="activity_info_window">Basic InfoWindow example</string>
|
||||
<string name="activity_infowindow_adapter">Custom InfoWindow Adapter</string>
|
||||
<string name="activity_visible_coordinate_bounds">Visible Coordinate Bounds Activity</string>
|
||||
<string name="activity_user_tracking_mode">User tracking mode Activity</string>
|
||||
<string name="activity_add_bulk_markers">Add Markers In Bulk Activity</string>
|
||||
@@ -34,14 +33,14 @@
|
||||
<string name="description_user_location_tracking">Tracks the location of the user</string>
|
||||
<string name="description_custom_layer">Add a custom layer, experimental feature</string>
|
||||
<string name="description_mapboxmap">Test out MapboxMap interaction</string>
|
||||
<string name="description_info_window_adapter">Learn how to craete custom InfoWindows</string>
|
||||
<string name="description_info_window_adapter">Learn how to create a custom InfoWindow</string>
|
||||
<string name="description_tilt">Showcasing Tilt</string>
|
||||
<string name="description_map_fragment">Showcase MapFragment</string>
|
||||
<string name="description_map_fragment_support">Showcase SupportMapFragment</string>
|
||||
<string name="description_press_for_marker">Add marker on long press</string>
|
||||
<string name="description_manual_zoom">Different types of zoom in CameraUpdateFactory</string>
|
||||
<string name="description_minmax_zoom">Configure a max and min zoomlevel</string>
|
||||
<string name="description_info_window">Example with an InfoWindow</string>
|
||||
<string name="description_info_window">Learn how to handle the basic InfoWindow</string>
|
||||
<string name="description_animate_coordinate_change">Animate Coordinate Change</string>
|
||||
<string name="description_info_window_concurrent">InfoWindow example with multiple open</string>
|
||||
<string name="description_add_bulk_markers">Example which adds Markers in bulk</string>
|
||||
@@ -57,6 +56,8 @@
|
||||
<string name="description_geocoder">Example with Geocoder API</string>
|
||||
<string name="description_scroll_by">Example to scroll with pixels in x,y direction</string>
|
||||
|
||||
<string name="menuitem_title_concurrent_infowindow">Concurrent Open InfoWindows</string>
|
||||
|
||||
<string name="category_marker">Marker</string>
|
||||
<string name="category_infowindow">InfoWindow</string>
|
||||
<string name="category_camera">Camera</string>
|
||||
|
||||
Reference in New Issue
Block a user