code: public void setGravity(final Gravity gravity) {
          if (mGravity != gravity) {
              mGravity = gravity;
              if (mContainer != null) {
                  mContainer.onLayoutChanged(this);
              }
          }
      }
docs: Set the {@link Gravity} of the layout.
  The new gravity can be rejected if it is in conflict with the currently applied Orientation
  
  @param gravity
  One of the {@link Gravity} constants.