Example usage for android.support.v4.view ScaleGestureDetectorCompat setQuickScaleEnabled

List of usage examples for android.support.v4.view ScaleGestureDetectorCompat setQuickScaleEnabled

Introduction

In this page you can find the example usage for android.support.v4.view ScaleGestureDetectorCompat setQuickScaleEnabled.

Prototype

public static void setQuickScaleEnabled(Object obj, boolean z) 

Source Link

Usage

From source file:com.jsibbold.zoomage.ZoomageView.java

public ZoomageView(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);
    scaleDetector = new ScaleGestureDetector(context, this);
    ScaleGestureDetectorCompat.setQuickScaleEnabled(scaleDetector, false);
    startScaleType = getScaleType();//from  w  ww .jav  a  2  s. c  o m

    TypedArray values = context.obtainStyledAttributes(attrs, com.jsibbold.zoomage.R.styleable.ZoomageView);

    zoomable = values.getBoolean(com.jsibbold.zoomage.R.styleable.ZoomageView_zoomage_zoomable, true);
    translatable = values.getBoolean(com.jsibbold.zoomage.R.styleable.ZoomageView_zoomage_translatable, true);
    animateOnReset = values.getBoolean(com.jsibbold.zoomage.R.styleable.ZoomageView_zoomage_animateOnReset,
            true);
    autoCenter = values.getBoolean(R.styleable.ZoomageView_zoomage_autoCenter, true);
    restrictBounds = values.getBoolean(com.jsibbold.zoomage.R.styleable.ZoomageView_zoomage_restrictBounds,
            false);
    minScale = values.getFloat(com.jsibbold.zoomage.R.styleable.ZoomageView_zoomage_minScale, MIN_SCALE);
    maxScale = values.getFloat(com.jsibbold.zoomage.R.styleable.ZoomageView_zoomage_maxScale, MAX_SCALE);
    autoResetMode = AutoResetMode.Parser.fromInt(values
            .getInt(com.jsibbold.zoomage.R.styleable.ZoomageView_zoomage_autoResetMode, AutoResetMode.UNDER));

    verifyScaleRange();

    values.recycle();
}

From source file:com.google.android.apps.muzei.util.PanScaleProxyView.java

public PanScaleProxyView(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);

    setWillNotDraw(true);//from   w  ww.ja v a  2s  .  c o  m

    // Sets up interactions
    mScaleGestureDetector = new ScaleGestureDetector(context, mScaleGestureListener);
    ScaleGestureDetectorCompat.setQuickScaleEnabled(mScaleGestureDetector, true);
    mGestureDetector = new GestureDetectorCompat(context, mGestureListener);

    mScroller = new OverScroller(context);
    mZoomer = new Zoomer(context);
}