Java Code Examples for android.view.GestureDetector.OnDoubleTapListener

The following are top voted examples for showing how to use android.view.GestureDetector.OnDoubleTapListener. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: FMTech   File: lq.java   View source code 7 votes vote down vote up
public lq(Context paramContext, GestureDetector.OnGestureListener paramOnGestureListener, Handler paramHandler)
{
  if (paramHandler != null) {}
  for (this.a = new lr(this, paramHandler);; this.a = new lr(this))
  {
    this.b = paramOnGestureListener;
    if ((paramOnGestureListener instanceof GestureDetector.OnDoubleTapListener)) {
      this.c = ((GestureDetector.OnDoubleTapListener)paramOnGestureListener);
    }
    if (paramContext != null) {
      break;
    }
    throw new IllegalArgumentException("Context must not be null");
  }
  if (this.b == null) {
    throw new IllegalArgumentException("OnGestureListener must not be null");
  }
  this.w = true;
  ViewConfiguration localViewConfiguration = ViewConfiguration.get(paramContext);
  int i1 = localViewConfiguration.getScaledTouchSlop();
  int i2 = localViewConfiguration.getScaledDoubleTapSlop();
  this.j = localViewConfiguration.getScaledMinimumFlingVelocity();
  this.k = localViewConfiguration.getScaledMaximumFlingVelocity();
  this.h = (i1 * i1);
  this.i = (i2 * i2);
}
 
Example 2
Project: FMTech   File: GestureDetectorCompat.java   View source code 6 votes vote down vote up
public GestureDetectorCompatImplBase(Context paramContext, GestureDetector.OnGestureListener paramOnGestureListener, Handler paramHandler)
{
  this.mListener = paramOnGestureListener;
  if ((paramOnGestureListener instanceof GestureDetector.OnDoubleTapListener)) {
    this.mDoubleTapListener = ((GestureDetector.OnDoubleTapListener)paramOnGestureListener);
  }
  if (paramContext == null) {
    throw new IllegalArgumentException("Context must not be null");
  }
  if (this.mListener == null) {
    throw new IllegalArgumentException("OnGestureListener must not be null");
  }
  this.mIsLongpressEnabled = true;
  ViewConfiguration localViewConfiguration = ViewConfiguration.get(paramContext);
  int i = localViewConfiguration.getScaledTouchSlop();
  int j = localViewConfiguration.getScaledDoubleTapSlop();
  this.mMinimumFlingVelocity = localViewConfiguration.getScaledMinimumFlingVelocity();
  this.mMaximumFlingVelocity = localViewConfiguration.getScaledMaximumFlingVelocity();
  this.mTouchSlopSquare = (i * i);
  this.mDoubleTapSlopSquare = (j * j);
}
 
Example 3
Project: GitHubExplorer   File: Gestures.java   View source code 6 votes vote down vote up
/**
 * Register listener on double-tap gesture for view
 *
 * @param view
 * @param listener
 * @return view
 */
public static View onDoubleTap(final View view,
    final OnDoubleTapListener listener) {
  final GestureDetector detector = new GestureDetector(view.getContext(),
      new SimpleOnGestureListener());
  detector.setOnDoubleTapListener(listener);
  view.setOnTouchListener(new OnTouchListener() {

    @Override
    public boolean onTouch(View v, MotionEvent event) {
      return detector.onTouchEvent(event);
    }
  });

  return view;
}
 
Example 4
Project: github-v2   File: Gestures.java   View source code 6 votes vote down vote up
/**
 * Register listener on double-tap gesture for view
 *
 * @param view
 * @param listener
 * @return view
 */
public static View onDoubleTap(final View view,
    final OnDoubleTapListener listener) {
  final GestureDetector detector = new GestureDetector(view.getContext(),
      new SimpleOnGestureListener());
  detector.setOnDoubleTapListener(listener);
  view.setOnTouchListener(new OnTouchListener() {

    @Override
    public boolean onTouch(View v, MotionEvent event) {
      return detector.onTouchEvent(event);
    }
  });

  return view;
}
 
Example 5
Project: wishlist_hackugyo   File: Gestures.java   View source code 6 votes vote down vote up
/**
 * Register listener on double-tap gesture for view
 *
 * @param view
 * @param listener
 * @return view
 */
