code: public static <T extends View> T measure(T view, ViewGroup parent) {
          LayoutParams p = view.getLayoutParams();
          int w = parent != null && p.width == MATCH_PARENT ? parent.getMeasuredWidth() : p.width;
          int h = parent != null && p.height == MATCH_PARENT ? parent.getMeasuredHeight() : p.height;
          return measure(view, w, h);
      }
docs: {@link View#measure(int, int) Measure} the View in its parent. You can then call
  {@link View#getMeasuredWidth()} and {@link View#getMeasuredHeight()}.
  
  @param view   must have {@link LayoutParams}
  @param parent must already be measured