Class RectFUtils

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
      RectFUtils()
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      static boolean areIdentical(@NonNull() RectF r1, @NonNull() RectF r2) Determine if two RectF instances are equal.
      static RectF applyInsets(@NonNull() RectF rect, @Nullable() Insets insets) Calculates a new RectF by applying insets to rect.
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RectFUtils

        RectFUtils()
    • 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 null
        r2 - May not be null
        Returns:

        True if r1 and r2 are identical, false otherwise.

      • 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 - width1
        h1 - height1
        w2 - width2
        h2 - height2