public class DragWidgetHelper extends java.lang.Object implements MapWidget.OnClickListener, MapWidget.OnMoveListener, MapWidget.OnPressListener, MapWidget.OnUnpressListener
| Constructor and Description |
|---|
DragWidgetHelper(MapView mapView,
java.lang.String preferenceKey,
MapWidget mw)
Helper class to allow for easier implementation of draggable widgets.
|
| Modifier and Type | Method and Description |
|---|---|
android.graphics.PointF |
getUpperLeft()
Get the upper left of the mapWidget based on the position of the mapWidget at the current
orientation.
|
void |
onMapWidgetClick(MapWidget widget,
android.view.MotionEvent event) |
boolean |
onMapWidgetMove(MapWidget widget,
android.view.MotionEvent event) |
void |
onMapWidgetPress(MapWidget widget,
android.view.MotionEvent event) |
void |
onMapWidgetUnpress(MapWidget widget,
android.view.MotionEvent event) |
void |
setTouchEnabled(boolean enabled)
Enable or disable the ability to touch / drag the widget.
|
public DragWidgetHelper(MapView mapView, java.lang.String preferenceKey, MapWidget mw)
mapView - the mapViewpreferenceKey - the key used to store the x and y values as part of the dragging.public android.graphics.PointF getUpperLeft()
public void onMapWidgetClick(MapWidget widget, android.view.MotionEvent event)
onMapWidgetClick in interface MapWidget.OnClickListenerpublic boolean onMapWidgetMove(MapWidget widget, android.view.MotionEvent event)
onMapWidgetMove in interface MapWidget.OnMoveListenerpublic void setTouchEnabled(boolean enabled)
enabled - public void onMapWidgetPress(MapWidget widget, android.view.MotionEvent event)
onMapWidgetPress in interface MapWidget.OnPressListenerpublic void onMapWidgetUnpress(MapWidget widget, android.view.MotionEvent event)
onMapWidgetUnpress in interface MapWidget.OnUnpressListener