compat/src/main/java/androidx/core/view/GravityCompat.java
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 android.view.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 android.view.Gravity#DISPLAY_CLIP_HORIZONTAL} and
     * {@link android.view.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
     */
Apply additional gravity behavior based on the overall "display" that an
object exists in.  This can be used after
android.view.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
android.view.Gravity#DISPLAY_CLIP_HORIZONTAL and
android.view.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.


Apply additional gravity behavior based on the overall " display " that an object exists in . This can be used after android . view . 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 android . view . Gravity#DISPLAY_CLIP_HORIZONTAL and android . view . 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 .
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);
        }
    }
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.
Apply additional gravity behavior based on the overall " display " that an object exists in .