public class MultiRect
extends android.graphics.RectF
Modifier | Constructor and Description |
---|---|
protected |
MultiRect() |
protected |
MultiRect(float left,
float top,
float right,
float bottom) |
protected |
MultiRect(MultiRect r) |
protected |
MultiRect(android.graphics.Rect r) |
protected |
MultiRect(android.graphics.RectF r) |
Modifier and Type | Method and Description |
---|---|
MultiRect |
addMargin(float margin) |
MultiRect |
addMargin(float marginX,
float marginY) |
MultiRect |
addMargin(float marginLeft,
float marginTop,
float marginRight,
float marginBottom) |
double |
calculateAspect() |
static int |
ceilToMultiOf8(int number) |
void |
flipHorizontal() |
void |
flipVertical() |
void |
forcedRecycle() |
static MultiRect |
generateCenteredRect(double imageWidth,
double imageHeight,
double viewWidth,
double viewHeight)
Gets the rectangular position of a Bitmap if it were placed inside a View
with scale type set to
#CENTER_INSIDE . |
static MultiRect |
generateCenteredRect(MultiRect output,
double imageWidth,
double imageHeight,
double viewWidth,
double viewHeight)
Gets the rectangular position of a Bitmap if it were placed inside a View
with scale type set to
#CENTER_INSIDE . |
static MultiRect |
generateCenteredRect(MultiRect output,
double imageWidth,
double imageHeight,
double viewWidth,
double viewHeight,
boolean fitInside)
Gets the rectangular position of a Bitmap if it were placed inside a View
with scale type set to
#CENTER_INSIDE . |
double |
getAspect() |
float |
getBottom() |
float[] |
getEdgePos(RectEdge edge) |
MultiRect |
getEdges(float[] shape) |
static float[] |
getEdges(android.graphics.Rect rect) |
static float[] |
getEdges(android.graphics.RectF rect) |
static void |
getEdges(android.graphics.RectF rect,
float[] shape) |
static void |
getEdges(android.graphics.Rect rect,
float[] shape) |
float |
getLeft() |
float |
getRight() |
android.graphics.Rect |
getRounded() |
android.graphics.Rect |
getRoundOut() |
float |
getTop() |
boolean |
hasFixedAspectRation() |
void |
inset(float dx,
float dy) |
boolean |
intersect(float left,
float top,
float right,
float bottom) |
boolean |
intersect(android.graphics.RectF r) |
MultiRect |
iSetCenter(float x,
float y) |
static boolean |
isFinite(float f) |
static MultiRect |
obtain() |
static MultiRect |
obtain(float left,
float top,
float right,
float bottom) |
static MultiRect |
obtain(MultiRect r) |
static MultiRect |
obtain(android.graphics.Rect r) |
static MultiRect |
obtain(android.graphics.RectF r) |
void |
offset(float dx,
float dy) |
void |
offsetTo(float newLeft,
float newTop) |
static MultiRect |
permanent() |
static MultiRect |
permanent(float left,
float top,
float right,
float bottom) |
static MultiRect |
permanent(MultiRect r) |
static MultiRect |
permanent(android.graphics.Rect r) |
static MultiRect |
permanent(android.graphics.RectF r) |
void |
readFromParcel(android.os.Parcel in) |
void |
recycle() |
MultiRect |
sampleSize(float sample) |
MultiRect |
scaleCentered(float scale) |
MultiRect |
scaleCentered(float scaleX,
float scaleY) |
MultiRect |
scaleSize(float scale) |
MultiRect |
scaleSize(float scaleX,
float scaleY) |
void |
scaleWidth(float width) |
void |
set(float left,
float top,
float right,
float bottom) |
void |
set(MultiRect src) |
void |
set(android.graphics.Rect src) |
void |
set(android.graphics.RectF src) |
void |
setAspect(double aspect) |
MultiRect |
setBottom(float bottom) |
MultiRect |
setCenter(float x,
float y) |
MultiRect |
setEdgeOffsetTo(RectEdge edge,
float[] pos) |
MultiRect |
setEdgeOffsetTo(RectEdge edge,
float x,
float y) |
MultiRect |
setEdgePos(RectEdge edge,
float[] pos) |
MultiRect |
setEdgePos(RectEdge edge,
float x,
float y) |
void |
setEmpty() |
MultiRect |
setFixedAspectRation(java.math.BigDecimal fixedAspectRation) |
MultiRect |
setFixedAspectRation(double fixedAspectRation) |
boolean |
setIntersect(android.graphics.RectF a,
android.graphics.RectF b) |
MultiRect |
setLeft(float left) |
MultiRect |
setLimits(android.graphics.Rect maxLimits) |
MultiRect |
setLimits(android.graphics.RectF maxLimits) |
MultiRect |
setLimits(android.graphics.RectF maxLimits,
RectEdge fixedEdge) |
MultiRect |
setMinSize(float minSize) |
MultiRect |
setMinSizeUnlimited() |
MultiRect |
setRight(float right) |
MultiRect |
setTop(float top) |
void |
sort() |
float[] |
toShape() |
void |
union(float x,
float y) |
void |
union(float left,
float top,
float right,
float bottom) |
void |
union(android.graphics.RectF r) |
protected MultiRect()
protected MultiRect(float left, float top, float right, float bottom)
protected MultiRect(MultiRect r)
protected MultiRect(android.graphics.Rect r)
protected MultiRect(android.graphics.RectF r)
public MultiRect addMargin(float margin)
public MultiRect addMargin(float marginX, float marginY)
public MultiRect addMargin(float marginLeft, float marginTop, float marginRight, float marginBottom)
public double calculateAspect()
public static int ceilToMultiOf8(int number)
public void flipHorizontal()
public void flipVertical()
public void forcedRecycle()
@NonNull public static MultiRect generateCenteredRect(double imageWidth, double imageHeight, double viewWidth, double viewHeight)
#CENTER_INSIDE
.imageWidth
- the Bitmap's widthimageHeight
- the Bitmap's heightviewWidth
- the parent View's widthviewHeight
- the parent View's height@NonNull public static MultiRect generateCenteredRect(MultiRect output, double imageWidth, double imageHeight, double viewWidth, double viewHeight)
#CENTER_INSIDE
.imageWidth
- the Bitmap's widthimageHeight
- the Bitmap's heightviewWidth
- the parent View's widthviewHeight
- the parent View's height@NonNull public static MultiRect generateCenteredRect(MultiRect output, double imageWidth, double imageHeight, double viewWidth, double viewHeight, boolean fitInside)
#CENTER_INSIDE
.imageWidth
- the Bitmap's widthimageHeight
- the Bitmap's heightviewWidth
- the parent View's widthviewHeight
- the parent View's heightpublic double getAspect()
public float getBottom()
public float[] getEdgePos(RectEdge edge)
public MultiRect getEdges(float[] shape)
public static float[] getEdges(android.graphics.Rect rect)
public static float[] getEdges(android.graphics.RectF rect)
public static void getEdges(android.graphics.RectF rect, float[] shape)
public static void getEdges(android.graphics.Rect rect, float[] shape)
public float getLeft()
public float getRight()
public android.graphics.Rect getRounded()
public android.graphics.Rect getRoundOut()
public float getTop()
public boolean hasFixedAspectRation()
public void inset(float dx, float dy)
inset
in class android.graphics.RectF
public boolean intersect(float left, float top, float right, float bottom)
intersect
in class android.graphics.RectF
public boolean intersect(android.graphics.RectF r)
intersect
in class android.graphics.RectF
public MultiRect iSetCenter(float x, float y)
public static boolean isFinite(float f)
public static MultiRect obtain()
public static MultiRect obtain(float left, float top, float right, float bottom)
public static MultiRect obtain(android.graphics.Rect r)
public static MultiRect obtain(android.graphics.RectF r)
public void offset(float dx, float dy)
offset
in class android.graphics.RectF
public void offsetTo(float newLeft, float newTop)
offsetTo
in class android.graphics.RectF
public static MultiRect permanent()
public static MultiRect permanent(float left, float top, float right, float bottom)
public static MultiRect permanent(android.graphics.Rect r)
public static MultiRect permanent(android.graphics.RectF r)
public void readFromParcel(android.os.Parcel in)
readFromParcel
in class android.graphics.RectF
public void recycle()
public MultiRect sampleSize(float sample)
public MultiRect scaleCentered(float scale)
public MultiRect scaleCentered(float scaleX, float scaleY)
public MultiRect scaleSize(float scale)
public MultiRect scaleSize(float scaleX, float scaleY)
public void scaleWidth(float width)
public void set(float left, float top, float right, float bottom)
set
in class android.graphics.RectF
public void set(MultiRect src)
public void set(android.graphics.Rect src)
set
in class android.graphics.RectF
public void set(android.graphics.RectF src)
set
in class android.graphics.RectF
public void setAspect(double aspect)
public MultiRect setBottom(float bottom)
public MultiRect setCenter(float x, float y)
public void setEmpty()
setEmpty
in class android.graphics.RectF
public MultiRect setFixedAspectRation(java.math.BigDecimal fixedAspectRation)
public MultiRect setFixedAspectRation(double fixedAspectRation)
public boolean setIntersect(android.graphics.RectF a, android.graphics.RectF b)
setIntersect
in class android.graphics.RectF
public MultiRect setLeft(float left)
public MultiRect setLimits(android.graphics.Rect maxLimits)
public MultiRect setLimits(android.graphics.RectF maxLimits)
public MultiRect setMinSize(float minSize)
public MultiRect setMinSizeUnlimited()
public MultiRect setRight(float right)
public MultiRect setTop(float top)
public void sort()
sort
in class android.graphics.RectF
public float[] toShape()
public void union(float x, float y)
union
in class android.graphics.RectF
public void union(float left, float top, float right, float bottom)
union
in class android.graphics.RectF
public void union(android.graphics.RectF r)
union
in class android.graphics.RectF