public static View onDoubleTap(final View view,
    final OnDoubleTapListener listener) {
  final GestureDetector detector = new GestureDetector(view.getContext(),
      new SimpleOnGestureListener());
  detector.setOnDoubleTapListener(listener);
  view.setOnTouchListener(new OnTouchListener() {

    @Override
    public boolean onTouch(View v, MotionEvent event) {
      return detector.onTouchEvent(event);
    }
  });

  return view;
}
 
Example 6
Project: Ghostbin-for-Android   File: Gestures.java   View source code 6 votes vote down vote up
/**
 * Register listener on double-tap gesture for view
 *
 * @param view
 * @param listener
 * @return view
 */
public static View onDoubleTap(final View view,
    final OnDoubleTapListener listener) {
  final GestureDetector detector = new GestureDetector(view.getContext(),
      new SimpleOnGestureListener());
  detector.setOnDoubleTapListener(listener);
  view.setOnTouchListener(new OnTouchListener() {

    @Override
    public boolean onTouch(View v, MotionEvent event) {
      return detector.onTouchEvent(event);
    }
  });

  return view;
}
 
Example 7
Project: letv   File: GestureDetectorCompat.java   View source code 5 votes vote down vote up
public GestureDetectorCompatImplBase(Context context, OnGestureListener listener, Handler handler) {
    if (handler != null) {
        this.mHandler = new GestureHandler(handler);
    } else {
        this.mHandler = new GestureHandler();
    }
    this.mListener = listener;
    if (listener instanceof OnDoubleTapListener) {
        setOnDoubleTapListener((OnDoubleTapListener) listener);
    }
    init(context);
}
 
Example 8
Project: boohee_v5.6   File: GestureDetectorCompat.java   View source code 5 votes vote down vote up
public GestureDetectorCompatImplBase(Context context, OnGestureListener listener, Handler handler) {
    if (handler != null) {
        this.mHandler = new GestureHandler(handler);
    } else {
        this.mHandler = new GestureHandler();
    }
    this.mListener = listener;
    if (listener instanceof OnDoubleTapListener) {
        setOnDoubleTapListener((OnDoubleTapListener) listener);
    }
    init(context);
}
 
Example 9
Project: boohee_v5.6   File: PhotoViewAttacher.java   View source code 5 votes vote down vote up
public void setOnDoubleTapListener(OnDoubleTapListener newOnDoubleTapListener) {
    if (newOnDoubleTapListener != null) {
        this.mGestureDetector.setOnDoubleTapListener(newOnDoubleTapListener);
    } else {
        this.mGestureDetector.setOnDoubleTapListener(new DefaultOnDoubleTapListener(this));
    }
}
 
Example 10
Project: permissionsModule   File: GestureDetectorCompat.java   View source code 5 votes vote down vote up
/**
 * Creates a GestureDetector with the supplied listener.
 * You may only use this constructor from a UI thread (this is the usual situation).
 * @see android.os.Handler#Handler()
 *
 * @param context the application's context
 * @param listener the listener invoked for all the callbacks, this must
 * not be null.
 * @param handler the handler to use
 *
 * @throws NullPointerException if {@code listener} is null.
 */
public GestureDetectorCompatImplBase(Context context, OnGestureListener listener,
        Handler handler) {
    if (handler != null) {
        mHandler = new GestureHandler(handler);
    } else {
        mHandler = new GestureHandler();
    }
    mListener = listener;
    if (listener instanceof OnDoubleTapListener) {
        setOnDoubleTapListener((OnDoubleTapListener) listener);
    }
    init(context);
}
 
Example 11
Project: Android-3DTouch-PeekView   File: GestureDetectorCompat.java   View source code 5 votes vote down vote up
/**
 * Creates a GestureDetector with the supplied listener.
 * You may only use this constructor from a UI thread (this is the usual situation).
 * @see android.os.Handler#Handler()
 *
 * @param context the application's context
 * @param listener the listener invoked for all the callbacks, this must
 * not be null.
 * @param handler the handler to use
 *
 * @throws NullPointerException if {@code listener} is null.
 */
