Android GestureDetector.SimpleOnGestureListener - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android GestureDetector.SimpleOnGestureListener class.

This code example shows how to use the following methods:
 
	public PassengerRoutesView(Context activity, AttributeSet attrs) {
		super(activity, attrs);
		this.activity = (BusMeActivity) activity;
		 
    	OnGestureListener lis = new SimpleOnGestureListener();
		gestureDetector = new GestureDetector(activity, lis);
		gestureDetector.setOnDoubleTapListener(new MyOnDoubleTapListener());
		this.state = State.CREATE;
	} 
	 
	MyOnDoubleTapListener onDoubleTapListener = new MyOnDoubleTapListener();
	@Override 
	public boolean onTouchEvent(MotionEvent e) {
		return gestureDetector.onTouchEvent(e);
	} 
	 
    class MyOnDoubleTapListener implements GestureDetector.OnDoubleTapListener {
 
		@Override 
3
CodeRank
This code example shows how to use the following methods:
    private OnDropListener onDropListener;
 
    public DraggableOverlay(Context context, Drawable defaultMarker) {
        super(boundCenterBottom(defaultMarker));
        this.defaultMarker = defaultMarker;
        this.gesDetect = new GestureDetector(context, new SimpleOnGestureListener());
        populate(); 
    } 
 
    public void setMarker(OverlayItem item) {
        this.point = item.getPoint();
        this.dragItem = item;
        longPressFlag = true;
        Drawable draw = null;
        if (item.getMarker(0) != null) {
            draw = boundCenterBottom(item.getMarker(0));
        } else { 
            draw = defaultMarker;
        } 
        marker = ((BitmapDrawable) draw).getBitmap();
4
CodeRank
This code example shows how to use the following methods:
    MapView mapView;
 
	public LocationOverlay(Context context, MapView mapView) {
		super(context, mapView);
		this.mapView = mapView;
    	OnGestureListener lis = new SimpleOnGestureListener();
		gestureDetector = new GestureDetector(context, lis);
		gestureDetector.setOnDoubleTapListener(new MyOnDoubleTapListener());
	} 
 
    private class MyOnDoubleTapListener implements GestureDetector.OnDoubleTapListener {
 
		@Override 
		public boolean onDoubleTap(MotionEvent e) {
			Log.d(LOGTAG, "DOUBLE TAP!!");
			mapView.getController().animateTo(LocationOverlay.this.getMyLocation());
			return true; 
		} 
 
		@Override 
4
CodeRank
This code example shows how to use the following methods:
import com.google.android.maps.MapView; 
 
public class SuperCoolMegaGeilMapView extends MapView {
 
	private GestureDetector gDetector;
	private SimpleOnGestureListener sl = new SimpleOnGestureListener();
 
	public SuperCoolMegaGeilMapView(Context context, AttributeSet attrs) {
		super(context, attrs);
		createDetector(context);
 
	} 
 
	private void createDetector(Context context) {
		gDetector = new GestureDetector(sl);
	} 
 
	public SuperCoolMegaGeilMapView(Context context, AttributeSet attrs,
			int defStyle) {
		super(context, attrs, defStyle);
4
CodeRank
This code example shows how to use the following methods:
import android.widget.LinearLayout; 
 
public class TouchHandlerLayout extends LinearLayout {
 
	private GestureDetector gDetector;
	private SimpleOnGestureListener sl = new SimpleOnGestureListener();
 
	private void createDetector(Context context) {
		gDetector = new GestureDetector(sl);
	} 
 
	public TouchHandlerLayout(Context context) {
		super(context);
		createDetector(context);
	} 
 
	public TouchHandlerLayout(Context context, AttributeSet attributeSet) {
		super(context, attributeSet);
		createDetector(context);
 
4
CodeRank
This code example shows how to use the following methods:
    public MapViewWrapper(final MapView mapView) {
        this.mapView = mapView;
        this.mapControllerWrapper = new MapControllerWrapper(mapView);
        this.overlayManager = new OverlayManager(this);
 
        final GestureDetector gd = new GestureDetector(mapView.getContext(), new SimpleOnGestureListener());
        gd.setOnDoubleTapListener(new OnDoubleTapListener() {
 
            @Override 
            public boolean onSingleTapConfirmed(MotionEvent e) {
                return false; 
            } 
 
            @Override 
            public boolean onDoubleTap(MotionEvent e) {
                mapView.getController().zoomInFixing((int) e.getX(), (int) e.getY());
                return false; 
            } 
 
            @Override 
4
CodeRank
This code example shows how to use the following methods:onSingleTapUp
 
	public boolean onTouchEvent(MotionEvent event)
	{ 
		if (event.getAction() == MotionEvent.ACTION_UP)
		{ 
			gestureListener.onSingleTapUp(event);
		} 
 
		return (true); 
	} 
 
	public void addTapListener(TapListener l)
	{ 
		listeners.add(l);
	} 
 
	public void removeTapListener(TapListener l)
	{ 
		listeners.remove(l);
	} 
3
CodeRank

Related Android GestureDetector.SimpleOnGestureListener Questions & Answers:

See Code Examples for Android GestureDetector.SimpleOnGestureListener Methods: