code: public void setGravity(int gravity) {
          if (mGravity != gravity) {
              if ((gravity & Gravity.HORIZONTAL_GRAVITY_MASK) == 0) {
                  gravity |= Gravity.LEFT;
              }
              mGravity = gravity;
              requestLayout();
          }
      }
docs: Describes how the selected item view is positioned. Currently only the horizontal component
  is used. The default is determined by the current theme.
  
  @param gravity See {@link android.view.Gravity}
  
  @attr ref android.R.styleable#Spinner_gravity