本文整理了Java中android.graphics.Rect.sort
方法的一些代码示例,展示了Rect.sort
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Rect.sort
方法的具体详情如下:
包路径:android.graphics.Rect
类名称:Rect
方法名:sort
[英]Swap top/bottom or left/right if there are flipped (i.e. left > right and/or top > bottom). This can be called if the edges are computed separately, and may have crossed over each other. If the edges are already correct (i.e. left
[中]如果存在翻转(即左>右和/或上>下),则交换上/下或左/右。如果边是单独计算的,并且可能相互交叉,则可以调用此函数。如果边缘已经正确(即左侧
代码示例来源:origin: Omega-R/OmegaRecyclerView
private void drawDivider(Canvas canvas, View view, Rect rect) {
Drawable divider = this.mDivider;
divider.setAlpha((int) (view.getAlpha() * 255f * mDividerAlpha));
rect.sort();
divider.setBounds(rect);
divider.draw(canvas);
}
代码示例来源:origin: WeAreFairphone/FP2-Launcher
@Override
public void getBounds(Rect bounds, int x, int y, int width, int height) {
Matrix.translateM(mTempMatrix, 0, mMatrices, mCurrentMatrixIndex, x, y, 0f);
Matrix.scaleM(mTempMatrix, 0, width, height, 1f);
Matrix.multiplyMV(mTempMatrix, MATRIX_SIZE, mTempMatrix, 0, BOUNDS_COORDINATES, 0);
Matrix.multiplyMV(mTempMatrix, MATRIX_SIZE + 4, mTempMatrix, 0, BOUNDS_COORDINATES, 4);
bounds.left = Math.round(mTempMatrix[MATRIX_SIZE]);
bounds.right = Math.round(mTempMatrix[MATRIX_SIZE + 4]);
bounds.top = Math.round(mTempMatrix[MATRIX_SIZE + 1]);
bounds.bottom = Math.round(mTempMatrix[MATRIX_SIZE + 5]);
bounds.sort();
}
代码示例来源:origin: ChillingVan/android-openGL-canvas
@Override
public void getBounds(Rect bounds, int x, int y, int width, int height) {
Matrix.translateM(mTempMatrix, 0, mMatrices, mCurrentMatrixIndex, x, y, 0f);
Matrix.scaleM(mTempMatrix, 0, width, height, 1f);
Matrix.multiplyMV(mTempMatrix, MATRIX_SIZE, mTempMatrix, 0, BOUNDS_COORDINATES, 0);
Matrix.multiplyMV(mTempMatrix, MATRIX_SIZE + 4, mTempMatrix, 0, BOUNDS_COORDINATES, 4);
bounds.left = Math.round(mTempMatrix[MATRIX_SIZE]);
bounds.right = Math.round(mTempMatrix[MATRIX_SIZE + 4]);
bounds.top = Math.round(mTempMatrix[MATRIX_SIZE + 1]);
bounds.bottom = Math.round(mTempMatrix[MATRIX_SIZE + 5]);
bounds.sort();
}
代码示例来源:origin: fookwood/Launcher3
@Override
public void getBounds(Rect bounds, int x, int y, int width, int height) {
Matrix.translateM(mTempMatrix, 0, mMatrices, mCurrentMatrixIndex, x, y, 0f);
Matrix.scaleM(mTempMatrix, 0, width, height, 1f);
Matrix.multiplyMV(mTempMatrix, MATRIX_SIZE, mTempMatrix, 0, BOUNDS_COORDINATES, 0);
Matrix.multiplyMV(mTempMatrix, MATRIX_SIZE + 4, mTempMatrix, 0, BOUNDS_COORDINATES, 4);
bounds.left = Math.round(mTempMatrix[MATRIX_SIZE]);
bounds.right = Math.round(mTempMatrix[MATRIX_SIZE + 4]);
bounds.top = Math.round(mTempMatrix[MATRIX_SIZE + 1]);
bounds.bottom = Math.round(mTempMatrix[MATRIX_SIZE + 5]);
bounds.sort();
}
代码示例来源:origin: 18Gray/ProCamera
break;
mDrawableFloat.sort();
invalidate();
代码示例来源:origin: fanbaoying/FBYIDCardRecognition-Android
region.right = x + rotatedWidth / 2;
region.bottom = y + rotated / 2;
region.sort();
代码示例来源:origin: fanbaoying/FBYIDCardRecognition-Android
region.right = x + rotatedWidth / 2;
region.bottom = y + rotated / 2;
region.sort();
内容来源于网络,如有侵权,请联系作者删除!