Java 类android.view.GestureDetector.OnGestureListener 实例源码

项目:FMTech    文件:GestureDetectorCompat.java   
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);
}
项目:FMTech    文件:lq.java   
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);
}
项目:letv    文件:GestureDetectorCompat.java   
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);
}
项目:letv    文件:GestureDetectorCompat.java   
public GestureDetectorCompat(Context context, OnGestureListener listener, Handler handler) {
    if (VERSION.SDK_INT > 17) {
        this.mImpl = new GestureDetectorCompatImplJellybeanMr2(context, listener, handler);
    } else {
        this.mImpl = new GestureDetectorCompatImplBase(context, listener, handler);
    }
}
项目:boohee_v5.6    文件:GestureDetectorCompat.java   
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);
}
项目:boohee_v5.6    文件:GestureDetectorCompat.java   
public GestureDetectorCompat(Context context, OnGestureListener listener, Handler handler) {
    if (VERSION.SDK_INT > 17) {
        this.mImpl = new GestureDetectorCompatImplJellybeanMr2(context, listener, handler);
    } else {
        this.mImpl = new GestureDetectorCompatImplBase(context, listener, handler);
    }
}
项目:permissionsModule    文件:GestureDetectorCompat.java   
/**
 * 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);
}
项目:Android-3DTouch-PeekView    文件:GestureDetectorCompat.java   
/**
 * 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);
}
项目:FMTech    文件:GestureDetectorCompat.java   
public GestureDetectorCompat(Context paramContext, GestureDetector.OnGestureListener paramOnGestureListener, byte paramByte)
{
  if (Build.VERSION.SDK_INT > 17)
  {
    this.mImpl = new GestureDetectorCompatImplJellybeanMr2(paramContext, paramOnGestureListener, null);
    return;
  }
  this.mImpl = new GestureDetectorCompatImplBase(paramContext, paramOnGestureListener, null);
}
项目:FMTech    文件:lo.java   
private lo(Context paramContext, GestureDetector.OnGestureListener paramOnGestureListener, Handler paramHandler)
{
  if (Build.VERSION.SDK_INT > 17)
  {
    this.a = new ls(paramContext, paramOnGestureListener, null);
    return;
  }
  this.a = new lq(paramContext, paramOnGestureListener, null);
}
项目:awesomerecyclerview    文件:GestureDetectorCompat.java   
/**
 * 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);
}
项目:ShoppingMall    文件:GestureDetectorCompat.java   
/**
 * 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);
}
项目:Slide    文件:GestureDetectorCompat.java   
/**
 * 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);
}
项目:CodenameOne    文件:GestureDetectorCompat.java   
/**
 * 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);
}
项目:adt-leanback-support    文件:GestureDetectorCompat.java   
/**
 * 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);
}
项目:generator-android    文件:GestureDetectorCompat.java   
/**
 * 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);
}
项目:informant-droid    文件:GestureDetectorCompat.java   
/**
 * 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);
}
项目:android-recipes-app    文件:GestureDetectorCompat.java   
/**
 * 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);
}
项目:bitcast    文件:GestureDetectorCompat.java   
/**
 * 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);
}
项目:V.FlyoutTest    文件:GestureDetectorCompat.java   
/**
 * 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);
}
项目:guideshow    文件:GestureDetectorCompat.java   
/**
 * 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);
}
项目:IntranetEpitechV2    文件:GestureDetectorCompat.java   
/**
 * 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);
}
项目:MoSeS--Client-    文件:GestureDetectorCompat.java   
/**
 * 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);
}
项目:Hi-Top    文件:RecordActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {


    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_record);
    dateService=new ClimbDataService();
    list=dateService.getClimbData();
    data=convertDateToMap(list);
    recList=(ListView)findViewById(R.id.recList);
    mGestureDetector=new GestureDetector((OnGestureListener)this);
    RelativeLayout recordlayout=(RelativeLayout)findViewById(R.id.record_layout);
    recordlayout.setOnTouchListener(this);
    recordlayout.setLongClickable(true);
    recList.setOnItemClickListener(new OnItemClickListener() {


        @Override
        public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
                long arg3) {                
            Intent intent=new Intent(RecordActivity.this, RecDetailsActivity.class);
            Bundle bundle=new Bundle();
            bundle.putInt("id", list.get(arg2).getClimbID());
            bundle.putInt("count", list.size());
            intent.putExtras(bundle);
            startActivity(intent);
        }
    });


    SimpleAdapter adapter = new SimpleAdapter(this, data, 
            R.layout.activity_reclist2, new String[] {"name","date"}, new int[]{R.id.recName3,R.id.recDate3});
    recList.setAdapter(adapter);
}
项目:Hi-Top    文件:GpsObtainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_gps);
    mGestureDetector = new GestureDetector((OnGestureListener) this);
    LinearLayout mainlayout = (LinearLayout) findViewById(R.id.gps_main_layout);
    mainlayout.setOnTouchListener(this);
    mainlayout.setLongClickable(true);

}
项目:android.support.v4    文件:GestureDetectorCompat.java   
/**
 * 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);
}
项目:letv    文件:GestureDetectorCompat.java   
public GestureDetectorCompatImplJellybeanMr2(Context context, OnGestureListener listener, Handler handler) {
    this.mDetector = new GestureDetector(context, listener, handler);
}
项目:letv    文件:GestureDetectorCompat.java   
public GestureDetectorCompat(Context context, OnGestureListener listener) {
    this(context, listener, null);
}
项目:exciting-app    文件:ImageViewTouch.java   
protected OnGestureListener getGestureListener() {
    return new GestureListener();
}
项目:MontageCam    文件:ImageViewTouch.java   
protected OnGestureListener getGestureListener() {
    return new GestureListener();
}
项目:boohee_v5.6    文件:GestureDetectorCompat.java   
public GestureDetectorCompatImplJellybeanMr2(Context context, OnGestureListener listener, Handler handler) {
    this.mDetector = new GestureDetector(context, listener, handler);
}
项目:boohee_v5.6    文件:GestureDetectorCompat.java   
public GestureDetectorCompat(Context context, OnGestureListener listener) {
    this(context, listener, null);
}
项目:ForeverLibrary    文件:ImageViewTouch.java   
protected OnGestureListener getGestureListener() {
    return new GestureListener();
}
项目:TAG    文件:ImageViewTouch.java   
protected OnGestureListener getGestureListener() {
    return new GestureListener();
}
项目:PowerScore    文件:SwipeListView.java   
private void init(Context context){
        mScroller = new Scroller(context);
        mTouchSlop = ViewConfiguration.get(getContext()).getScaledTouchSlop();
        screenWidth = ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getWidth();
        mGestureDetector = new GestureDetector(context,new OnGestureListener() {
            @Override
            public boolean onSingleTapUp(MotionEvent e) {
                return false;
            }

            @Override
            public void onShowPress(MotionEvent e) {

            }

            @Override
            public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX,
                                    float distanceY) {
                if (isSlide && currentMoveView!=null) {
                    if (listener!=null) {
                        listener.scroll(currentMoveView.getScrollX(), viewGroup);
                    }
                    currentMoveView.scrollBy((int)distanceX, 0);
                }
                return false;
            }

            @Override
            public void onLongPress(MotionEvent e) {

            }

            @Override
            public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
                                   float velocityY) {
//              if (isSlide && (e2.getX()-e1.getX())<0) {
//                  isFling = true;
//                  Logger.getLogger().i("==============> 快速滑动"+(e2.getX()-e1.getX()));
//              }
                return false;
            }

            @Override
            public boolean onDown(MotionEvent e) {
                return false;
            }

        });
    }
项目:permissionsModule    文件:GestureDetectorCompat.java   
public GestureDetectorCompatImplJellybeanMr2(Context context, OnGestureListener listener,
        Handler handler) {
    mDetector = new GestureDetector(context, listener, handler);
}
项目:PictureBeautify    文件:ImageViewTouch.java   
protected OnGestureListener getGestureListener() {
    return new GestureListener();
}
项目:Android-3DTouch-PeekView    文件:GestureDetectorCompat.java   
public GestureDetectorCompatImplJellybeanMr2(Context context, OnGestureListener listener,
                                             Handler handler) {
    mDetector = new GestureDetector(context, listener, handler);
}
项目:TheSceneryAlong    文件:ImageViewTouch.java   
protected OnGestureListener getGestureListener() {
    return new GestureListener();
}
项目:FMTech    文件:GestureDetectorCompat.java   
public GestureDetectorCompat(Context paramContext, GestureDetector.OnGestureListener paramOnGestureListener)
{
  this(paramContext, paramOnGestureListener, (byte)0);
}