Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
Disabled activities in TestApp
Browse files Browse the repository at this point in the history
  • Loading branch information
tobrun committed Jan 8, 2016
1 parent b6fca67 commit 0dcc5b3
Show file tree
Hide file tree
Showing 39 changed files with 2,679 additions and 2,515 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

import com.mapbox.mapboxsdk.utils.ApiAccess;
import com.mapbox.mapboxsdk.views.MapView;
import com.mapbox.mapboxsdk.views.MapboxMap;
import com.mapbox.mapboxsdk.views.OnMapReadyCallback;

public class MapFragment extends Fragment {

Expand All @@ -26,6 +28,8 @@ public class MapFragment extends Fragment {
// The map
private MapView mMap;

private OnMapReadyCallback mMapReadyCallback;

//
// Lifecycle events
//
Expand All @@ -45,6 +49,10 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
// Need to pass on any saved state to the map
mMap.onCreate(savedInstanceState);

if(mMapReadyCallback!=null){
mMapReadyCallback.onMapReady(new MapboxMap(mMap));
}

// Return the map as the root view
return mMap;
}
Expand Down Expand Up @@ -122,8 +130,20 @@ public void onLowMemory() {
//
// Property methods
//

/**
* @deprecated in favor of
*/
@Deprecated

This comment has been minimized.

Copy link
@bleege

bleege Jan 8, 2016

Contributor

This will be a new semver accurate release of the SDK, so let's just remove getMap() instead of Deprecate.

public MapView getMap() {
return mMap;
}

public void getMapAsync(OnMapReadyCallback callback){
if(mMap!=null){
callback.onMapReady(new MapboxMap(mMap));
}else {
mMapReadyCallback = callback;
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ public void setMapView(MapView mapView) {
}

protected MapView getMapView() {
if (mapView == null) {

This comment has been minimized.

Copy link
@bleege

bleege Jan 8, 2016

Contributor

We'll need to test the removal of this thoroughly to see if the underlying condition no longer causes a crash.

return null;
}
return mapView;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.mapbox.mapboxsdk.R;
import com.mapbox.mapboxsdk.geometry.LatLng;
import com.mapbox.mapboxsdk.views.MapView;
import com.mapbox.mapboxsdk.views.MapboxMap;

import java.lang.ref.WeakReference;

Expand Down Expand Up @@ -61,7 +62,7 @@ private void initialize(View view, MapView mapView) {
public boolean onTouch(View v, MotionEvent e) {
if (e.getAction() == MotionEvent.ACTION_UP) {
boolean handledDefaultClick = false;
MapView.OnInfoWindowClickListener onInfoWindowClickListener =
MapboxMap.OnInfoWindowClickListener onInfoWindowClickListener =
mMapView.get().getOnInfoWindowClickListener();
if (onInfoWindowClickListener != null) {
handledDefaultClick = onInfoWindowClickListener.onMarkerClick(getBoundMarker());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.mapbox.mapboxsdk.R;
import com.mapbox.mapboxsdk.geometry.LatLng;
import com.mapbox.mapboxsdk.views.MapView;
import com.mapbox.mapboxsdk.views.MapboxMap;

/**
* A marker is a map overlay that shows an icon image at a specific
Expand Down Expand Up @@ -89,7 +90,7 @@ public InfoWindow showInfoWindow() {
return null;
}

MapView.InfoWindowAdapter infoWindowAdapter = getMapView().getInfoWindowAdapter();
MapboxMap.InfoWindowAdapter infoWindowAdapter = getMapView().getInfoWindowAdapter();
if (infoWindowAdapter != null) {
// end developer is using a custom InfoWindowAdapter
View content = infoWindowAdapter.getInfoWindow(this);
Expand Down
Loading

0 comments on commit 0dcc5b3

Please sign in to comment.