当前位置: 首页>>代码示例>>Java>>正文


Java ScaleGestureDetectorCompat.setQuickScaleEnabled方法代码示例

本文整理汇总了Java中android.support.v4.view.ScaleGestureDetectorCompat.setQuickScaleEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java ScaleGestureDetectorCompat.setQuickScaleEnabled方法的具体用法?Java ScaleGestureDetectorCompat.setQuickScaleEnabled怎么用?Java ScaleGestureDetectorCompat.setQuickScaleEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.support.v4.view.ScaleGestureDetectorCompat的用法示例。


在下文中一共展示了ScaleGestureDetectorCompat.setQuickScaleEnabled方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ZoomageView

import android.support.v4.view.ScaleGestureDetectorCompat; //导入方法依赖的package包/类
public ZoomageView(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);
    scaleDetector = new ScaleGestureDetector(context, this);
    ScaleGestureDetectorCompat.setQuickScaleEnabled(scaleDetector, false);
    startScaleType = getScaleType();

    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();
}
 
开发者ID:jsibbold,项目名称:zoomage,代码行数:22,代码来源:ZoomageView.java

示例2: onAttachedToWindow

import android.support.v4.view.ScaleGestureDetectorCompat; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.KITKAT)
protected void onAttachedToWindow() {
    super.onAttachedToWindow();
    this.velocityTracker = VelocityTracker.obtain();
    this.interpolatorFling = new FoldInterpolator();
    this.interpolatorTap = new AccelerateDecelerateInterpolator();
    this.pinchDetector = new ScaleGestureDetector(getContext(), this);
    ScaleGestureDetectorCompat.setQuickScaleEnabled(pinchDetector, false);
    this.viewConfig = ViewConfiguration.get(getContext());
}
 
开发者ID:dodola,项目名称:ListItemFold,代码行数:11,代码来源:FoldLayout.java

示例3: PanScaleProxyView

import android.support.v4.view.ScaleGestureDetectorCompat; //导入方法依赖的package包/类
public PanScaleProxyView(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);

    setWillNotDraw(true);

    // 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);
}
 
开发者ID:chrislacy,项目名称:AndroidLiveWallpaperHelloWorld,代码行数:14,代码来源:PanScaleProxyView.java

示例4: onDoubleTapEvent

import android.support.v4.view.ScaleGestureDetectorCompat; //导入方法依赖的package包/类
@Override
public boolean onDoubleTapEvent(MotionEvent e) {
    if (!mPanScaleEnabled || mDragZoomed || e.getActionMasked() != MotionEvent.ACTION_UP) {
        return false;
    }

    mZoomer.forceFinished(true);
    hitTest(e.getX(), e.getY(), mZoomFocalPoint);
    float startZoom;
    if (mRelativeAspectRatio > 1) {
        startZoom = 1 / mCurrentViewport.height();
    } else {
        startZoom = 1 / mCurrentViewport.width();
    }
    boolean zoomIn = (startZoom < 1.5f);
    mZoomer.startZoom(startZoom, zoomIn ? 2f : 1f);
    triggerViewportChangedListener();
    postAnimateTick();
    mNonSingleTapGesture = true;
    mNonSingleTapZoomedOut = !zoomIn;

    // Workaround for 11952668; blow away the entire scale gesture detector after
    // a double tap
    mScaleGestureDetector = new ScaleGestureDetector(getContext(), mScaleGestureListener);
    ScaleGestureDetectorCompat.setQuickScaleEnabled(mScaleGestureDetector, true);
    return true;
}
 
开发者ID:chrislacy,项目名称:AndroidLiveWallpaperHelloWorld,代码行数:28,代码来源:PanScaleProxyView.java

示例5: init

import android.support.v4.view.ScaleGestureDetectorCompat; //导入方法依赖的package包/类
private void init() {
	ScaleGestureDetectorCompat.setQuickScaleEnabled(scaleGestureDetector, true);
	final ViewConfiguration configuration = ViewConfiguration.get(getContext());
	mTouchSlop = configuration.getScaledTouchSlop();
}
 
开发者ID:jksiezni,项目名称:xpra-client,代码行数:6,代码来源:XYScrollView.java

示例6: TouchGestureDetector

import android.support.v4.view.ScaleGestureDetectorCompat; //导入方法依赖的package包/类
public TouchGestureDetector(Context context, OnTouchGestureListener listener) {
	mGestureDetector = new GestureDetectorCompat(context, listener);
	mGestureDetector.setOnDoubleTapListener(listener);
	mScaleGestureDetector = new ScaleGestureDetector(context, listener);
	ScaleGestureDetectorCompat.setQuickScaleEnabled(mScaleGestureDetector, false);
}
 
开发者ID:yrom,项目名称:AcFun-Area63,代码行数:7,代码来源:TouchGestureDetector.java

示例7: create

import android.support.v4.view.ScaleGestureDetectorCompat; //导入方法依赖的package包/类
public void create() {
  gestureDetector = new GestureDetectorCompat(view.getContext(), gestureListener);
  scaleGestureDetector = new ScaleGestureDetector(view.getContext(), scaleGestureListener);
  ScaleGestureDetectorCompat.setQuickScaleEnabled(scaleGestureDetector, true);
  view.setOnTouchListener(onTouchListener);
}
 
开发者ID:codeka,项目名称:wwmmo,代码行数:7,代码来源:StarfieldGestureDetector.java


注:本文中的android.support.v4.view.ScaleGestureDetectorCompat.setQuickScaleEnabled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。