code: public void setViewHeight(int newHeight) {
      if (newHeight > 0) {
        originalHeight = newHeight;
        RelativeLayout.LayoutParams layoutParams =
            (RelativeLayout.LayoutParams) view.getLayoutParams();
        layoutParams.height = newHeight;
        view.setLayoutParams(layoutParams);
      }
    }
docs: Change view height using the LayoutParams of the view.
  
  @param newHeight to change..