title: RecyclerView: get fragment width/height
body: <p>I am implementing a RecyclerView, I require the width of the fragment as it directly affects the items in the RecyclerView. Where and how is the best option to do this? I am also looking for a solution that satisfies orientation changes (portrait/landscape) and that is able to redraw according to these changes.</p>
  
  <p>There are two types of ways getting the width that I know of:</p>
  
  <ul>
  <li>getView().getViewTreeObserver().addOnGlobalLayoutListener...</li>
  <li>MyOnResizeListener orlResized = new MyOnResizeListener() {...};</li>
  </ul>
  
  <p>I create my adapter in onViewCreated() and the two above methods are firing after my adapter item views are created, which is of no use then.</p>
  
  <p>Is there any good practice way to solving this?</p>