diff --git a/MyTracks/AndroidManifest.xml b/MyTracks/AndroidManifest.xml index d5db6c6ff..617d351e4 100755 --- a/MyTracks/AndroidManifest.xml +++ b/MyTracks/AndroidManifest.xml @@ -16,7 +16,7 @@ limitations under the License. --> diff --git a/MyTracks/src/com/google/android/apps/mytracks/MapOverlay.java b/MyTracks/src/com/google/android/apps/mytracks/MapOverlay.java index 36bc3d927..cd7fb8597 100644 --- a/MyTracks/src/com/google/android/apps/mytracks/MapOverlay.java +++ b/MyTracks/src/com/google/android/apps/mytracks/MapOverlay.java @@ -25,10 +25,9 @@ import com.google.android.apps.mytracks.util.LocationUtils; import com.google.android.apps.mytracks.util.PreferencesUtils; import com.google.android.apps.mytracks.util.UnitConversions; import com.google.android.gms.maps.GoogleMap; -import com.google.android.gms.maps.model.BitmapDescriptors; +import com.google.android.gms.maps.model.BitmapDescriptorFactory; import com.google.android.gms.maps.model.LatLng; -import com.google.android.gms.maps.model.Marker; -import com.google.android.gms.maps.model.Model; +import com.google.android.gms.maps.model.MarkerOptions; import com.google.android.gms.maps.model.Polyline; import com.google.android.maps.mytracks.R; @@ -242,10 +241,10 @@ public class MapOverlay { for (int i = locations.size() - 1; i >= 0; i--) { CachedLocation cachedLocation = locations.get(i); if (cachedLocation.valid) { - Marker.Options options = Model.newMarkerOptions().position(cachedLocation.getLatLng()) + MarkerOptions markerOptions = new MarkerOptions().position(cachedLocation.getLatLng()) .anchor(MARKER_X_ANCHOR, MARKER_Y_ANCHOR).draggable(false).visible(true) - .icon(BitmapDescriptors.fromResource(R.drawable.red_dot)); - googleMap.addMarker(options); + .icon(BitmapDescriptorFactory.fromResource(R.drawable.red_dot)); + googleMap.addMarker(markerOptions); break; } } @@ -255,10 +254,10 @@ public class MapOverlay { for (int i = 0; i < locations.size(); i++) { CachedLocation cachedLocation = locations.get(i); if (cachedLocation.valid) { - Marker.Options options = Model.newMarkerOptions().position(cachedLocation.getLatLng()) + MarkerOptions markerOptions = new MarkerOptions().position(cachedLocation.getLatLng()) .anchor(MARKER_X_ANCHOR, MARKER_Y_ANCHOR).draggable(false).visible(true) - .icon(BitmapDescriptors.fromResource(R.drawable.green_dot)); - googleMap.addMarker(options); + .icon(BitmapDescriptorFactory.fromResource(R.drawable.green_dot)); + googleMap.addMarker(markerOptions); break; } } @@ -276,11 +275,11 @@ public class MapOverlay { LatLng latLng = new LatLng(location.getLatitude(), location.getLongitude()); int drawableId = waypoint.getType() == Waypoint.TYPE_STATISTICS ? R.drawable.yellow_pushpin : R.drawable.blue_pushpin; - Marker.Options options = Model.newMarkerOptions().position(latLng) + MarkerOptions markerOptions = new MarkerOptions().position(latLng) .anchor(WAYPOINT_X_ANCHOR, WAYPOINT_Y_ANCHOR).draggable(false).visible(true) - .icon(BitmapDescriptors.fromResource(drawableId)) + .icon(BitmapDescriptorFactory.fromResource(drawableId)) .title(String.valueOf(waypoint.getId())); - googleMap.addMarker(options); + googleMap.addMarker(markerOptions); } } } diff --git a/MyTracks/src/com/google/android/apps/mytracks/fragments/MyTracksMapFragment.java b/MyTracks/src/com/google/android/apps/mytracks/fragments/MyTracksMapFragment.java index 6f4ea1eac..5b8760faa 100644 --- a/MyTracks/src/com/google/android/apps/mytracks/fragments/MyTracksMapFragment.java +++ b/MyTracks/src/com/google/android/apps/mytracks/fragments/MyTracksMapFragment.java @@ -32,17 +32,17 @@ import com.google.android.apps.mytracks.util.GoogleLocationUtils; import com.google.android.apps.mytracks.util.IntentUtils; import com.google.android.apps.mytracks.util.LocationUtils; import com.google.android.gms.maps.CameraUpdate; -import com.google.android.gms.maps.CameraUpdates; +import com.google.android.gms.maps.CameraUpdateFactory; import com.google.android.gms.maps.GoogleMap; +import com.google.android.gms.maps.GoogleMap.OnCameraChangeListener; +import com.google.android.gms.maps.GoogleMap.OnMarkerClickListener; import com.google.android.gms.maps.LocationSource; import com.google.android.gms.maps.LocationSource.OnLocationChangedListener; -import com.google.android.gms.maps.OnMapInitializeListener; import com.google.android.gms.maps.SupportMapFragment; import com.google.android.gms.maps.model.CameraPosition; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.LatLngBounds; import com.google.android.gms.maps.model.Marker; -import com.google.android.gms.maps.model.Model; import com.google.android.gms.maps.model.Polyline; import com.google.android.maps.mytracks.R; @@ -72,8 +72,7 @@ import java.util.EnumSet; * @author Leif Hendrik Wilden * @author Rodrigo Damazio */ -public class MyTracksMapFragment extends SupportMapFragment - implements OnMapInitializeListener, TrackDataListener { +public class MyTracksMapFragment extends SupportMapFragment implements TrackDataListener { public static final String MAP_FRAGMENT_TAG = "mapFragment"; @@ -127,7 +126,6 @@ public class MyTracksMapFragment extends SupportMapFragment setHasOptionsMenu(true); ApiAdapterFactory.getApiAdapter().invalidMenu(getActivity()); mapOverlay = new MapOverlay(getActivity()); - setOnMapInitializeListener(this); } @Override @@ -149,11 +147,12 @@ public class MyTracksMapFragment extends SupportMapFragment } }); messageTextView = (TextView) layout.findViewById(R.id.map_message); + + onMapInitialize(getMap()); return layout; } - @Override - public void onMapInitialize(GoogleMap map) { + private void onMapInitialize(GoogleMap map) { googleMap = map; googleMap.setMyLocationEnabled(true); googleMap.getUiSettings().setMyLocationButtonEnabled(false); @@ -198,13 +197,8 @@ public class MyTracksMapFragment extends SupportMapFragment } } }); - LatLng latLng = getDefaultLatLng(); - if (latLng != null) { - googleMap.moveCamera(CameraUpdates.newLatLngZoom(latLng, googleMap.getMinZoomLevel())); - } - if (isResumed()) { - resetTrackDataHub(); - } + googleMap.moveCamera( + CameraUpdateFactory.newLatLngZoom(getDefaultLatLng(), googleMap.getMinZoomLevel())); } @Override @@ -271,16 +265,16 @@ public class MyTracksMapFragment extends SupportMapFragment @Override public boolean onOptionsItemSelected(MenuItem menuItem) { - int type = MAP_TYPE_NORMAL; + int type = GoogleMap.MAP_TYPE_NORMAL; switch (menuItem.getItemId()) { case R.id.menu_map: - type = MAP_TYPE_NORMAL; + type = GoogleMap.MAP_TYPE_NORMAL; break; case R.id.menu_satellite: - type = MAP_TYPE_SATELLITE; + type = GoogleMap.MAP_TYPE_SATELLITE; break; case R.id.menu_terrain: - type = MAP_TYPE_TERRAIN; + type = GoogleMap.MAP_TYPE_TERRAIN; break; default: return super.onOptionsItemSelected(menuItem); @@ -522,15 +516,6 @@ public class MyTracksMapFragment extends SupportMapFragment trackDataHub = null; } - /** - * Resets the trackDataHub. Needs to be synchronized because the trackDataHub - * can be accessed by multiple threads. - */ - private synchronized void resetTrackDataHub() { - pauseTrackDataHub(); - resumeTrackDataHub(); - } - /** * Returns true if the selected track is recording. Needs to be synchronized * because the trackDataHub can be accessed by multiple threads. @@ -563,7 +548,7 @@ public class MyTracksMapFragment extends SupportMapFragment if (zoomToCurrentLocation || (keepCurrentLocationVisible && !isLocationVisible(currentLocation))) { LatLng latLng = new LatLng(currentLocation.getLatitude(), currentLocation.getLongitude()); - googleMap.animateCamera(CameraUpdates.newLatLngZoom(latLng, DEFAULT_ZOOM_LEVEL)); + googleMap.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng, DEFAULT_ZOOM_LEVEL)); zoomToCurrentLocation = false; } }; @@ -595,8 +580,9 @@ public class MyTracksMapFragment extends SupportMapFragment tripStatistics.getBottomDegrees(), tripStatistics.getLeftDegrees()); LatLng northEast = new LatLng( tripStatistics.getTopDegrees(), tripStatistics.getRightDegrees()); - LatLngBounds bounds = Model.newLatLngBounds(southWest, northEast); - CameraUpdate cameraUpdate = CameraUpdates.newLatLngBounds( + LatLngBounds bounds = LatLngBounds.builder() + .include(southWest).include(northEast).build(); + CameraUpdate cameraUpdate = CameraUpdateFactory.newLatLngBounds( bounds, mapView.getWidth(), mapView.getHeight(), MAP_VIEW_PADDING); googleMap.moveCamera(cameraUpdate); } @@ -623,7 +609,7 @@ public class MyTracksMapFragment extends SupportMapFragment LatLng latLng = new LatLng(location.getLatitude(), location.getLongitude()); keepCurrentLocationVisible = false; zoomToCurrentLocation = false; - CameraUpdate cameraUpdate = CameraUpdates.newLatLngZoom(latLng, DEFAULT_ZOOM_LEVEL); + CameraUpdate cameraUpdate = CameraUpdateFactory.newLatLngZoom(latLng, DEFAULT_ZOOM_LEVEL); googleMap.moveCamera(cameraUpdate); } } @@ -653,6 +639,6 @@ public class MyTracksMapFragment extends SupportMapFragment return false; } LatLng latLng = new LatLng(location.getLatitude(), location.getLongitude()); - return googleMap.getProjection().getVisibleRegion().getLatLngBounds().contains(latLng); + return googleMap.getProjection().getVisibleRegion().latLngBounds.contains(latLng); } } \ No newline at end of file diff --git a/MyTracks/src/com/google/android/apps/mytracks/maps/TrackPathUtils.java b/MyTracks/src/com/google/android/apps/mytracks/maps/TrackPathUtils.java index 1818a2262..3c74385ee 100644 --- a/MyTracks/src/com/google/android/apps/mytracks/maps/TrackPathUtils.java +++ b/MyTracks/src/com/google/android/apps/mytracks/maps/TrackPathUtils.java @@ -18,8 +18,8 @@ package com.google.android.apps.mytracks.maps; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.model.LatLng; -import com.google.android.gms.maps.model.Model; import com.google.android.gms.maps.model.Polyline; +import com.google.android.gms.maps.model.PolylineOptions; import java.util.ArrayList; @@ -54,9 +54,8 @@ public class TrackPathUtils { pathPoints.addAll(points); lastPolyline.setPoints(pathPoints); } else { - Polyline.Options options = Model.newPolylineOptions() - .addAll(points).width(5).color(color); - Polyline polyline = googleMap.addPolyline(options); + PolylineOptions polylineOptions = new PolylineOptions().addAll(points).width(5).color(color); + Polyline polyline = googleMap.addPolyline(polylineOptions); paths.add(polyline); } points.clear(); diff --git a/google_play_services_lib/AndroidManifest.xml b/google_play_services_lib/AndroidManifest.xml index 5a6bc5dc7..1b655ac79 100755 --- a/google_play_services_lib/AndroidManifest.xml +++ b/google_play_services_lib/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="2002110" + android:versionName="2.0.02 (521584-10)" > diff --git a/google_play_services_lib/libs/google-play-services.jar b/google_play_services_lib/libs/google-play-services.jar index 9c39e3ab3..6bb7f3357 100644 Binary files a/google_play_services_lib/libs/google-play-services.jar and b/google_play_services_lib/libs/google-play-services.jar differ diff --git a/google_play_services_lib/res/values/strings.xml b/google_play_services_lib/res/values/strings.xml index 5bb77e14a..2ab9a03bf 100644 --- a/google_play_services_lib/res/values/strings.xml +++ b/google_play_services_lib/res/values/strings.xml @@ -41,6 +41,11 @@ This app won\'t run unless you update Google Play services. + + Unknown issue with Google Play + services. + Update