code: public void setOrientation(int orientation) {
          if (orientation != HORIZONTAL && orientation != VERTICAL) {
              throw new IllegalArgumentException("invalid orientation.");
          }
          if (mPendingSavedState != null && mPendingSavedState.mOrientation != orientation) {
              // override pending state
              mPendingSavedState.mOrientation = orientation;
          }
          if (orientation == mOrientation) {
              return;
          }
          mOrientation = orientation;
          mOrientationHelper = null;
          requestLayout();
      }
docs: Sets the orientation of the layout. {@link com.twotoasters.android.support.v7.widget.LinearLayoutManager}
  will do its best to keep scroll position.
  
  @param orientation {@link #HORIZONTAL} or {@link #VERTICAL}