code stringlengths 23 201k | docstring stringlengths 17 96.2k | func_name stringlengths 0 235 | language stringclasses 1
value | repo stringlengths 8 72 | path stringlengths 11 317 | url stringlengths 57 377 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
public void set(CoordinateRegion region) {
latitude = region.latitude;
longitude = region.longitude;
latitudeSpan = region.latitudeSpan;
longitudeSpan = region.longitudeSpan;
} | Copy the coordinates into this {@link CoordinateRegion}.
@param region The region whose coordinates are copied into this region | set | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/CoordinateRegion.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/CoordinateRegion.java | Apache-2.0 |
public boolean isEmpty() {
return latitudeSpan <= 0 || longitudeSpan <= 0;
} | Returns true if the region defined by this {@link CoordinateRegion} is
empty i.e. if at least one of the span values is <= 0.
@return true if this region is empty | isEmpty | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/CoordinateRegion.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/CoordinateRegion.java | Apache-2.0 |
@Override
public void draw(Canvas canvas) {
if (mNeedBoundsUpdate) {
updateBounds();
mNeedBoundsUpdate = false;
}
mLeftCapDrawable.draw(canvas);
mBottomAnchorDrawable.draw(canvas);
mRightCapDrawable.draw(canvas);
} | Create a new {@link MapCalloutDrawable} whose anchor is placed in the
middle just like a regular 9-patch would do.
@param context The Context in which this {@link MapCalloutDrawable} will
be used. | draw | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutDrawable.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutDrawable.java | Apache-2.0 |
@Override
public void setAlpha(int alpha) {
mLeftCapDrawable.setAlpha(alpha);
mBottomAnchorDrawable.setAlpha(alpha);
mRightCapDrawable.setAlpha(alpha);
invalidateSelf();
} | Create a new {@link MapCalloutDrawable} whose anchor is placed in the
middle just like a regular 9-patch would do.
@param context The Context in which this {@link MapCalloutDrawable} will
be used. | setAlpha | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutDrawable.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutDrawable.java | Apache-2.0 |
@Override
public void setColorFilter(ColorFilter cf) {
mLeftCapDrawable.setColorFilter(cf);
mBottomAnchorDrawable.setColorFilter(cf);
mRightCapDrawable.setColorFilter(cf);
invalidateSelf();
} | Create a new {@link MapCalloutDrawable} whose anchor is placed in the
middle just like a regular 9-patch would do.
@param context The Context in which this {@link MapCalloutDrawable} will
be used. | setColorFilter | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutDrawable.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutDrawable.java | Apache-2.0 |
@Override
public int getOpacity() {
return Drawable.resolveOpacity(mLeftCapDrawable.getOpacity(),
Drawable.resolveOpacity(mBottomAnchorDrawable.getOpacity(), mRightCapDrawable.getOpacity()));
} | Create a new {@link MapCalloutDrawable} whose anchor is placed in the
middle just like a regular 9-patch would do.
@param context The Context in which this {@link MapCalloutDrawable} will
be used. | getOpacity | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutDrawable.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutDrawable.java | Apache-2.0 |
@Override
public Drawable mutate() {
if (!mMutated && super.mutate() == this) {
mLeftCapDrawable.mutate();
mBottomAnchorDrawable.mutate();
mRightCapDrawable.mutate();
mMutated = true;
}
return this;
} | Create a new {@link MapCalloutDrawable} whose anchor is placed in the
middle just like a regular 9-patch would do.
@param context The Context in which this {@link MapCalloutDrawable} will
be used. | mutate | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutDrawable.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutDrawable.java | Apache-2.0 |
@Override
public boolean getPadding(Rect padding) {
// The padding for this Drawable is a composition of some of the
// paddings of the underlying Drawables.
final Rect rect = mTempRect;
mLeftCapDrawable.getPadding(rect);
int pLeft = rect.left;
mBottomAnchorDrawable... | Create a new {@link MapCalloutDrawable} whose anchor is placed in the
middle just like a regular 9-patch would do.
@param context The Context in which this {@link MapCalloutDrawable} will
be used. | getPadding | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutDrawable.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutDrawable.java | Apache-2.0 |
@Override
public boolean isStateful() {
return mLeftCapDrawable.isStateful() || mBottomAnchorDrawable.isStateful() || mRightCapDrawable.isStateful();
} | Create a new {@link MapCalloutDrawable} whose anchor is placed in the
middle just like a regular 9-patch would do.
@param context The Context in which this {@link MapCalloutDrawable} will
be used. | isStateful | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutDrawable.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutDrawable.java | Apache-2.0 |
@Override
protected boolean onStateChange(int[] state) {
boolean result = false;
result |= mLeftCapDrawable.setState(state);
result |= mBottomAnchorDrawable.setState(state);
result |= mRightCapDrawable.setState(state);
if (result) {
// It's weird but we need to in... | Create a new {@link MapCalloutDrawable} whose anchor is placed in the
middle just like a regular 9-patch would do.
@param context The Context in which this {@link MapCalloutDrawable} will
be used. | onStateChange | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutDrawable.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutDrawable.java | Apache-2.0 |
@Override
protected void onBoundsChange(Rect bounds) {
super.onBoundsChange(bounds);
mNeedBoundsUpdate = true;
} | Create a new {@link MapCalloutDrawable} whose anchor is placed in the
middle just like a regular 9-patch would do.
@param context The Context in which this {@link MapCalloutDrawable} will
be used. | onBoundsChange | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutDrawable.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutDrawable.java | Apache-2.0 |
@Override
public int getIntrinsicHeight() {
return Math.max(mLeftCapDrawable.getIntrinsicWidth(),
Math.max(mBottomAnchorDrawable.getIntrinsicHeight(), mRightCapDrawable.getIntrinsicHeight()));
} | Create a new {@link MapCalloutDrawable} whose anchor is placed in the
middle just like a regular 9-patch would do.
@param context The Context in which this {@link MapCalloutDrawable} will
be used. | getIntrinsicHeight | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutDrawable.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutDrawable.java | Apache-2.0 |
@Override
public int getIntrinsicWidth() {
//@formatter:off
return mLeftCapDrawable.getIntrinsicWidth()
+ mBottomAnchorDrawable.getIntrinsicWidth()
+ mRightCapDrawable.getIntrinsicWidth();
//@formatter:on
} | Create a new {@link MapCalloutDrawable} whose anchor is placed in the
middle just like a regular 9-patch would do.
@param context The Context in which this {@link MapCalloutDrawable} will
be used. | getIntrinsicWidth | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutDrawable.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutDrawable.java | Apache-2.0 |
@Override
public int getChangingConfigurations() {
//@formatter:off
return super.getChangingConfigurations()
| mLeftCapDrawable.getChangingConfigurations()
| mBottomAnchorDrawable.getChangingConfigurations()
| mRightCapDrawable.getChangingConfiguration... | Create a new {@link MapCalloutDrawable} whose anchor is placed in the
middle just like a regular 9-patch would do.
@param context The Context in which this {@link MapCalloutDrawable} will
be used. | getChangingConfigurations | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutDrawable.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutDrawable.java | Apache-2.0 |
private void updateBounds() {
// The anchor offset may be out of range. Let's clamp it to the
// authorized set of values.
final int anchorOffset;
switch (mAnchorOffset) {
case ANCHOR_POSITION_CENTER:
anchorOffset = getBounds().width() / 2;
br... | Create a new {@link MapCalloutDrawable} whose anchor is placed in the
middle just like a regular 9-patch would do.
@param context The Context in which this {@link MapCalloutDrawable} will
be used. | updateBounds | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutDrawable.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutDrawable.java | Apache-2.0 |
public int getLeftMargin() {
return mLeftMargin;
} | Return the left margin for this {@link MapCalloutDrawable} in pixels. The
left margin defines the minimum value of the anchor offset.
@return The left margin | getLeftMargin | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutDrawable.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutDrawable.java | Apache-2.0 |
public int getRightMargin() {
return mRightMargin;
} | Return the right margin for this {@link MapCalloutDrawable} in pixels.
The right margin defines can be used to compute the maximum value of the
anchor offset (getBounds().width() - getRightMargin()).
@return The right margin | getRightMargin | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutDrawable.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutDrawable.java | Apache-2.0 |
public void setAnchorOffset(int offset) {
mAnchorOffset = offset;
mNeedBoundsUpdate = true;
invalidateSelf();
} | Set the anchor offset in pixels i.e. the horizontal distance between the
left of this {@link Drawable} and the middle of the arrow.
@param offset The new anchor offset to set | setAnchorOffset | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutDrawable.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutDrawable.java | Apache-2.0 |
@SuppressWarnings("deprecation")
private void init(Context context) {
LayoutInflater.from(context).inflate(R.layout.polaris__map_callout_view_merge, this);
mInset = getResources().getDimensionPixelSize(R.dimen.polaris__spacing_large);
mSpacing = getResources().getDimensionPixelSize(R.dimen.... | Called when a view has been double tapped.
@param v The view that was double tapped. | init | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutView.java | Apache-2.0 |
@Override
public void setBackground(Drawable background) {
oopsBackgroundModified();
} | Called when a view has been double tapped.
@param v The view that was double tapped. | setBackground | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutView.java | Apache-2.0 |
@Override
public void setBackgroundColor(int color) {
oopsBackgroundModified();
} | Called when a view has been double tapped.
@param v The view that was double tapped. | setBackgroundColor | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutView.java | Apache-2.0 |
@Override
public void setBackgroundResource(int resid) {
oopsBackgroundModified();
} | Called when a view has been double tapped.
@param v The view that was double tapped. | setBackgroundResource | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutView.java | Apache-2.0 |
@Override
public void setBackgroundDrawable(Drawable background) {
oopsBackgroundModified();
} | Called when a view has been double tapped.
@param v The view that was double tapped. | setBackgroundDrawable | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutView.java | Apache-2.0 |
@Override
public void setOnClickListener(OnClickListener l) {
if (!isClickable()) {
setClickable(true);
}
mOnClickListener = l;
} | Called when a view has been double tapped.
@param v The view that was double tapped. | setOnClickListener | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutView.java | Apache-2.0 |
@Override
public boolean isClickable() {
return mCallout.isClickable();
} | Called when a view has been double tapped.
@param v The view that was double tapped. | isClickable | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutView.java | Apache-2.0 |
@Override
public void setClickable(boolean clickable) {
mCallout.setClickable(clickable);
} | Called when a view has been double tapped.
@param v The view that was double tapped. | setClickable | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutView.java | Apache-2.0 |
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
final int extraPadding = mInset;
final int widthCoeff = mAnchorMode == ANCHOR_MODE_VARIABLE ? 2 : 1;
final int widthSize = MeasureSpec.getSize(widthMeasureSpec) - 2 * extraPadding;
final int heightSize... | Called when a view has been double tapped.
@param v The view that was double tapped. | onMeasure | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutView.java | Apache-2.0 |
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
switch (mAnchorMode) {
case ANCHOR_MODE_VARIABLE:
layoutVariable(changed, l, t, r, b);
break;
case ANCHOR_MODE_FIXED:
default:
layoutFixed(cha... | Called when a view has been double tapped.
@param v The view that was double tapped. | onLayout | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutView.java | Apache-2.0 |
private void layoutFixed(boolean changed, int l, int t, int r, int b) {
mCallout.layout(0, 0, mCallout.getMeasuredWidth(), mCallout.getMeasuredHeight());
} | Called when a view has been double tapped.
@param v The view that was double tapped. | layoutFixed | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutView.java | Apache-2.0 |
private void layoutVariable(boolean changed, int l, int t, int r, int b) {
if (mNeedRelayout) {
if (!(getParent() instanceof MapView)) {
throw new IllegalStateException(MapCalloutView.class.getSimpleName() + " can only be used in MapView");
}
final MapView ma... | Called when a view has been double tapped.
@param v The view that was double tapped. | layoutVariable | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutView.java | Apache-2.0 |
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
mNeedRelayout = true;
} | Called when a view has been double tapped.
@param v The view that was double tapped. | onSizeChanged | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutView.java | Apache-2.0 |
public void show(MapView mapView, GeoPoint point, boolean animated) {
final int index = mapView.indexOfChild(this);
if (index == -1) {
mapView.addView(this, new MapView.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, point,
MapView.LayoutParams.BOTTOM_C... | Called when a view has been double tapped.
@param v The view that was double tapped. | show | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutView.java | Apache-2.0 |
public void dismiss(boolean animated) {
setVisibility(View.GONE);
if (animated) {
final Animation animation = AnimationUtils.loadAnimation(getContext(), R.anim.polaris__shrink_fade_out_to_bottom);
startAnimation(animation);
}
} | Called when a view has been double tapped.
@param v The view that was double tapped. | dismiss | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutView.java | Apache-2.0 |
public void setOnDoubleTapListener(OnDoubleTapListener l) {
mOnDoubleTapListener = l;
} | Set a new listener to listen to double tap events.
@param l The listener to set | setOnDoubleTapListener | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutView.java | Apache-2.0 |
public void setTitle(CharSequence title) {
if (!TextUtils.isEmpty(title)) {
mTitle.setText(title);
mTitle.setVisibility(View.VISIBLE);
} else {
mTitle.setVisibility(View.GONE);
}
} | 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 MapCalloutView} | setTitle | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutView.java | Apache-2.0 |
public void setSubtitle(CharSequence subtitle) {
if (!TextUtils.isEmpty(subtitle)) {
mSubtitle.setText(subtitle);
mSubtitle.setVisibility(View.VISIBLE);
} else {
mSubtitle.setVisibility(View.GONE);
}
} | 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 MapCalloutView} | setSubtitle | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutView.java | Apache-2.0 |
public void setData(OverlayItem item) {
setTitle(item == null ? null : item.getTitle());
setSubtitle(item == null ? null : item.getSnippet());
} | Sets the view's data from a given overlay item. Overlay's title and
snippet are respectively used as the new title and subtitle.
@param item - The overlay item containing the relevant view's data (title
and snippet). | setData | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutView.java | Apache-2.0 |
public boolean isDisclosureEnabled() {
return mIsDisclosureEnabled;
} | Indicates whether the disclosure indicator is enabled or not. Please note
an enabled disclosure indicator doesn't mean it is visible. Indeed, it
may be enabled but invisible if a non-null right accessory view has been
set.
@return true is the disclosure indicator is enabled. false otherwise
@see #setDisclosureEnabled(... | isDisclosureEnabled | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutView.java | Apache-2.0 |
public void setDisclosureEnabled(boolean enabled) {
if (mIsDisclosureEnabled != enabled) {
mIsDisclosureEnabled = enabled;
if (enabled && mRightAccessory == null) {
mDisclosure.setVisibility(View.VISIBLE);
} else {
mDisclosure.setVisibility(Vie... | Enable or disable the disclosure indicator. Put simple, the disclosure
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.
@param enabled Whether the disclosure indicator is enabled or not | setDisclosureEnabled | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutView.java | Apache-2.0 |
public View getRightAccessoryView() {
return mRightAccessory;
} | Return the right accessory view.
@return The right accessory view. | getRightAccessoryView | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutView.java | Apache-2.0 |
public void setRightAccessoryView(View rightAccessoryView) {
if (rightAccessoryView != null && rightAccessoryView.getParent() != null) {
throw new IllegalArgumentException("The given view is already attached to a parent");
}
if (mRightAccessory != rightAccessoryView) {
/... | 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 (
{@link android.view.ViewGroup.LayoutParams#WRAP_CONTENT},
{@link andr... | setRightAccessoryView | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutView.java | Apache-2.0 |
public View getLeftAccessoryView() {
return mLeftAccessory;
} | Return the left accessory view.
@return The left accessory view. | getLeftAccessoryView | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutView.java | Apache-2.0 |
public void setLeftAccessoryView(View leftAccessoryView) {
if (leftAccessoryView != null && leftAccessoryView.getParent() != null) {
throw new IllegalArgumentException("The given view is already attached to a parent");
}
if (mLeftAccessory != leftAccessoryView) {
// Remo... | 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 androi... | setLeftAccessoryView | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutView.java | Apache-2.0 |
public View getCustomView() {
return mCustomView;
} | Return the custom view.
@return The custom view or null if no custom view has been set | getCustomView | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutView.java | Apache-2.0 |
public void setCustomView(View customView) {
if (customView != null && customView.getParent() != null) {
throw new IllegalArgumentException("The given view is already attached to a parent");
}
if (mCustomView != customView) {
// Remove the previous custom view
... | 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 MapCalloutView}. Setting
{@link android.view.ViewGroup.LayoutParams} to the given left accessory
is not necessary as they will be automati... | setCustomView | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutView.java | Apache-2.0 |
public boolean hasDisplayableContent() {
if (mCustomView != null) {
return true;
}
if (mLeftAccessory != null || mRightAccessory != null) {
return true;
}
if (mTitle != null && mTitle.getVisibility() == View.VISIBLE) {
return true;
}
... | 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.
@return true if this callout has some displayable content, false
otherwise. | hasDisplayableContent | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutView.java | Apache-2.0 |
public int getMarkerHeight() {
return mMarkerHeight;
} | Defines the height of the marker i.e. the dimension in pixels the callout
will be offset from the bottom.
@return | getMarkerHeight | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutView.java | Apache-2.0 |
public void setMarkerHeight(int markerHeight) {
if (markerHeight < 0) {
markerHeight = 0;
}
if (mMarkerHeight != markerHeight) {
mMarkerHeight = markerHeight;
requestLayout();
invalidate();
}
} | Defines the height of the marker i.e. the dimension in pixels the callout
will be offset from the bottom.
@return The height (in pixels) of the pin. | setMarkerHeight | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutView.java | Apache-2.0 |
public int getAnchorMode() {
return mAnchorMode;
} | Defines the height of the marker i.e. the dimension in pixels the callout
will be offset from the bottom.
@return The height (in pixels) of the pin. | getAnchorMode | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutView.java | Apache-2.0 |
public void setAnchorMode(int anchorMode) {
switch (anchorMode) {
case ANCHOR_MODE_FIXED:
case ANCHOR_MODE_VARIABLE:
break;
default:
anchorMode = ANCHOR_MODE_FIXED;
break;
}
if (mAnchorMode != anchorMode) {
... | Defines the height of the marker i.e. the dimension in pixels the callout
will be offset from the bottom.
@return The height (in pixels) of the pin. | setAnchorMode | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutView.java | Apache-2.0 |
private void offsetToContainRect(Rect innerRect, Rect outerRect, Point outPoint) {
final int offsetLeft = Math.min(0, innerRect.left - outerRect.left);
final int offsetTop = Math.min(0, innerRect.top - outerRect.top);
final int offsetRight = Math.max(0, innerRect.right - outerRect.right);
... | Defines the height of the marker i.e. the dimension in pixels the callout
will be offset from the bottom.
@return The height (in pixels) of the pin. | offsetToContainRect | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutView.java | Apache-2.0 |
private void oopsBackgroundModified() {
throw new UnsupportedOperationException("The background of a " + MapCalloutView.class.getSimpleName() + " cannot be changed");
} | Defines the height of the marker i.e. the dimension in pixels the callout
will be offset from the bottom.
@return The height (in pixels) of the pin. | oopsBackgroundModified | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutView.java | Apache-2.0 |
@Override
public boolean onTouch(View v, MotionEvent event) {
// We want to consume MotionEvent even if the view is not clickable
// to prevent the user clicking on hidden widgets.
if (!isClickable()) {
return true;
}
if (mGestureDetec... | Defines the height of the marker i.e. the dimension in pixels the callout
will be offset from the bottom.
@return The height (in pixels) of the pin. | onTouch | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutView.java | Apache-2.0 |
@Override
public boolean onSingleTapConfirmed(MotionEvent e) {
if (mOnClickListener != null) {
mOnClickListener.onClick(MapCalloutView.this);
}
return false;
} | Defines the height of the marker i.e. the dimension in pixels the callout
will be offset from the bottom.
@return The height (in pixels) of the pin. | onSingleTapConfirmed | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutView.java | Apache-2.0 |
public void onUp(MotionEvent e) {
getDrawingRect(mRect);
if (mRect.contains((int) e.getX(), (int) e.getY()) && mHasLongPressed) {
onSingleTapConfirmed(e);
}
mHasLongPressed = false;
} | Defines the height of the marker i.e. the dimension in pixels the callout
will be offset from the bottom.
@return The height (in pixels) of the pin. | onUp | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutView.java | Apache-2.0 |
public void onLongPress(MotionEvent e) {
mHasLongPressed = true;
} | Defines the height of the marker i.e. the dimension in pixels the callout
will be offset from the bottom.
@return The height (in pixels) of the pin. | onLongPress | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutView.java | Apache-2.0 |
@Override
public boolean onDoubleTap(MotionEvent e) {
if (mOnDoubleTapListener != null) {
mOnDoubleTapListener.onDoubleTap(MapCalloutView.this);
}
return true;
} | Defines the height of the marker i.e. the dimension in pixels the callout
will be offset from the bottom.
@return The height (in pixels) of the pin. | onDoubleTap | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapCalloutView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapCalloutView.java | Apache-2.0 |
public static void smoothCenterOnUserLocation(MapView mapView, MyLocationOverlay myLocationOverlay, int errorMessageId) {
smoothCenterOnUserLocation(mapView, myLocationOverlay, mapView.getContext().getString(errorMessageId));
} | Smoothly animates the {@link MapView} so that it centers on the user
location. In case, no location is currently available, the error message
is displayed to the user via a regular Toast.
@param mapView The {@link MapView} to animate
@param myLocationOverlay The {@link MyLocationOverlay} whose location
will... | smoothCenterOnUserLocation | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapViewUtils.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapViewUtils.java | Apache-2.0 |
public static void smoothCenterOnUserLocation(MapView mapView, MyLocationOverlay myLocationOverlay, String errorMessage) {
if (myLocationOverlay == null) {
return;
}
final GeoPoint myLocation = myLocationOverlay.getMyLocation();
if (myLocation != null) {
// TODO ... | Smoothly animates the {@link MapView} so that it centers on the user
location. In case, no location is currently available, the error message
is displayed to the user via a regular Toast.
@param mapView The {@link MapView} to animate
@param myLocationOverlay The {@link MyLocationOverlay} whose location
will... | smoothCenterOnUserLocation | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapViewUtils.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapViewUtils.java | Apache-2.0 |
public static Drawable boundMarkerCenter(Drawable marker) {
return boundMarker(marker, Gravity.CENTER);
} | Adjusts a drawable's bounds so that (0,0) is the center center of the
drawable. Useful for "waypoint badge"-like graphics. For convenience,
returns the same drawable that was passed in.
@param marker The Drawable to adjust
@return The Drawable that was passed in with bounds correctly set | boundMarkerCenter | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapViewUtils.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapViewUtils.java | Apache-2.0 |
public static Drawable boundMarkerCenterBottom(Drawable marker) {
return boundMarker(marker, Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM);
} | Adjusts a drawable's bounds so that (0,0) is a pixel in the center of the
bottom row of the drawable. Useful for "pin"-like graphics. For
convenience, returns the same drawable that was passed in.
@param marker The Drawable to adjust
@return The Drawable that was passed in with bounds correctly set | boundMarkerCenterBottom | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapViewUtils.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapViewUtils.java | Apache-2.0 |
public static Drawable boundMarker(Drawable marker, int gravity) {
if (marker == null) {
return null;
}
final int width = marker.getIntrinsicWidth();
final int height = marker.getIntrinsicHeight();
if (width < 0 || height < 0) {
throw new IllegalStateEx... | Adjusts a drawable's bounds so that (0,0) is a pixel set according to the
given gravity.
@param marker The Drawable to adjust
@return The Drawable that was passed in with bounds correctly set | boundMarker | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/MapViewUtils.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/MapViewUtils.java | Apache-2.0 |
@Override
public void onRegionChanged(PolarisMapView mapView) {
} | This adapter class provides empty implementations of the methods from
{@link OnRegionChangedListener}. Any custom listener that cares only
about a subset of the methods of this listener can simply subclass this
adapter class instead of implementing the interface directly.
@author Cyril Mottier | onRegionChanged | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/PolarisMapView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/PolarisMapView.java | Apache-2.0 |
@Override
public void onRegionChangeConfirmed(PolarisMapView mapView) {
} | This adapter class provides empty implementations of the methods from
{@link OnRegionChangedListener}. Any custom listener that cares only
about a subset of the methods of this listener can simply subclass this
adapter class instead of implementing the interface directly.
@author Cyril Mottier | onRegionChangeConfirmed | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/PolarisMapView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/PolarisMapView.java | Apache-2.0 |
@Override
public void onAnnotationSelected(PolarisMapView mapView, MapCalloutView calloutView, int position, Annotation annotation) {
} | This adapter class provides empty implementations of the methods from
{@link OnAnnotationSelectionChangedListener}. Any custom listener that
cares only about a subset of the methods of this listener can simply
subclass this adapter class instead of implementing the interface
directly.
@author Cyril Mottier | onAnnotationSelected | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/PolarisMapView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/PolarisMapView.java | Apache-2.0 |
@Override
public void onAnnotationDeselected(PolarisMapView mapView, MapCalloutView calloutView, int position, Annotation annotation) {
} | This adapter class provides empty implementations of the methods from
{@link OnAnnotationSelectionChangedListener}. Any custom listener that
cares only about a subset of the methods of this listener can simply
subclass this adapter class instead of implementing the interface
directly.
@author Cyril Mottier | onAnnotationDeselected | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/PolarisMapView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/PolarisMapView.java | Apache-2.0 |
@Override
public void onAnnotationClicked(PolarisMapView mapView, MapCalloutView calloutView, int position, Annotation annotation) {
} | This adapter class provides empty implementations of the methods from
{@link OnAnnotationSelectionChangedListener}. Any custom listener that
cares only about a subset of the methods of this listener can simply
subclass this adapter class instead of implementing the interface
directly.
@author Cyril Mottier | onAnnotationClicked | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/PolarisMapView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/PolarisMapView.java | Apache-2.0 |
@TargetApi(3)
private void init() {
setBuiltInZoomControls(!supportsMultiTouchZoom());
setActionnable(true);
mOverlayContainer = new OverlayContainer(getContext(), mMagnetoCallback);
getOverlays().add(mOverlayContainer);
} | @param context A {@link MapActivity} Context.
@param apiKey A Google Maps API Key. | init | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/PolarisMapView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/PolarisMapView.java | Apache-2.0 |
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
super.onLayout(changed, left, top, right, bottom);
if (mOnRegionChangedListener != null && testRegionChange()) {
mOnRegionChangedListener.onRegionChanged(this);
scheduleRegionChang... | @param context A {@link MapActivity} Context.
@param apiKey A Google Maps API Key. | onLayout | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/PolarisMapView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/PolarisMapView.java | Apache-2.0 |
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
if (mIsUserTrackingButtonEnabled) {
final LayoutParams params = (LayoutParams) mUserTrackingButton.getLayoutParams();
final int spacing = getResources().getDimen... | @param context A {@link MapActivity} Context.
@param apiKey A Google Maps API Key. | onSizeChanged | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/PolarisMapView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/PolarisMapView.java | Apache-2.0 |
@Override
public boolean onTouchEvent(MotionEvent ev) {
switch (ev.getAction()) {
case MotionEvent.ACTION_DOWN:
mIsInGesture = true;
removeCallbacks(mRegionChangeConfirmedRunnable);
break;
case MotionEvent.ACTION_CANCEL:
ca... | @param context A {@link MapActivity} Context.
@param apiKey A Google Maps API Key. | onTouchEvent | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/PolarisMapView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/PolarisMapView.java | Apache-2.0 |
@Override
public void addView(View child, int index, ViewGroup.LayoutParams params) {
super.addView(child, index, params);
// We need to ensure mUserTrackingButton is always on top. As a result,
// we simply enforce it is brought to front whenever a new child is
// added. Note that t... | @param context A {@link MapActivity} Context.
@param apiKey A Google Maps API Key. | addView | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/PolarisMapView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/PolarisMapView.java | Apache-2.0 |
@Override
public void bringChildToFront(View child) {
// The code below is part of the trick described in the addView method.
if (child != mUserTrackingButton) {
super.bringChildToFront(child);
}
if (mIsUserTrackingButtonEnabled) {
super.bringChildToFront(mUse... | @param context A {@link MapActivity} Context.
@param apiKey A Google Maps API Key. | bringChildToFront | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/PolarisMapView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/PolarisMapView.java | Apache-2.0 |
public void onStart() {
if (mMyLocationOverlay != null) {
mMyLocationOverlay.enableMyLocation();
}
} | Method that MUST be called in the hosting {@link MapActivity} onStart()
method. | onStart | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/PolarisMapView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/PolarisMapView.java | Apache-2.0 |
public void onStop() {
if (mMyLocationOverlay != null) {
mMyLocationOverlay.disableMyLocation();
}
} | Method that MUST be called in the hosting {@link MapActivity} onStop()
method. | onStop | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/PolarisMapView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/PolarisMapView.java | Apache-2.0 |
public void addOverlay(int index, Overlay overlay) {
mOverlayContainer.addOverlay(index, overlay);
} | Equivalent to {@link #addOverlay(Overlay)}. It inserts the
{@link Overlay} at the given index.
@param index The index at which to insert the {@link Overlay}
@param overlay The {@link Overlay} to add | addOverlay | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/PolarisMapView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/PolarisMapView.java | Apache-2.0 |
public int indexOfOverlay(Overlay overlay) {
return mOverlayContainer.indexOfOverlay(overlay);
} | Searches the {@link Overlay}'s list for the specified {@link Overlay} and
returns the index of the first occurrence.
@param overlay The {@link Overlay} to search
@return The index of the first occurence of the given {@link Overlay} or
-1 if not found | indexOfOverlay | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/PolarisMapView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/PolarisMapView.java | Apache-2.0 |
public void setOnRegionChangedListenerListener(OnRegionChangedListener listener) {
mOnRegionChangedListener = listener;
} | Set a new {@link OnRegionChangedListener}.
@param listener The new {@link OnRegionChangedListener} | setOnRegionChangedListenerListener | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/PolarisMapView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/PolarisMapView.java | Apache-2.0 |
public void setOnMapViewLongClickListener(OnMapViewLongClickListener l) {
mOnMapViewLongClickListener = l;
} | Set a new {@link OnMapViewLongClickListener}.
@param l The new {@link OnMapViewLongClickListener} | setOnMapViewLongClickListener | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/PolarisMapView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/PolarisMapView.java | Apache-2.0 |
public boolean isUserTrackingButtonEnabled() {
return mIsUserTrackingButtonEnabled;
} | Indicate whether user tracking is enabled or not. Having user tracking
enabled will automatically add a {@link MyLocationOverlay} and a button
on the upper-right corner to center the map back to the user's location.
@return true if the user tracking is enabled else it returns false | isUserTrackingButtonEnabled | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/PolarisMapView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/PolarisMapView.java | Apache-2.0 |
public void setUserTrackingButtonEnabled(boolean enabled) {
if (mIsUserTrackingButtonEnabled != enabled) {
mIsUserTrackingButtonEnabled = enabled;
if (enabled) {
if (mUserTrackingButton == null) {
mUserTrackingButton = (ImageButton) LayoutInflater.from... | Enable/disable user tracking on this {@link PolarisMapView}.
@param enabled True if user tracking is enabled, false otherwise. | setUserTrackingButtonEnabled | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/PolarisMapView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/PolarisMapView.java | Apache-2.0 |
public boolean isActionnable() {
return isClickable();
} | Indicates whether this {@link PolarisMapView} is actionnable (i.e. if it
can be zoomed and panned by the user). More specifically, this method is
a replacement for the {@link MapView#isClickable()}.
@return true if this {@link PolarisMapView} is actionnable, false
otherwise | isActionnable | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/PolarisMapView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/PolarisMapView.java | Apache-2.0 |
public void setOnAnnotationSelectionChangedListener(OnAnnotationSelectionChangedListener listener) {
mOnAnnotationSelectionChangedListener = listener;
} | Set a new {@link OnAnnotationSelectionChangedListener}.
@param listener The new {@link OnAnnotationSelectionChangedListener} | setOnAnnotationSelectionChangedListener | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/PolarisMapView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/PolarisMapView.java | Apache-2.0 |
public void setAnnotations(List<Annotation> annotations, int annotationMarkerId) {
setAnnotations(annotations, getResources().getDrawable(annotationMarkerId));
} | Set the annotations to display in this {@link PolarisMapView}.
@param annotations The annotations
@param annotationMarkerId The resource identifier to the default marker. | setAnnotations | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/PolarisMapView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/PolarisMapView.java | Apache-2.0 |
public void setAnnotations(List<Annotation> annotations, Drawable annotationMarker) {
// Remove opened callouts before inserting annotations
if (mAnnotationsOverlay != null) {
mAnnotationsOverlay.setSelectedAnnotation(INVALID_POSITION);
}
if (annotations == null) {
... | Set the annotations to display in this {@link PolarisMapView}.
@param annotations The annotations
@param annotationMarker The default marker | setAnnotations | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/PolarisMapView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/PolarisMapView.java | Apache-2.0 |
public int getSelectedAnnotationPosition() {
if (mAnnotationsOverlay != null) {
return mAnnotationsOverlay.getSelectedAnnotation();
}
return INVALID_POSITION;
} | Returns the position of the selected annotation or
{@value #INVALID_POSITION} if no annotation is currently selected.
@return the position of the selected annotation or
{@value #INVALID_POSITION}. | getSelectedAnnotationPosition | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/PolarisMapView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/PolarisMapView.java | Apache-2.0 |
public Annotation getSelectedAnnotation() {
if (mAnnotationsOverlay != null) {
return mAnnotationsOverlay.getAnnotation(mAnnotationsOverlay.getSelectedAnnotation());
}
return null;
} | Returns the selected annotation.
@return The selected annotation | getSelectedAnnotation | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/PolarisMapView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/PolarisMapView.java | Apache-2.0 |
public void setSelectedAnnotation(int position) {
if (mAnnotationsOverlay != null) {
mAnnotationsOverlay.setSelectedAnnotation(position);
}
} | Set the selected annotation.
@param position The position of the annotation to select | setSelectedAnnotation | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/PolarisMapView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/PolarisMapView.java | Apache-2.0 |
public void getCoordinateRegion(CoordinateRegion region) {
//@formatter:off
region.set(
getMapCenter().getLatitudeE6(),
getMapCenter().getLongitudeE6(),
getLatitudeSpan(),
getLongitudeSpan());
//@formatter:on
} | Return the visible region of your map. Fills in the output region with
the values from the center coordinates and the spans.
@param region The visible region of the map | getCoordinateRegion | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/PolarisMapView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/PolarisMapView.java | Apache-2.0 |
private boolean supportsMultiTouchZoom() {
final PackageManager pm = getContext().getPackageManager();
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.FROYO) {
// Prior Froyo we don't even have the FEATURE_TOUCHSCREEN feature!
// As a result let's suppose multitouch is not enable... | Determine whether multi-touch is fully enabled on the current device. The
hint returned by this method can be used to decide whether to enable the
built-in zoom controls or not.
@return True is the device supports distinct multi-touch gestures.
Otherwise it return false. | supportsMultiTouchZoom | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/PolarisMapView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/PolarisMapView.java | Apache-2.0 |
private void scheduleRegionChangeConfirmed() {
if (!mIsInGesture) {
removeCallbacks(mRegionChangeConfirmedRunnable);
postDelayed(mRegionChangeConfirmedRunnable, REGION_CHANGE_CONFIRMED_DELAY);
}
} | Determine whether multi-touch is fully enabled on the current device. The
hint returned by this method can be used to decide whether to enable the
built-in zoom controls or not.
@return True is the device supports distinct multi-touch gestures.
Otherwise it return false. | scheduleRegionChangeConfirmed | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/PolarisMapView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/PolarisMapView.java | Apache-2.0 |
private boolean testRegionChange() {
return testRegionChange(mPreviousRegion);
} | Determine whether multi-touch is fully enabled on the current device. The
hint returned by this method can be used to decide whether to enable the
built-in zoom controls or not.
@return True is the device supports distinct multi-touch gestures.
Otherwise it return false. | testRegionChange | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/PolarisMapView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/PolarisMapView.java | Apache-2.0 |
private boolean testRegionChangeConfirmed() {
return testRegionChange(mPreviousRegionConfirmed);
} | Determine whether multi-touch is fully enabled on the current device. The
hint returned by this method can be used to decide whether to enable the
built-in zoom controls or not.
@return True is the device supports distinct multi-touch gestures.
Otherwise it return false. | testRegionChangeConfirmed | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/PolarisMapView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/PolarisMapView.java | Apache-2.0 |
private boolean testRegionChange(CoordinateRegion region) {
getCoordinateRegion(mTempRegion);
boolean result = !mTempRegion.equals(region);
region.set(mTempRegion);
return result;
} | Determine whether multi-touch is fully enabled on the current device. The
hint returned by this method can be used to decide whether to enable the
built-in zoom controls or not.
@return True is the device supports distinct multi-touch gestures.
Otherwise it return false. | testRegionChange | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/PolarisMapView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/PolarisMapView.java | Apache-2.0 |
private MapCalloutView getMapCallout(int index) {
if (mMapCallouts[index] == null) {
mMapCallouts[index] = new MapCalloutView(getContext());
mMapCallouts[index].setVisibility(View.GONE);
mMapCallouts[index].setOnClickListener(mOnClickListener);
mMapCallouts[index]... | Determine whether multi-touch is fully enabled on the current device. The
hint returned by this method can be used to decide whether to enable the
built-in zoom controls or not.
@return True is the device supports distinct multi-touch gestures.
Otherwise it return false. | getMapCallout | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/PolarisMapView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/PolarisMapView.java | Apache-2.0 |
private MapCalloutView getCurrentMapCallout() {
return getMapCallout(mMapCalloutIndex);
} | Determine whether multi-touch is fully enabled on the current device. The
hint returned by this method can be used to decide whether to enable the
built-in zoom controls or not.
@return True is the device supports distinct multi-touch gestures.
Otherwise it return false. | getCurrentMapCallout | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/PolarisMapView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/PolarisMapView.java | Apache-2.0 |
private MapCalloutView getNextMapCallout() {
if (mMapCalloutIndex == INDEX_FIRST) {
mMapCalloutIndex = INDEX_SECOND;
} else {
mMapCalloutIndex = INDEX_FIRST;
}
return getMapCallout(mMapCalloutIndex);
} | Determine whether multi-touch is fully enabled on the current device. The
hint returned by this method can be used to decide whether to enable the
built-in zoom controls or not.
@return True is the device supports distinct multi-touch gestures.
Otherwise it return false. | getNextMapCallout | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/PolarisMapView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/PolarisMapView.java | Apache-2.0 |
public void run() {
if (mOnRegionChangedListener != null && testRegionChangeConfirmed()) {
mOnRegionChangedListener.onRegionChangeConfirmed(PolarisMapView.this);
}
} | Determine whether multi-touch is fully enabled on the current device. The
hint returned by this method can be used to decide whether to enable the
built-in zoom controls or not.
@return True is the device supports distinct multi-touch gestures.
Otherwise it return false. | run | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/PolarisMapView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/PolarisMapView.java | Apache-2.0 |
@Override
public void dismissCallout(int position) {
final Annotation annotation = mAnnotationsOverlay.getAnnotation(position);
if (annotation == null) {
return;
}
final MapCalloutView mapCalloutView = getCurrentMapCallout();
if (mapCal... | Determine whether multi-touch is fully enabled on the current device. The
hint returned by this method can be used to decide whether to enable the
built-in zoom controls or not.
@return True is the device supports distinct multi-touch gestures.
Otherwise it return false. | dismissCallout | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/PolarisMapView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/PolarisMapView.java | Apache-2.0 |
@Override
public void showCallout(int position) {
final Annotation annotation = mAnnotationsOverlay.getAnnotation(position);
if (annotation == null) {
return;
}
dismissCallout(position);
final MapCalloutView mapCalloutView = getNextMa... | Determine whether multi-touch is fully enabled on the current device. The
hint returned by this method can be used to decide whether to enable the
built-in zoom controls or not.
@return True is the device supports distinct multi-touch gestures.
Otherwise it return false. | showCallout | java | cyrilmottier/Polaris | library/src/com/cyrilmottier/polaris/PolarisMapView.java | https://github.com/cyrilmottier/Polaris/blob/master/library/src/com/cyrilmottier/polaris/PolarisMapView.java | Apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.