• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java RotateGestureDetector类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.almeros.android.multitouch.RotateGestureDetector的典型用法代码示例。如果您正苦于以下问题:Java RotateGestureDetector类的具体用法?Java RotateGestureDetector怎么用?Java RotateGestureDetector使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RotateGestureDetector类属于com.almeros.android.multitouch包,在下文中一共展示了RotateGestureDetector类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: init

import com.almeros.android.multitouch.RotateGestureDetector; //导入依赖的package包/类
private void init(@NonNull Context context) {
    // I fucking love Android
    setWillNotDraw(false);

    selectedLayerPaint = new Paint();
    selectedLayerPaint.setAlpha((int) (255 * Constants.SELECTED_LAYER_ALPHA));
    selectedLayerPaint.setAntiAlias(true);

    // init listeners
    this.scaleGestureDetector = new ScaleGestureDetector(context, new ScaleListener());
    this.rotateGestureDetector = new RotateGestureDetector(context, new RotateListener());
    this.moveGestureDetector = new MoveGestureDetector(context, new MoveListener());
    this.gestureDetectorCompat = new GestureDetectorCompat(context, new TapsListener());

    setOnTouchListener(onTouchListener);

    updateUI();
}
 
开发者ID:uptechteam,项目名称:MotionViews-Android,代码行数:19,代码来源:MotionView.java


示例2: onRotate

import com.almeros.android.multitouch.RotateGestureDetector; //导入依赖的package包/类
@Override
public boolean onRotate(RotateGestureDetector detector) {
    if (selectedEntity != null) {
        selectedEntity.getLayer().postRotate(-detector.getRotationDegreesDelta());
        updateUI();
    }
    return true;
}
 
开发者ID:uptechteam,项目名称:MotionViews-Android,代码行数:9,代码来源:MotionView.java


示例3: onCreate

import com.almeros.android.multitouch.RotateGestureDetector; //导入依赖的package包/类
@SuppressWarnings("deprecation")
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.main);

	// Determine the center of the screen to center 'earth'
	Display display = getWindowManager().getDefaultDisplay();
	mFocusX = display.getWidth()/2f;
	mFocusY = display.getHeight()/2f;
	
	// Set this class as touchListener to the ImageView
	ImageView view = (ImageView) findViewById(R.id.imageView);
	view.setOnTouchListener(this);
	
	// Determine dimensions of 'earth' image
	Drawable d 		= this.getResources().getDrawable(R.drawable.earth);
	mImageHeight 	= d.getIntrinsicHeight();
	mImageWidth 	= d.getIntrinsicWidth();

	// View is scaled and translated by matrix, so scale and translate initially
       float scaledImageCenterX = (mImageWidth*mScaleFactor)/2; 
       float scaledImageCenterY = (mImageHeight*mScaleFactor)/2;
       
	mMatrix.postScale(mScaleFactor, mScaleFactor);
	mMatrix.postTranslate(mFocusX - scaledImageCenterX, mFocusY - scaledImageCenterY);
	view.setImageMatrix(mMatrix);

	// Setup Gesture Detectors
	mScaleDetector 	= new ScaleGestureDetector(getApplicationContext(), new ScaleListener());
	mRotateDetector = new RotateGestureDetector(getApplicationContext(), new RotateListener());
	mMoveDetector 	= new MoveGestureDetector(getApplicationContext(), new MoveListener());
	mShoveDetector 	= new ShoveGestureDetector(getApplicationContext(), new ShoveListener());
}
 
开发者ID:JoeySheng,项目名称:AndroidGestureDetector,代码行数:35,代码来源:TouchActivity.java


示例4: PhotoViewAttacher

import com.almeros.android.multitouch.RotateGestureDetector; //导入依赖的package包/类
public PhotoViewAttacher(ImageView imageView, boolean zoomable) {
    mImageView = new WeakReference<>(imageView);

    imageView.setDrawingCacheEnabled(true);
    imageView.setOnTouchListener(this);

    ViewTreeObserver observer = imageView.getViewTreeObserver();
    if (null != observer)
        observer.addOnGlobalLayoutListener(this);

    // Make sure we using MATRIX Scale Type
    setImageViewScaleTypeMatrix(imageView);

    if (imageView.isInEditMode()) {
        return;
    }
    // Create Gesture Detectors...
    mScaleDragDetector = VersionedGestureDetector.newInstance(
            imageView.getContext(), this);

    mGestureDetector = new GestureDetector(imageView.getContext(),
            new GestureDetector.SimpleOnGestureListener() {

                // forward long click listener
                @Override
                public void onLongPress(MotionEvent e) {
                    if (null != mLongClickListener) {
                        mLongClickListener.onLongClick(getImageView());
                    }
                }
            });

    mGestureDetector.setOnDoubleTapListener(new DefaultOnDoubleTapListener(this));

    mRotateGestureDetector = new RotateGestureDetector(imageView.getContext(), this);

    // Finally, update the UI so that we're zoomable
    setZoomable(zoomable);
}
 
开发者ID:seven332,项目名称:Nimingban,代码行数:40,代码来源:PhotoViewAttacher.java


示例5: onRotate

import com.almeros.android.multitouch.RotateGestureDetector; //导入依赖的package包/类
@Override
public boolean onRotate(RotateGestureDetector detector) {
    float deltaRotate = -detector.getRotationDegreesDelta();
    mOnceRotate += deltaRotate;

    if (mIsRotate || (!mIsScale && Math.abs(mOnceRotate) > 5)) {
        mIsRotate = true;
        mRotate += deltaRotate;
        mSuppMatrix.postRotate(deltaRotate, mFocusX, mFocusY);
        checkAndDisplayMatrix();
    }

    return true;
}
 