public GestureDetectorCompatImplBase(Context context, OnGestureListener listener,
                                     Handler handler) {
    if (handler != null) {
        mHandler = new GestureHandler(handler);
    } else {
        mHandler = new GestureHandler();
    }
    mListener = listener;
    if (listener instanceof OnDoubleTapListener) {
        setOnDoubleTapListener((OnDoubleTapListener) listener);
    }
    init(context);
}
 
Example 12
Project: awesomerecyclerview   File: GestureDetectorCompat.java   View source code 5 votes vote down vote up
/**
 * Creates a GestureDetector with the supplied listener.
 * You may only use this constructor from a UI thread (this is the usual situation).
 * @see android.os.Handler#Handler()
 *
 * @param context the application's context
 * @param listener the listener invoked for all the callbacks, this must
 * not be null.
 * @param handler the handler to use
 *
 * @throws NullPointerException if {@code listener} is null.
 */
public GestureDetectorCompatImplBase(Context context, OnGestureListener listener,
                                     Handler handler) {
    if (handler != null) {
        mHandler = new GestureHandler(handler);
    } else {
        mHandler = new GestureHandler();
    }
    mListener = listener;
    if (listener instanceof OnDoubleTapListener) {
        setOnDoubleTapListener((OnDoubleTapListener) listener);
    }
    init(context);
}
 
Example 13
Project: ShoppingMall   File: GestureDetectorCompat.java   View source code 5 votes vote down vote up
/**
 * Creates a GestureDetector with the supplied listener.
 * You may only use this constructor from a UI thread (this is the usual situation).
 * @see android.os.Handler#Handler()
 *
 * @param context the application's context
 * @param listener the listener invoked for all the callbacks, this must
 * not be null.
 * @param handler the handler to use
 *
 * @throws NullPointerException if {@code listener} is null.
 */
public GestureDetectorCompatImplBase(Context context, OnGestureListener listener,
        Handler handler) {
    if (handler != null) {
        mHandler = new GestureHandler(handler);
    } else {
        mHandler = new GestureHandler();
    }
    mListener = listener;
    if (listener instanceof OnDoubleTapListener) {
        setOnDoubleTapListener((OnDoubleTapListener) listener);
    }
    init(context);
}
 
Example 14
Project: Slide   File: GestureDetectorCompat.java   View source code 5 votes vote down vote up
/**
 * Creates a GestureDetector with the supplied listener.
 * You may only use this constructor from a UI thread (this is the usual situation).
 * @see Handler#Handler()
 *
 * @param context the application's context
 * @param listener the listener invoked for all the callbacks, this must
 * not be null.
 * @param handler the handler to use
 *
 * @throws NullPointerException if {@code listener} is null.
 */
public GestureDetectorCompatImplBase(Context context, OnGestureListener listener,
                                     Handler handler) {
    if (handler != null) {
        mHandler = new GestureHandler(handler);
    } else {
        mHandler = new GestureHandler();
    }
    mListener = listener;
    if (listener instanceof OnDoubleTapListener) {
        setOnDoubleTapListener((OnDoubleTapListener) listener);
    }
    init(context);
}
 
Example 15
Project: CodenameOne   File: GestureDetectorCompat.java   View source code 5 votes vote down vote up
/**
 * Creates a GestureDetector with the supplied listener.
 * You may only use this constructor from a UI thread (this is the usual situation).
 * @see android.os.Handler#Handler()
 *
 * @param context the application's context
 * @param listener the listener invoked for all the callbacks, this must
 * not be null.
 * @param handler the handler to use
 *
 * @throws NullPointerException if {@code listener} is null.
 */
public GestureDetectorCompatImplBase(Context context, OnGestureListener listener,
        Handler handler) {
    if (handler != null) {
        mHandler = new GestureHandler(handler);
    } else {
        mHandler = new GestureHandler();
    }
    mListener = listener;
    if (listener instanceof OnDoubleTapListener) {
        setOnDoubleTapListener((OnDoubleTapListener) listener);
    }
    init(context);
}
 
Example 16
Project: adt-leanback-support   File: GestureDetectorCompat.java   View source code 5 votes vote down vote up
/**
 * Creates a GestureDetector with the supplied listener.
 * You may only use this constructor from a UI thread (this is the usual situation).
 * @see android.os.Handler#Handler()
 *
 * @param context the application's context
 * @param listener the listener invoked for all the callbacks, this must
 * not be null.
 * @param handler the handler to use
 *
 * @throws NullPointerException if {@code listener} is null.
 */
