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

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

Introduction

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

Prototype

public static boolean isQuickScaleEnabled(Object obj) 

Source Link

Usage

From source file:com.android.volley.ui.PhotoView.java

/**
 * Initializes the header and any static values
 *//*from  w w  w . jav a2 s. co  m*/
private void initialize() {
    Context context = getContext();

    if (!sInitialized) {
        sInitialized = true;

        Resources resources = context.getApplicationContext().getResources();

        sCropSize = resources.getDimensionPixelSize(R.dimen.photo_crop_width);

        sCropDimPaint = new Paint();
        sCropDimPaint.setAntiAlias(true);
        sCropDimPaint.setColor(resources.getColor(R.color.photo_crop_dim_color));
        sCropDimPaint.setStyle(Style.FILL);

        sCropPaint = new Paint();
        sCropPaint.setAntiAlias(true);
        sCropPaint.setColor(resources.getColor(R.color.photo_crop_highlight_color));
        sCropPaint.setStyle(Style.STROKE);
        sCropPaint.setStrokeWidth(resources.getDimension(R.dimen.photo_crop_stroke_width));

        final ViewConfiguration configuration = ViewConfiguration.get(context);
        final int touchSlop = configuration.getScaledTouchSlop();
        sTouchSlopSquare = touchSlop * touchSlop;
    }

    mGestureDetector = new GestureDetectorCompat(context, this, null);
    mScaleGetureDetector = new ScaleGestureDetector(context, this);
    mQuickScaleEnabled = ScaleGestureDetectorCompat.isQuickScaleEnabled(mScaleGetureDetector);
    mScaleRunnable = new ScaleRunnable(this);
    mTranslateRunnable = new TranslateRunnable(this);
    mSnapRunnable = new SnapRunnable(this);
    mRotateRunnable = new RotateRunnable(this);
}

From source file:cl.monsoon.s1next.widget.PhotoView.java

/**
 * Initializes the header and any static values
 *//* w ww . j a  v a2  s.c om*/
private void initialize() {
    Context context = getContext();

    if (!sInitialized) {
        sInitialized = true;

        Resources resources = context.getResources();

        sCropSize = resources.getDimensionPixelSize(R.dimen.photo_view_crop_width);

        sCropDimPaint = new Paint();
        sCropDimPaint.setAntiAlias(true);
        sCropDimPaint.setColor(ContextCompat.getColor(context, R.color.photo_view_crop_dim_color));
        sCropDimPaint.setStyle(Style.FILL);

        sCropPaint = new Paint();
        sCropPaint.setAntiAlias(true);
        sCropPaint.setColor(ContextCompat.getColor(context, R.color.photo_view_crop_dim_color));
        sCropPaint.setStyle(Style.STROKE);
        sCropPaint.setStrokeWidth(resources.getDimension(R.dimen.photo_view_crop_stroke_width));

        final ViewConfiguration configuration = ViewConfiguration.get(context);
        final int touchSlop = configuration.getScaledTouchSlop();
        sTouchSlopSquare = touchSlop * touchSlop;
    }

    mGestureDetector = new GestureDetectorCompat(context, this, null);
    scaleGestureDetector = new ScaleGestureDetector(context, this);
    mQuickScaleEnabled = ScaleGestureDetectorCompat.isQuickScaleEnabled(scaleGestureDetector);
    mScaleRunnable = new ScaleRunnable(this);
    mTranslateRunnable = new TranslateRunnable(this);
    mSnapRunnable = new SnapRunnable(this);
    mRotateRunnable = new RotateRunnable(this);
}

From source file:martin.app.bitunion.widget.PhotoView.java

/**
 * Initializes the header and any static values
 */// ww w .ja v  a  2s.co  m
private void initialize() {
    Context context = getContext();

    if (!sInitialized) {
        sInitialized = true;

        Resources resources = context.getApplicationContext().getResources();

        //            sCropSize = TypedValue.complexToDimensionPixelSize(120, resources.getDisplayMetrics());

        sCropDimPaint = new Paint();
        sCropDimPaint.setAntiAlias(true);
        //            sCropDimPaint.setColor(0xcc000000);
        sCropDimPaint.setStyle(Paint.Style.FILL);

        sCropPaint = new Paint();
        sCropPaint.setAntiAlias(true);
        //            sCropPaint.setColor(Color.WHITE);
        sCropPaint.setStyle(Paint.Style.STROKE);
        //            sCropPaint.setStrokeWidth(TypedValue.complexToDimensionPixelSize(1, resources.getDisplayMetrics()));

        final ViewConfiguration configuration = ViewConfiguration.get(context);
        final int touchSlop = configuration.getScaledTouchSlop();
        sTouchSlopSquare = touchSlop * touchSlop;
    }

    mGestureDetector = new GestureDetectorCompat(context, this, null);
    mScaleGetureDetector = new ScaleGestureDetector(context, this);
    mQuickScaleEnabled = ScaleGestureDetectorCompat.isQuickScaleEnabled(mScaleGetureDetector);
    mScaleRunnable = new ScaleRunnable(this);
    mTranslateRunnable = new TranslateRunnable(this);
    mSnapRunnable = new SnapRunnable(this);
    mRotateRunnable = new RotateRunnable(this);
}