Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'release/1.0.1'

  • Loading branch information...
commit fffe1d62ed530ec989f8c912ea0bd4720add9c60 2 parents a3a4c1d + 69d2d79
Cyril Mottier authored
View
9 CHANGELOG.md
@@ -1,7 +1,14 @@
Change Log
==========
-Version 1.0 *(2012-09-28)*
+Version 1.0.1 *(2012-10-28)*
+--------------------------
+
+- General code and Javadoc cleanup
+- Fix: Ensure all annotations are correctly displayed when using custom `Overlay`s
+- Fix: Dismiss the visible callout when setting new `Annotation`s
+
+Version 1.0 *(2012-10-12)*
--------------------------
Initial release.
View
2  library/src/com/cyrilmottier/polaris/Annotation.java
@@ -56,7 +56,7 @@ public Annotation(GeoPoint point, String title, String snippet) {
* @param title Title text for this annotation
* @param snippet Snippet text for this annotation
* @param marker Drawable used as this {@link Annotation}'s marker (please
- * note this marker must have its bounds already set. You canuse
+ * note this marker must have its bounds already set. You can use
* the {@link MapViewUtils#boundMarker(Drawable, int)} utility
* method to prepare this {@link Drawable}'s bounds)
*/
View
4 library/src/com/cyrilmottier/polaris/CoordinateRegion.java
@@ -74,7 +74,7 @@ public CoordinateRegion(int latitude, int longitude, int latitudeSpan, int longi
* Create a new region, initialized with the values in the specified region
* (which is left unmodified).
*
- * @param r The region whose coordinates are copied into this region.
+ * @param region The region whose coordinates are copied into this region.
*/
public CoordinateRegion(CoordinateRegion region) {
this.latitude = region.latitude;
@@ -140,7 +140,7 @@ public void set(int latitude, int longitude, int latitudeSpan, int longitudeSpan
/**
* Copy the coordinates into this {@link CoordinateRegion}.
*
- * @param src The region whose coordinates are copied into this region
+ * @param region The region whose coordinates are copied into this region
*/
public void set(CoordinateRegion region) {
latitude = region.latitude;
View
35 library/src/com/cyrilmottier/polaris/MapCalloutView.java
@@ -31,7 +31,6 @@
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.FrameLayout;
-import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
@@ -123,7 +122,7 @@ private void init(Context context) {
mTitle = (TextView) findViewById(R.id.polaris__title);
mSubtitle = (TextView) findViewById(R.id.polaris__subtitle);
- mDisclosure = (ImageView) findViewById(R.id.polaris__disclosure);
+ mDisclosure = findViewById(R.id.polaris__disclosure);
mContentContainer = (FrameLayout) findViewById(R.id.polaris__content_container);
mContent = findViewById(R.id.polaris__content);
}
@@ -307,7 +306,7 @@ public void dismiss(boolean animated) {
}
/**
- * Set a new lister to listen to double tap events.
+ * Set a new listener to listen to double tap events.
*
* @param l The listener to set
*/
@@ -316,10 +315,10 @@ public void setOnDoubleTapListener(OnDoubleTapListener l) {
}
/**
- * Set the title of the {@link MapViewCallout}. The {@link MapViewCallout}
+ * Set the title of the {@link MapCalloutView}. The {@link MapCalloutView}
* automatically manages empty (null or zero-length) title.
*
- * @param title The title to apply to this {@link MapViewCallout}
+ * @param title The title to apply to this {@link MapCalloutView}
*/
public void setTitle(CharSequence title) {
if (!TextUtils.isEmpty(title)) {
@@ -331,11 +330,11 @@ public void setTitle(CharSequence title) {
}
/**
- * Set the subtitle of the {@link MapViewCallout}. The
- * {@link MapViewCallout} automatically manages empty (null or zero-length)
+ * Set the subtitle of the {@link MapCalloutView}. The
+ * {@link MapCalloutView} automatically manages empty (null or zero-length)
* subtitle.
*
- * @param subtitle The subtitle to apply to this {@link MapViewCallout}
+ * @param subtitle The subtitle to apply to this {@link MapCalloutView}
*/
public void setSubtitle(CharSequence subtitle) {
if (!TextUtils.isEmpty(subtitle)) {
@@ -373,7 +372,7 @@ public boolean isDisclosureEnabled() {
/**
* Enable or disable the disclosure indicator. Put simple, the disclosure
- * indicator should always be visible when the {@link MapViewCallout} is
+ * indicator should always be visible when the {@link MapCalloutView} is
* clickable i.e. when an action such as "opening" a details screen is done
* on click.
*
@@ -400,7 +399,7 @@ public View getRightAccessoryView() {
}
/**
- * Set a new right accessory view to this {@link MapViewCallout}. The newly
+ * Set a new right accessory view to this {@link MapCalloutView}. The newly
* added view will remove the previous one. Setting
* {@link android.view.ViewGroup.LayoutParams} to the given right accessory
* is not necessary as they will be automatically set to (
@@ -455,14 +454,14 @@ public View getLeftAccessoryView() {
}
/**
- * Set a new left accessory view to this {@link MapViewCallout}. The newly
+ * Set a new left accessory view to this {@link MapCalloutView}. The newly
* added view will remove the previous one. Setting
* {@link android.view.ViewGroup.LayoutParams} to the given left accessory
* is not necessary as they will be automatically set to (
* {@link android.view.ViewGroup.LayoutParams#WRAP_CONTENT},
* {@link android.view.ViewGroup.LayoutParams#WRAP_CONTENT}).
*
- * @param rightAccessoryView The new left accessory view.
+ * @param leftAccessoryView The new left accessory view.
*/
public void setLeftAccessoryView(View leftAccessoryView) {
if (leftAccessoryView != null && leftAccessoryView.getParent() != null) {
@@ -500,15 +499,15 @@ public View getCustomView() {
}
/**
- * Set a new custom view to this {@link MapViewCallout}. The newly added
+ * Set a new custom view to this {@link MapCalloutView}. The newly added
* view will remove the previous one. Custom views are usually used to
- * completely manage the content of the {@link MapViewCallout}. Setting
+ * completely manage the content of the {@link MapCalloutView}. Setting
* {@link android.view.ViewGroup.LayoutParams} to the given left accessory
* is not necessary as they will be automatically set to (
* {@link android.view.ViewGroup.LayoutParams#WRAP_CONTENT},
* {@link android.view.ViewGroup.LayoutParams#WRAP_CONTENT}).
*
- * @param rightAccessoryView The new left accessory view.
+ * @param customView The new custom view.
*/
public void setCustomView(View customView) {
if (customView != null && customView.getParent() != null) {
@@ -534,7 +533,7 @@ public void setCustomView(View customView) {
}
/**
- * Indicates whether this {@link MapViewCallout} has some displayable
+ * Indicates whether this {@link MapCalloutView} has some displayable
* content. The result of this method is used as a hint to know whether or
* not the callout should be displayed once an {@link Annotation} has been
* applied to it.
@@ -679,7 +678,7 @@ public void onUp(MotionEvent e) {
public void onLongPress(MotionEvent e) {
mHasLongPressed = true;
- };
+ }
@Override
public boolean onDoubleTap(MotionEvent e) {
@@ -688,5 +687,5 @@ public boolean onDoubleTap(MotionEvent e) {
}
return true;
}
- };
+ }
}
View
2  library/src/com/cyrilmottier/polaris/MapViewUtils.java
@@ -82,7 +82,7 @@ public static void smoothCenterOnUserLocation(MapView mapView, MyLocationOverlay
* @param mapView The {@link MapView} to animate
* @param myLocationOverlay The {@link MyLocationOverlay} whose location
* will be used to determine the user location.
- * @param errorMessageId The message to display in case no location is
+ * @param errorMessage The message to display in case no location is
* available.
*/
public static void smoothCenterOnUserLocation(MapView mapView, MyLocationOverlay myLocationOverlay, String errorMessage) {
View
11 library/src/com/cyrilmottier/polaris/PolarisMapView.java
@@ -90,7 +90,7 @@
* <p>Most (or should I say all) map-based applications uses 9-patches as map callout background.
* While 9-patches are great in most cases, it doesn't allow variable stretching of stretchable areas.
* In general, the Polaris library contains default resources and more specifically
- * {@link MapViewCallout}. {@link MapViewCallout} allows variable positioning of the anchor. This
+ * {@link MapCalloutView}. {@link MapCalloutView} allows variable positioning of the anchor. This
* improvement is largely used by the Polaris library to get a more polished map. While most
* applications center the map on the tapped {@link OverlayItem}, {@link PolarisMapView} shows a
* map callout trying to reduce scrolling as much as possible. The map is actually scrolled only there
@@ -490,7 +490,7 @@ public void setOnRegionChangedListenerListener(OnRegionChangedListener listener)
/**
* Set a new {@link OnMapViewLongClickListener}.
*
- * @param listener The new {@link OnMapViewLongClickListener}
+ * @param l The new {@link OnMapViewLongClickListener}
*/
public void setOnMapViewLongClickListener(OnMapViewLongClickListener l) {
mOnMapViewLongClickListener = l;
@@ -609,6 +609,11 @@ public void setAnnotations(List<Annotation> annotations, int annotationMarkerId)
* @param annotationMarker The default marker
*/
public void setAnnotations(List<Annotation> annotations, Drawable annotationMarker) {
+ // Remove opened callouts before inserting annotations
+ if (mAnnotationsOverlay != null) {
+ mAnnotationsOverlay.setSelectedAnnotation(INVALID_POSITION);
+ }
+
if (annotations == null) {
mOverlayContainer.setAnnotationsOverlay(null);
} else {
@@ -811,7 +816,7 @@ public void showCallout(int position) {
private final MagnetoCallback mMagnetoCallback = new MagnetoCallback() {
@Override
- public void onSinpleTap(MotionEvent e) {
+ public void onSimpleTap(MotionEvent e) {
setSelectedAnnotation(INVALID_POSITION);
}
View
12 library/src/com/cyrilmottier/polaris/internal/OverlayContainer.java
@@ -39,7 +39,7 @@
* @author Cyril Mottier
*/
public interface MagnetoCallback {
- void onSinpleTap(MotionEvent e);
+ void onSimpleTap(MotionEvent e);
void onDoubleTap(MotionEvent e);
@@ -63,7 +63,7 @@ public Overlay get(int index) {
break;
case 1:
- if (hasAnnotationsOverlay) {
+ if (hasLocationOverlay && hasAnnotationsOverlay) {
return mAnnotationsOverlay;
}
break;
@@ -78,7 +78,7 @@ public Overlay get(int index) {
}
return super.get(reindex);
- };
+ }
@Override
public int size() {
@@ -90,7 +90,7 @@ public int size() {
size++;
}
return size;
- };
+ }
};
private final GestureDetector mGestureDetector;
@@ -226,14 +226,14 @@ public int indexOfOverlay(Overlay overlay) {
@Override
public boolean onSingleTapConfirmed(MotionEvent e) {
if (!mIsTapConsumedPerChildren) {
- mCallback.onSinpleTap(e);
+ mCallback.onSimpleTap(e);
}
return true;
}
public void onLongPress(MotionEvent e) {
mCallback.onLongPress(e);
- };
+ }
@Override
public boolean onDoubleTap(MotionEvent e) {
Please sign in to comment.
Something went wrong with that request. Please try again.