public GestureDetectorCompatImplBase(Context context, OnGestureListener listener,
        Handler handler) {
    if (handler != null) {
        mHandler = new GestureHandler(handler);
    } else {
        mHandler = new GestureHandler();
    }
    mListener = listener;
    if (listener instanceof OnDoubleTapListener) {
        setOnDoubleTapListener((OnDoubleTapListener) listener);
    }
    init(context);
}
 
Example 17
Project: generator-android   File: GestureDetectorCompat.java   View source code 5 votes vote down vote up
/**
 * Creates a GestureDetector with the supplied listener.
 * You may only use this constructor from a UI thread (this is the usual situation).
 * @see android.os.Handler#Handler()
 *
 * @param context the application's context
 * @param listener the listener invoked for all the callbacks, this must
 * not be null.
 * @param handler the handler to use
 *
 * @throws NullPointerException if {@code listener} is null.
 */
public GestureDetectorCompatImplBase(Context context, OnGestureListener listener,
        Handler handler) {
    if (handler != null) {
        mHandler = new GestureHandler(handler);
    } else {
        mHandler = new GestureHandler();
    }
    mListener = listener;
    if (listener instanceof OnDoubleTapListener) {
        setOnDoubleTapListener((OnDoubleTapListener) listener);
    }
    init(context);
}
 
Example 18
Project: informant-droid   File: GestureDetectorCompat.java   View source code 5 votes vote down vote up
/**
 * Creates a GestureDetector with the supplied listener.
 * You may only use this constructor from a UI thread (this is the usual situation).
 * @see android.os.Handler#Handler()
 *
 * @param context the application's context
 * @param listener the listener invoked for all the callbacks, this must
 * not be null.
 * @param handler the handler to use
 *
 * @throws NullPointerException if {@code listener} is null.
 */
public GestureDetectorCompatImplBase(Context context, OnGestureListener listener,
        Handler handler) {
    if (handler != null) {
        mHandler = new GestureHandler(handler);
    } else {
        mHandler = new GestureHandler();
    }
    mListener = listener;
    if (listener instanceof OnDoubleTapListener) {
        setOnDoubleTapListener((OnDoubleTapListener) listener);
    }
    init(context);
}
 
Example 19
Project: android-recipes-app   File: GestureDetectorCompat.java   View source code 5 votes vote down vote up
/**
 * Creates a GestureDetector with the supplied listener.
 * You may only use this constructor from a UI thread (this is the usual situation).
 * @see android.os.Handler#Handler()
 *
 * @param context the application's context
 * @param listener the listener invoked for all the callbacks, this must
 * not be null.
 * @param handler the handler to use
 *
 * @throws NullPointerException if {@code listener} is null.
 */
public GestureDetectorCompatImplBase(Context context, OnGestureListener listener,
        Handler handler) {
    if (handler != null) {
        mHandler = new GestureHandler(handler);
    } else {
        mHandler = new GestureHandler();
    }
    mListener = listener;
    if (listener instanceof OnDoubleTapListener) {
        setOnDoubleTapListener((OnDoubleTapListener) listener);
    }
    init(context);
}
 
Example 20
Project: bitcast   File: GestureDetectorCompat.java   View source code 5 votes vote down vote up
/**
 * Creates a GestureDetector with the supplied listener.
 * You may only use this constructor from a UI thread (this is the usual situation).
 * @see android.os.Handler#Handler()
 *
 * @param context the application's context
 * @param listener the listener invoked for all the callbacks, this must
 * not be null.
 * @param handler the handler to use
 *
 * @throws NullPointerException if {@code listener} is null.
 */
public GestureDetectorCompatImplBase(Context context, OnGestureListener listener,
        Handler handler) {
    if (handler != null) {
        mHandler = new GestureHandler(handler);
    } else {
        mHandler = new GestureHandler();
    }
    mListener = listener;
    if (listener instanceof OnDoubleTapListener) {
        setOnDoubleTapListener((OnDoubleTapListener) listener);
    }
    init(context);
}
 
