public static void applyDisplay(int gravity, Rect display, Rect inoutObj, int layoutDirection) {
        if (SDK_INT >= 17) {
            Gravity.applyDisplay(gravity, display, inoutObj, layoutDirection);
        } else {
            Gravity.applyDisplay(gravity, display, inoutObj);
        }
    }
Apply additional gravity behavior based on the overall "display" that an
object exists in.  This can be used after
{@link Gravity#apply(int, int, int, Rect, int, int, Rect)} to place the object
within a visible display.  By default this moves or clips the object
to be visible in the display; the gravity flags
{@link Gravity#DISPLAY_CLIP_HORIZONTAL} and
{@link Gravity#DISPLAY_CLIP_VERTICAL} can be used to change this behavior.

@param gravity         Gravity constants to modify the placement within the
                       display.
@param display         The rectangle of the display in which the object is
                       being placed.
@param inoutObj        Supplies the current object position; returns with it
                       modified if needed to fit in the display.
@param layoutDirection The layout direction.
@see ViewCompat#LAYOUT_DIRECTION_LTR
@see ViewCompat#LAYOUT_DIRECTION_RTL
android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/compat/GravityCompat.java