本文整理汇总了Java中android.graphics.RectF.equals方法的典型用法代码示例。如果您正苦于以下问题:Java RectF.equals方法的具体用法?Java RectF.equals怎么用?Java RectF.equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.graphics.RectF
的用法示例。
在下文中一共展示了RectF.equals方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setImageBounds
import android.graphics.RectF; //导入方法依赖的package包/类
/** Sets the image bounds, in view-absolute coordinates. */
@Override
public void setImageBounds(RectF imageBounds) {
if (!imageBounds.equals(mImageBounds)) {
mImageBounds.set(imageBounds);
onTransformChanged();
}
}
示例2: resizingBehaviorApply
import android.graphics.RectF; //导入方法依赖的package包/类
public static void resizingBehaviorApply(ResizingBehavior behavior, RectF rect, RectF target, RectF result) {
if (rect.equals(target) || target == null) {
result.set(rect);
return;
}
if (behavior == ResizingBehavior.Stretch) {
result.set(target);
return;
}
float xRatio = Math.abs(target.width() / rect.width());
float yRatio = Math.abs(target.height() / rect.height());
float scale = 0f;
switch (behavior) {
case AspectFit: {
scale = Math.min(xRatio, yRatio);
break;
}
case AspectFill: {
scale = Math.max(xRatio, yRatio);
break;
}
case Center: {
scale = 1f;
break;
}
default:
break;
}
float newWidth = Math.abs(rect.width() * scale);
float newHeight = Math.abs(rect.height() * scale);
result.set(target.centerX() - newWidth / 2,
target.centerY() - newHeight / 2,
target.centerX() + newWidth / 2,
target.centerY() + newHeight / 2);
}
示例3: setImageBounds
import android.graphics.RectF; //导入方法依赖的package包/类
/**
* Sets the image bounds, in view-absolute coordinates.
*/
@Override
public void setImageBounds(RectF imageBounds) {
if (!imageBounds.equals(mImageBounds)) {
mImageBounds.set(imageBounds);
onTransformChanged();
}
}
示例4: setContentSize
import android.graphics.RectF; //导入方法依赖的package包/类
/**
* Notifies the helper of the content size (be it a child View, a Bitmap, or whatever else).
* This is needed for the helper to start working.
*
* @param rect the content rect
*/
public void setContentSize(RectF rect) {
if (rect.width() <= 0 || rect.height() <= 0) return;
if (!rect.equals(mContentBaseRect)) {
init(mViewWidth, mViewHeight, rect);
}
}