Example 21
Project: V.FlyoutTest   File: GestureDetectorCompat.java   View source code 5 votes vote down vote up
/**
 * Creates a GestureDetector with the supplied listener.
 * You may only use this constructor from a UI thread (this is the usual situation).
 * @see android.os.Handler#Handler()
 *
 * @param context the application's context
 * @param listener the listener invoked for all the callbacks, this must
 * not be null.
 * @param handler the handler to use
 *
 * @throws NullPointerException if {@code listener} is null.
 */
public GestureDetectorCompatImplBase(Context context, OnGestureListener listener,
        Handler handler) {
    if (handler != null) {
        mHandler = new GestureHandler(handler);
    } else {
        mHandler = new GestureHandler();
    }
    mListener = listener;
    if (listener instanceof OnDoubleTapListener) {
        setOnDoubleTapListener((OnDoubleTapListener) listener);
    }
    init(context);
}
 
Example 22
Project: guideshow   File: GestureDetectorCompat.java   View source code 5 votes vote down vote up
/**
 * Creates a GestureDetector with the supplied listener.
 * You may only use this constructor from a UI thread (this is the usual situation).
 * @see android.os.Handler#Handler()
 *
 * @param context the application's context
 * @param listener the listener invoked for all the callbacks, this must
 * not be null.
 * @param handler the handler to use
 *
 * @throws NullPointerException if {@code listener} is null.
 */
public GestureDetectorCompatImplBase(Context context, OnGestureListener listener,
        Handler handler) {
    if (handler != null) {
        mHandler = new GestureHandler(handler);
    } else {
        mHandler = new GestureHandler();
    }
    mListener = listener;
    if (listener instanceof OnDoubleTapListener) {
        setOnDoubleTapListener((OnDoubleTapListener) listener);
    }
    init(context);
}
 
Example 23
Project: IntranetEpitechV2   File: GestureDetectorCompat.java   View source code 5 votes vote down vote up
/**
 * Creates a GestureDetector with the supplied listener.
 * You may only use this constructor from a UI thread (this is the usual situation).
 * @see android.os.Handler#Handler()
 *
 * @param context the application's context
 * @param listener the listener invoked for all the callbacks, this must
 * not be null.
 * @param handler the handler to use
 *
 * @throws NullPointerException if {@code listener} is null.
 */
public GestureDetectorCompatImplBase(Context context, OnGestureListener listener,
        Handler handler) {
    if (handler != null) {
        mHandler = new GestureHandler(handler);
    } else {
        mHandler = new GestureHandler();
    }
    mListener = listener;
    if (listener instanceof OnDoubleTapListener) {
        setOnDoubleTapListener((OnDoubleTapListener) listener);
    }
    init(context);
}
 
Example 24
Project: MoSeS--Client-   File: GestureDetectorCompat.java   View source code 5 votes vote down vote up
/**
 * Creates a GestureDetector with the supplied listener.
 * You may only use this constructor from a UI thread (this is the usual situation).
 * @see android.os.Handler#Handler()
 *
 * @param context the application's context
 * @param listener the listener invoked for all the callbacks, this must
 * not be null.
 * @param handler the handler to use
 *
 * @throws NullPointerException if {@code listener} is null.
 */
public GestureDetectorCompatImplBase(Context context, OnGestureListener listener,
        Handler handler) {
    if (handler != null) {
        mHandler = new GestureHandler(handler);
    } else {
        mHandler = new GestureHandler();
    }
    mListener = listener;
    if (listener instanceof OnDoubleTapListener) {
        setOnDoubleTapListener((OnDoubleTapListener) listener);
    }
    init(context);
}
 
Example 25
Project: android.support.v4   File: GestureDetectorCompat.java   View source code 5 votes vote down vote up
/**
 * Creates a GestureDetector with the supplied listener.
 * You may only use this constructor from a UI thread (this is the usual situation).
 * @see android.os.Handler#Handler()
 *
 * @param context the application's context
 * @param listener the listener invoked for all the callbacks, this must
 * not be null.
 * @param handler the handler to use
 *
 * @throws NullPointerException if {@code listener} is null.
 */
