Last active
August 29, 2015 14:05
-
-
Save doneill/6097a5d161373f3c3777 to your computer and use it in GitHub Desktop.
Show/Hide a Callout
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Shows a mini callout on the map. | |
| * | |
| * @param location | |
| * the location of the callout | |
| * @param message | |
| * the content of the callout | |
| * @param yOffsetDips | |
| * the y offset of the callout in dips | |
| */ | |
| private void showCallout(Point location, String message, int yOffsetDips) { | |
| View view = mInflater.inflate(R.layout.simple_callout_layout, null); | |
| TextView textView = (TextView) view | |
| .findViewById(R.id.simple_callout_textview); | |
| textView.setText(message); | |
| int yOffset = UiUtils.dipsToPixels(yOffsetDips); | |
| Callout callout = mMapView.getCallout(); | |
| callout.setStyle(mCalloutStyle); | |
| callout.setMaxWidth(mMaxCalloutWidth); | |
| callout.setMaxHeight(mMaxCalloutHeight); | |
| callout.setOffset(0, yOffset); | |
| callout.animatedShow(location, view); | |
| } | |
| /** | |
| * Hides the callout. | |
| */ | |
| private void hideCallout() { | |
| Callout callout = mMapView.getCallout(); | |
| callout.hide(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment