use of android.view.GestureDetector in project PhotoPicker by donglua.
the class TouchImageView method sharedConstructing.
private void sharedConstructing(Context context) {
super.setClickable(true);
this.context = context;
mScaleDetector = new ScaleGestureDetector(context, new ScaleListener());
mGestureDetector = new GestureDetector(context, new GestureListener());
matrix = new Matrix();
prevMatrix = new Matrix();
m = new float[9];
normalizedScale = 1;
if (mScaleType == null) {
mScaleType = ScaleType.FIT_CENTER;
}
minScale = 1;
maxScale = 3;
superMinScale = SUPER_MIN_MULTIPLIER * minScale;
superMaxScale = SUPER_MAX_MULTIPLIER * maxScale;
setImageMatrix(matrix);
setScaleType(ScaleType.MATRIX);
setState(State.NONE);
onDrawReady = false;
super.setOnTouchListener(new PrivateOnTouchListener());
}
use of android.view.GestureDetector in project ActivityAnimationLib by dkmeteor.
the class FoldingLayout method init.
public void init(Context context, AttributeSet attrs) {
mScrollGestureDetector = new GestureDetector(context, new ScrollGestureDetector());
mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
setAnchorFactor(0);
super.init(context, attrs);
}
use of android.view.GestureDetector in project TinyDancer by friendlyrobotnyc.
the class TinyCoach method addViewToWindow.
private void addViewToWindow(View view) {
WindowManager.LayoutParams paramsF = new WindowManager.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.TYPE_PHONE, WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, PixelFormat.TRANSLUCENT);
// configure starting coordinates
if (fpsConfig.xOrYSpecified) {
paramsF.x = fpsConfig.startingXPosition;
paramsF.y = fpsConfig.startingYPosition;
paramsF.gravity = FPSConfig.DEFAULT_GRAVITY;
} else if (fpsConfig.gravitySpecified) {
paramsF.x = 0;
paramsF.y = 0;
paramsF.gravity = fpsConfig.startingGravity;
} else {
paramsF.gravity = FPSConfig.DEFAULT_GRAVITY;
paramsF.x = fpsConfig.startingXPosition;
paramsF.y = fpsConfig.startingYPosition;
}
// add view to the window
windowManager.addView(view, paramsF);
// create gesture detector to listen for double taps
GestureDetector gestureDetector = new GestureDetector(view.getContext(), simpleOnGestureListener);
// attach touch listener
view.setOnTouchListener(new DancerTouchListener(paramsF, windowManager, gestureDetector));
// disable haptic feedback
view.setHapticFeedbackEnabled(false);
// show the meter
show();
}
use of android.view.GestureDetector in project fresco by facebook.
the class ZoomableDraweeView method init.
private void init() {
mZoomableController = createZoomableController();
mZoomableController.setListener(mZoomableListener);
mTapGestureDetector = new GestureDetector(getContext(), mTapListenerWrapper);
}
use of android.view.GestureDetector in project jmonkeyengine by jMonkeyEngine.
the class AndroidInputHandler method addListeners.
protected void addListeners(GLSurfaceView view) {
view.setOnTouchListener(this);
view.setOnKeyListener(this);
AndroidGestureProcessor gestureHandler = new AndroidGestureProcessor(touchInput);
touchInput.setGestureDetector(new GestureDetector(view.getContext(), gestureHandler));
touchInput.setScaleDetector(new ScaleGestureDetector(view.getContext(), gestureHandler));
}
Aggregations