开发者ID:seven332,项目名称:Nimingban,代码行数:15,代码来源:PhotoViewAttacher.java


示例6: onRotateEnd

import com.almeros.android.multitouch.RotateGestureDetector; //导入依赖的package包/类
@Override
public void onRotateEnd(RotateGestureDetector detector) {
    ImageView imageView = getImageView();
    if (imageView != null) {
        mStopRotate = getNewStopRotate(mRotate, mStopRotate);
        imageView.post(new RotateRunnable(mRotate, mStopRotate));
    }
}
 
开发者ID:seven332,项目名称:Nimingban,代码行数:9,代码来源:PhotoViewAttacher.java


示例7: onRotate

import com.almeros.android.multitouch.RotateGestureDetector; //导入依赖的package包/类
@Override
public boolean onRotate(RotateGestureDetector detector) {

    if (mPhotoView != null) {
        float degree = detector.getRotationDegreesDelta();
        mPhotoView.setRotation(-degree + rotate);
    }
    return false;
}
 
开发者ID:kurumi-moe,项目名称:MoeGallery,代码行数:10,代码来源:ImageFragment.java


示例8: onRotateBegin

import com.almeros.android.multitouch.RotateGestureDetector; //导入依赖的package包/类
@Override
public boolean onRotateBegin(RotateGestureDetector detector) {
    mDraggableLayout.setDraggable(false);
    if (getActivity() != null) {
        ((MainActivity) getActivity()).setPagingEnabled(false);
    }
    //rotate = mDataSource.getRotate(mUri);
    return true;
}
 
开发者ID:kurumi-moe,项目名称:MoeGallery,代码行数:10,代码来源:ImageFragment.java


示例9: onRotateEnd

import com.almeros.android.multitouch.RotateGestureDetector; //导入依赖的package包/类
@Override
public void onRotateEnd(RotateGestureDetector detector) {
    if (mPhotoView != null) {
        // set rotation and save state
        float degree = -detector.getRotationDegreesDelta() + rotate;

        int n = Math.round(degree / 90);
        n = n % 4;
        if (n < 0) {
            n += 4;
        }
        switch (n) {
            case 0:
                mPhotoView.setRotation(0);
                break;
            case 1:
                mPhotoView.setRotation(90);
                break;
            case 2:
                mPhotoView.setRotation(180);
                break;
            case 3:
                mPhotoView.setRotation(270);
                break;
        }
        //mDataSource.setRotate(mUri, (int) mPhotoView.getRotation());
        rotate = 0;
    }

    mDraggableLayout.setDraggable(true);

    if (getActivity() != null) {
        ((MainActivity) getActivity()).setPagingEnabled(true);
    }
}
 
开发者ID:kurumi-moe,项目名称:MoeGallery,代码行数:36,代码来源:ImageFragment.java


示例10: onRotate

import com.almeros.android.multitouch.RotateGestureDetector; //导入依赖的package包/类
@Override
public boolean onRotate(RotateGestureDetector detector) {
    float delta = detector.getRotationDegreesDelta();
    currentDelta += delta;
    float newAngle = firstAngle - currentDelta;
    mapView.setMapOrientation(newAngle);

    // If a listener has been set, callback
    OnMapOrientationChangeListener l = mapView.getOnMapOrientationChangeListener();
    if (l != null) {
        l.onMapOrientationChange(newAngle);
    }
    return true;
}
 
开发者ID:RoProducts,项目名称:rastertheque,代码行数:15,代码来源:MapViewRotateGestureDetectorListener.java


示例11: onRotate

import com.almeros.android.multitouch.RotateGestureDetector; //导入依赖的package包/类
@Override
public boolean onRotate(RotateGestureDetector detector) {
	mRotationDegrees -= detector.getRotationDegreesDelta();
	return true;
}
 
开发者ID:JoeySheng,项目名称:AndroidGestureDetector,代码行数:6,代码来源:TouchActivity.java


示例12: onRotateBegin

import com.almeros.android.multitouch.RotateGestureDetector; //导入依赖的package包/类
@Override
public boolean onRotateBegin(RotateGestureDetector detector) {
    mOnceRotate = 0;
    mIsRotate = false;
    return true;
}
 
开发者ID:seven332,项目名称:Nimingban,代码行数:7,代码来源:PhotoViewAttacher.java


示例13: onRotateBegin

import com.almeros.android.multitouch.RotateGestureDetector; //导入依赖的package包/类
@Override
public boolean onRotateBegin(RotateGestureDetector detector) {
    firstAngle = mapView.getMapOrientation();
    currentDelta = 0;
    return true;
}
 
开发者ID:RoProducts,项目名称:rastertheque,代码行数:7,代码来源:MapViewRotateGestureDetectorListener.java


示例14: onRotateEnd

import com.almeros.android.multitouch.RotateGestureDetector; //导入依赖的package包/类
@Override
public void onRotateEnd(RotateGestureDetector detector) {

}
 
开发者ID:RoProducts,项目名称:rastertheque,代码行数:5,代码来源:MapViewRotateGestureDetectorListener.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Service类代码示例发布时间:2022-05-23
下一篇:
Java Filter类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap