本文整理汇总了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;未经允许,请勿转载。 |
请发表评论