本文整理汇总了Java中android.graphics.RectF.isEmpty方法的典型用法代码示例。如果您正苦于以下问题:Java RectF.isEmpty方法的具体用法?Java RectF.isEmpty怎么用?Java RectF.isEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.graphics.RectF
的用法示例。
在下文中一共展示了RectF.isEmpty方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: canScrollHorizontally
import android.graphics.RectF; //导入方法依赖的package包/类
/**
* 与ViewPager结合的时候使用
* @param direction
* @return
*/
@Override
public boolean canScrollHorizontally(int direction) {
if (mPinchMode == PinchImageView.PINCH_MODE_SCALE) {
return true;
}
RectF bound = getImageBound(null);
if (bound == null) {
return false;
}
if (bound.isEmpty()) {
return false;
}
if (direction > 0) {
return bound.right > getWidth();
} else {
return bound.left < 0;
}
}
示例2: canScrollVertically
import android.graphics.RectF; //导入方法依赖的package包/类
/**
* 与ViewPager结合的时候使用
* @param direction
* @return
*/
@Override
public boolean canScrollVertically(int direction) {
if (mPinchMode == PinchImageView.PINCH_MODE_SCALE) {
return true;
}
RectF bound = getImageBound(null);
if (bound == null) {
return false;
}
if (bound.isEmpty()) {
return false;
}
if (direction > 0) {
return bound.bottom > getHeight();
} else {
return bound.top < 0;
}
}
示例3: canScrollHorizontally
import android.graphics.RectF; //导入方法依赖的package包/类
/**
* 与ViewPager结合的时候使用
*
* @param direction
* @return
*/
@Override
public boolean canScrollHorizontally(int direction) {
if (mPinchMode == PinchImageView.PINCH_MODE_SCALE) {
return true;
}
RectF bound = getImageBound(null);
if (bound == null) {
return false;
}
if (bound.isEmpty()) {
return false;
}
if (direction > 0) {
return bound.right > getWidth();
} else {
return bound.left < 0;
}
}
示例4: canScrollVertically
import android.graphics.RectF; //导入方法依赖的package包/类
/**
* 与ViewPager结合的时候使用
*
* @param direction
* @return
*/
@Override
public boolean canScrollVertically(int direction) {
if (mPinchMode == PinchImageView.PINCH_MODE_SCALE) {
return true;
}
RectF bound = getImageBound(null);
if (bound == null) {
return false;
}
if (bound.isEmpty()) {
return false;
}
if (direction > 0) {
return bound.bottom > getHeight();
} else {
return bound.top < 0;
}
}
示例5: compare
import android.graphics.RectF; //导入方法依赖的package包/类
@Override
public PhotoSize compare(@NonNull RectF photo, @NonNull RectF container) {
if (photo.isEmpty())
return PhotoSize.small;
if (photo.width() < container.width()
&& photo.height() < container.height())
return PhotoSize.small;
else if (photo.width() > container.width()
&& photo.height() > container.height())
return PhotoSize.large;
return PhotoSize.middle;
}
示例6: cropImage
import android.graphics.RectF; //导入方法依赖的package包/类
@Nullable
public Bitmap cropImage() {
Bitmap viewBitmap = getViewBitmap();
if (viewBitmap == null || viewBitmap.isRecycled()) {
return null;
}
cancelAllAnimations();
setImageToWrapCropBounds(false);
RectF currentImageRect = RectUtils.trapToRect(this.mCurrentImageCorners);
if (currentImageRect.isEmpty()) {
return null;
}
float currentScale = getCurrentScale();
float currentAngle = getCurrentAngle();
if (this.mMaxResultImageSizeX > 0 && this.mMaxResultImageSizeY > 0) {
float cropWidth = this.mCropRect.width() / currentScale;
float cropHeight = this.mCropRect.height() / currentScale;
if (cropWidth > ((float) this.mMaxResultImageSizeX) || cropHeight > ((float) this
.mMaxResultImageSizeY)) {
float resizeScale = Math.min(((float) this.mMaxResultImageSizeX) / cropWidth, (
(float) this.mMaxResultImageSizeY) / cropHeight);
Bitmap resizedBitmap = Bitmap.createScaledBitmap(viewBitmap, (int) (((float)
viewBitmap.getWidth()) * resizeScale), (int) (((float) viewBitmap
.getHeight()) * resizeScale), false);
if (viewBitmap != resizedBitmap) {
viewBitmap.recycle();
}
viewBitmap = resizedBitmap;
currentScale /= resizeScale;
}
}
if (currentAngle != 0.0f) {
this.mTempMatrix.reset();
this.mTempMatrix.setRotate(currentAngle, (float) (viewBitmap.getWidth() / 2), (float)
(viewBitmap.getHeight() / 2));
Bitmap rotatedBitmap = Bitmap.createBitmap(viewBitmap, 0, 0, viewBitmap.getWidth(),
viewBitmap.getHeight(), this.mTempMatrix, true);
if (viewBitmap != rotatedBitmap) {
viewBitmap.recycle();
}
viewBitmap = rotatedBitmap;
}
return Bitmap.createBitmap(viewBitmap, (int) ((this.mCropRect.left - currentImageRect
.left) / currentScale), (int) ((this.mCropRect.top - currentImageRect.top) /
currentScale), (int) (this.mCropRect.width() / currentScale), (int) (this
.mCropRect.height() / currentScale));
}