public GestureDetectorCompatImplBase(Context context, OnGestureListener listener,
        Handler handler) {
    if (handler != null) {
        mHandler = new GestureHandler(handler);
    } else {
        mHandler = new GestureHandler();
    }
    mListener = listener;
    if (listener instanceof OnDoubleTapListener) {
        setOnDoubleTapListener((OnDoubleTapListener) listener);
    }
    init(context);
}
 
Example 26
Project: letv   File: GestureDetectorCompat.java   View source code 4 votes vote down vote up
public void setOnDoubleTapListener(OnDoubleTapListener onDoubleTapListener) {
    this.mDoubleTapListener = onDoubleTapListener;
}
 
Example 27
Project: letv   File: GestureDetectorCompat.java   View source code 4 votes vote down vote up
public void setOnDoubleTapListener(OnDoubleTapListener listener) {
    this.mDetector.setOnDoubleTapListener(listener);
}
 
Example 28
Project: letv   File: GestureDetectorCompat.java   View source code 4 votes vote down vote up
public void setOnDoubleTapListener(OnDoubleTapListener listener) {
    this.mImpl.setOnDoubleTapListener(listener);
}
 
Example 29
Project: boohee_v5.6   File: TouchImageView.java   View source code 4 votes vote down vote up
public void setOnDoubleTapListener(OnDoubleTapListener l) {
    this.doubleTapListener = l;
}
 
Example 30
Project: boohee_v5.6   File: GestureDetectorCompat.java   View source code 4 votes vote down vote up
public void setOnDoubleTapListener(OnDoubleTapListener onDoubleTapListener) {
    this.mDoubleTapListener = onDoubleTapListener;
}
 
Example 31
Project: boohee_v5.6   File: GestureDetectorCompat.java   View source code 4 votes vote down vote up
public void setOnDoubleTapListener(OnDoubleTapListener listener) {
    this.mDetector.setOnDoubleTapListener(listener);
}
 
Example 32
Project: boohee_v5.6   File: GestureDetectorCompat.java   View source code 4 votes vote down vote up
public void setOnDoubleTapListener(OnDoubleTapListener listener) {
    this.mImpl.setOnDoubleTapListener(listener);
}
 
Example 33
Project: boohee_v5.6   File: PhotoView.java   View source code 4 votes vote down vote up
public void setOnDoubleTapListener(OnDoubleTapListener newOnDoubleTapListener) {
    this.mAttacher.setOnDoubleTapListener(newOnDoubleTapListener);
}
 
Example 34
Project: permissionsModule   File: GestureDetectorCompat.java   View source code 4 votes vote down vote up
@Override
public void setOnDoubleTapListener(OnDoubleTapListener listener) {
    mDetector.setOnDoubleTapListener(listener);
}
 
Example 35
Project: Android-3DTouch-PeekView   File: GestureDetectorCompat.java   View source code 4 votes vote down vote up
@Override
public void setOnDoubleTapListener(OnDoubleTapListener listener) {
    mDetector.setOnDoubleTapListener(listener);
}
 
Example 36
Project: FMTech   File: lq.java   View source code 4 votes vote down vote up
public final void a(GestureDetector.OnDoubleTapListener paramOnDoubleTapListener)
{
  this.c = paramOnDoubleTapListener;
}
 
Example 37
Project: FMTech   File: ls.java   View source code 4 votes vote down vote up
public final void a(GestureDetector.OnDoubleTapListener paramOnDoubleTapListener)
{
  this.a.setOnDoubleTapListener(paramOnDoubleTapListener);
}
 
Example 38
Project: awesomerecyclerview   File: GestureDetectorCompat.java   View source code 4 votes vote down vote up
@Override
public void setOnDoubleTapListener(OnDoubleTapListener listener) {
    mDetector.setOnDoubleTapListener(listener);
}
 
Example 39
Project: ShoppingMall   File: GestureDetectorCompat.java   View source code 4 votes vote down vote up
@Override
public void setOnDoubleTapListener(OnDoubleTapListener listener) {
    mDetector.setOnDoubleTapListener(listener);
}
 
Example 40
Project: Slide   File: GestureDetectorCompat.java   View source code 4 votes vote down vote up
@Override
public void setOnDoubleTapListener(OnDoubleTapListener listener) {
    mDetector.setOnDoubleTapListener(listener);
}