code: public void setLayoutManager(LayoutManager layout) {
          if (layout == mLayout) {
              return;
          }
  
          mRecycler.clear();
          removeAllViews();
          if (mLayout != null) {
              if (mIsAttached) {
                  mLayout.onDetachedFromWindow(this);
              }
              mLayout.mRecyclerView = null;
          }
          mLayout = layout;
          if (layout != null) {
              if (layout.mRecyclerView != null) {
                  throw new IllegalArgumentException("LayoutManager " + layout +
                          " is already attached to a RecyclerView: " + layout.mRecyclerView);
              }
              layout.mRecyclerView = this;
              if (mIsAttached) {
                  mLayout.onAttachedToWindow(this);
              }
          }
          requestLayout();
      }
docs: Set the {@link com.twotoasters.android.support.v7.widget.RecyclerView.LayoutManager} that this RecyclerView will use.
  
  <p>In contrast to other adapter-backed views such as {@link android.widget.ListView}
  or {@link android.widget.GridView}, RecyclerView allows client code to provide custom
  layout arrangements for child views. These arrangements are controlled by the
  {@link com.twotoasters.android.support.v7.widget.RecyclerView.LayoutManager}. A LayoutManager must be provided for RecyclerView to function.</p>
  
  <p>Several default strategies are provided for common uses such as lists and grids.</p>
  
  @param layout LayoutManager to use