code: View getTargetView() {
      View view = screenshotTarget;
      if (!screenshotChildrenOnly) {
        while (view.getRootView() != view) {
          view = view.getRootView();
        }
      }
  
      return view;
    }
docs: Unless {@code screenshotChildrenOnly} is true, navigate up the layout hierarchy until we find
  the root view.