Package com.androidplot.util
Class RectFUtils
-
- All Implemented Interfaces:
public abstract class RectFUtilsConvenience methods for dealing with android.graphics.RectF
-
-
Constructor Summary
Constructors Constructor Description RectFUtils()
-
Method Summary
Modifier and Type Method Description static booleanareIdentical(@NonNull() RectF r1, @NonNull() RectF r2)Determine if two RectF instances are equal. static RectFapplyInsets(@NonNull() RectF rect, @Nullable() Insets insets)Calculates a new RectF by applying insets to rect. static RectFcreateFromEdges(float w1, float h1, float w2, float h2)Generates a RectF from two height and two width values; the h and w values will be passed into the RectF constructor such that RectF. -
-
Method Detail
-
areIdentical
static boolean areIdentical(@NonNull() RectF r1, @NonNull() RectF r2)
Determine if two RectF instances are equal. Must be used in place of default equality operation due to a bug that exists in older versions of Android: http://stackoverflow.com/questions/13517852/rectf-equals-fails-on-android-versions-below-jelly-bean
- Parameters:
r1- May not be nullr2- May not be null- Returns:
True if r1 and r2 are identical, false otherwise.
-
applyInsets
@NonNull() static RectF applyInsets(@NonNull() RectF rect, @Nullable() Insets insets)
Calculates a new RectF by applying insets to rect.
- Returns:
The RectF created as a result of applying insets, or the passed in instance, if the insets were null.
-
createFromEdges
@NonNull() static RectF createFromEdges(float w1, float h1, float w2, float h2)
Generates a RectF from two height and two width values; the h and w values will be passed into the RectF constructor such that RectF.left <= RectF.right and RectF.top <= RectF.bottom.
- Parameters:
w1- width1h1- height1w2- width2h2- height2
-
-
-
-