本文整理匯總了Java中android.graphics.Rect.equals方法的典型用法代碼示例。如果您正苦於以下問題:Java Rect.equals方法的具體用法?Java Rect.equals怎麽用?Java Rect.equals使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.graphics.Rect
的用法示例。
在下文中一共展示了Rect.equals方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: findAccessibilityNodeInfosByBounds
import android.graphics.Rect; //導入方法依賴的package包/類
private void findAccessibilityNodeInfosByBounds(UiObject root, List<UiObject> list) {
if (root == null)
return;
Rect rect = new Rect();
root.getBoundsInScreen(rect);
if (rect.equals(mBoundsInScreen)) {
list.add(root);
}
int oldSize = list.size();
for (int i = 0; i < root.getChildCount(); i++) {
UiObject child = root.child(i);
if (child == null)
continue;
findAccessibilityNodeInfosByBounds(child, list);
}
if (oldSize == list.size() && rect.contains(mBoundsInScreen)) {
list.add(root);
}
}
示例2: onLayout
import android.graphics.Rect; //導入方法依賴的package包/類
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
int width = getMeasuredWidth();
int height = getMeasuredHeight();
layoutSubView(mSearch, mActionGap, 0);
layoutSubView(mShare, 2 * mActionGap + mSearch.getMeasuredWidth(), 0);
layoutSubView(mTrans, 3 * mActionGap + mTrans.getMeasuredWidth() + mShare.getMeasuredWidth(), 0);
// layoutSubView(mSelectAll, 2 * mActionGap + mSearch.getMeasuredWidth() , 0);
// layoutSubView(mSelectOther, 3 * mActionGap + mTrans.getMeasuredWidth()+ mShare.getMeasuredWidth() , 0);
//
// layoutSubView(mDrag, width - mActionGap * 2 - mShare.getMeasuredWidth() - mCopy.getMeasuredWidth(), 0);
layoutSubView(mCopy, width - mActionGap - mCopy.getMeasuredWidth(), 0);
layoutSubView(mClose, ((width - (this.mActionGap * 2)) - this.mCopy.getMeasuredWidth()) - this.mClose.getMeasuredHeight(), 0);
Rect oldBounds = mBorder.getBounds();
Rect newBounds = new Rect(0, mSearch.getMeasuredHeight() / 2, width, height);
if (!stickHeader && !oldBounds.equals(newBounds)) {
ObjectAnimator.ofObject(new BoundWrapper(oldBounds), "bound", new RectEvaluator(), oldBounds, newBounds).setDuration(200).start();
}
}
示例3: onLayout
import android.graphics.Rect; //導入方法依賴的package包/類
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
int width = getMeasuredWidth();
int height = getMeasuredHeight();
layoutSubView(mSearch, mActionGap, 0);
layoutSubView(mShare, 2 * mActionGap + mSearch.getMeasuredWidth() , 0);
layoutSubView(mTrans, 3 * mActionGap + mTrans.getMeasuredWidth()+ mShare.getMeasuredWidth() , 0);
// layoutSubView(mSelectAll, 2 * mActionGap + mSearch.getMeasuredWidth() , 0);
// layoutSubView(mSelectOther, 3 * mActionGap + mTrans.getMeasuredWidth()+ mShare.getMeasuredWidth() , 0);
//
// layoutSubView(mDrag, width - mActionGap * 2 - mShare.getMeasuredWidth() - mCopy.getMeasuredWidth(), 0);
layoutSubView(mCopy, width - mActionGap - mCopy.getMeasuredWidth(), 0);
Rect oldBounds = mBorder.getBounds();
Rect newBounds = new Rect(0, mSearch.getMeasuredHeight() / 2, width, height);
if (!stickHeader && !oldBounds.equals(newBounds)) {
ObjectAnimator.ofObject(new BoundWrapper(oldBounds), "bound", new RectEvaluator(), oldBounds, newBounds).setDuration(200).start();
}
}
示例4: isIncluded
import android.graphics.Rect; //導入方法依賴的package包/類
@Override
protected boolean isIncluded(UiObject nodeInfo) {
if (mType == TYPE_CONTAINS) {
return AccessibilityNodeInfoHelper.getBoundsInScreen(nodeInfo).contains(mBounds);
}
Rect boundsInScreen = AccessibilityNodeInfoHelper.getBoundsInScreen(nodeInfo);
if (mType == TYPE_EQUALS)
return boundsInScreen.equals(mBounds);
return mBounds.contains(boundsInScreen);
}
示例5: forNewBounds
import android.graphics.Rect; //導入方法依賴的package包/類
@Override
public AnimatedDrawableBackend forNewBounds(Rect bounds) {
Rect boundsToUse = getBoundsToUse(mAnimatedImage, bounds);
if (boundsToUse.equals(mRenderedBounds)) {
// Actual bounds aren't changed.
return this;
}
return new AnimatedDrawableBackendImpl(
mAnimatedDrawableUtil,
mAnimatedImageResult,
bounds);
}
示例6: setInsets
import android.graphics.Rect; //導入方法依賴的package包/類
@Override
public void setInsets(Rect insets) {
// If the insets haven't changed, this is a no-op. Avoid unnecessary layout caused by
// modifying child layout params.
if (insets.equals(mInsets)) return;
final int n = getChildCount();
for (int i = 0; i < n; i++) {
final View child = getChildAt(i);
setFrameLayoutChildInsets(child, insets, mInsets);
}
mInsets.set(insets);
}
示例7: dispatchOnDependentViewChanged
import android.graphics.Rect; //導入方法依賴的package包/類
void dispatchOnDependentViewChanged(boolean fromNestedScroll) {
int layoutDirection = ViewCompat.getLayoutDirection(this);
int childCount = this.mDependencySortedChildren.size();
for (int i = 0; i < childCount; i++) {
int j;
View child = (View) this.mDependencySortedChildren.get(i);
LayoutParams lp = (LayoutParams) child.getLayoutParams();
for (j = 0; j < i; j++) {
if (lp.mAnchorDirectChild == ((View) this.mDependencySortedChildren.get(j))) {
offsetChildToAnchor(child, layoutDirection);
}
}
Rect oldRect = this.mTempRect1;
Rect newRect = this.mTempRect2;
getLastChildRect(child, oldRect);
getChildRect(child, true, newRect);
if (!oldRect.equals(newRect)) {
recordLastChildRect(child, newRect);
for (j = i + 1; j < childCount; j++) {
View checkChild = (View) this.mDependencySortedChildren.get(j);
LayoutParams checkLp = (LayoutParams) checkChild.getLayoutParams();
Behavior b = checkLp.getBehavior();
if (b != null && b.layoutDependsOn(this, checkChild, child)) {
if (fromNestedScroll || !checkLp.getChangedAfterNestedScroll()) {
boolean handled = b.onDependentViewChanged(this, checkChild, child);
if (fromNestedScroll) {
checkLp.setChangedAfterNestedScroll(handled);
}
} else {
checkLp.resetChangedAfterNestedScroll();
}
}
}
}
}
}
示例8: updateHq
import android.graphics.Rect; //導入方法依賴的package包/類
public void updateHq(boolean update) {
Rect viewArea = new Rect(getLeft(),getTop(),getRight(),getBottom());
if (viewArea.width() == mSize.x || viewArea.height() == mSize.y) {
// If the viewArea's size matches the unzoomed size, there is no need for an hq patch
if (mPatch != null) {
mPatch.setImageBitmap(null);
mPatch.invalidate();
}
} else {
final Point patchViewSize = new Point(viewArea.width(), viewArea.height());
final Rect patchArea = new Rect(0, 0, mParentSize.x, mParentSize.y);
// Intersect and test that there is an intersection
if (!patchArea.intersect(viewArea))
return;
// Offset patch area to be relative to the view top left
patchArea.offset(-viewArea.left, -viewArea.top);
boolean area_unchanged = patchArea.equals(mPatchArea) && patchViewSize.equals(mPatchViewSize);
// If being asked for the same area as last time and not because of an update then nothing to do
if (area_unchanged && !update)
return;
boolean completeRedraw = !(area_unchanged && update);
// Stop the drawing of previous patch if still going
if (mDrawPatch != null) {
mDrawPatch.cancel();
mDrawPatch = null;
}
// Create and add the image view if not already done
if (mPatch == null) {
mPatch = new OpaqueImageView(mContext);
mPatch.setScaleType(ImageView.ScaleType.MATRIX);
addView(mPatch);
mSearchView.bringToFront();
}
CancellableTaskDefinition<Void, Void> task;
if (completeRedraw)
task = getDrawPageTask(mPatchBm, patchViewSize.x, patchViewSize.y,
patchArea.left, patchArea.top,
patchArea.width(), patchArea.height());
else
task = getUpdatePageTask(mPatchBm, patchViewSize.x, patchViewSize.y,
patchArea.left, patchArea.top,
patchArea.width(), patchArea.height());
mDrawPatch = new CancellableAsyncTask<Void,Void>(task) {
public void onPostExecute(Void result) {
mPatchViewSize = patchViewSize;
mPatchArea = patchArea;
mPatch.setImageBitmap(mPatchBm);
mPatch.invalidate();
//requestLayout();
// Calling requestLayout here doesn't lead to a later call to layout. No idea
// why, but apparently others have run into the problem.
mPatch.layout(mPatchArea.left, mPatchArea.top, mPatchArea.right, mPatchArea.bottom);
}
};
mDrawPatch.execute();
}
}