Code example for TextView

Methods: getVisibility

0
 
    // Space available on each side of the error message for the next and previous buttons 
    int errorMessagePadding = (int) (w * ERROR_MESSAGE_RELATIVE_PADDING);
 
    if (mainView != null) {
      layoutCenteredView(mainView, l, t, r, b);
    } 
  } 
 
  private void layoutCenteredView(View view, int l, int t, int r, int b) {
    int cw = view.getMeasuredWidth();
    int ch = view.getMeasuredHeight();
    int cl = (r - l - cw) / 2;
    int ct = (b - t - ch) / 2;
    view.layout(cl, ct, cl + cw, ct + ch);
  } 
 
  @Override 
  protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
    super.onMeasure(widthMeasureSpec, heightMeasureSpec);
    measureChildren(widthMeasureSpec, heightMeasureSpec);