public static Metrics isBoring(LayoutContext layoutContext,CharSequence text,TextPaint paint,TextDirectionHeuristic textDir,Metrics metrics){
  char[] temp=TextUtils.obtain(500);
  int length=text.length();
  boolean boring=true;
  outer:   for (int i=0; i < length; i+=500) {
    int j=i + 500;
    if (j > length)     j=length;
    TextUtils.getChars(text,i,j,temp,0);
    int n=j - i;
    for (int a=0; a < n; a++) {
      char c=temp[a];
      if (c == '\n' || c == '\t' || c >= FIRST_RIGHT_TO_LEFT) {
        boring=false;
        break outer;
      }
    }
    if (textDir != null && textDir.isRtl(temp,0,n)) {
      boring=false;
      break outer;
    }
  }
  TextUtils.recycle(temp);
  if (boring && text instanceof Spanned) {
    Spanned sp=(Spanned)text;
    Object[] styles=sp.getSpans(0,length,ParagraphStyle.class);
    if (styles.length > 0) {
      boring=false;
    }
  }
  if (boring) {
    Metrics fm=metrics;
    if (fm == null) {
      fm=new Metrics();
    }
    TextLine line=TextLine.obtain();
    line.set(layoutContext,paint,text,0,length,DIR_LEFT_TO_RIGHT,DIRS_ALL_LEFT_TO_RIGHT,false,null);
    fm.width=(int)Math.ceil(line.metrics(fm));
    TextLine.recycle(line);
    return fm;
  }
 else {
    return null;
  }
}

public static Metrics isBoring ( LayoutContext layoutContext , CharSequence text , TextPaint paint , TextDirectionHeuristic textDir , Metrics metrics ) { char [ ] temp = TextUtils . obtain ( 500 ) ; int length = text . length ( ) ; boolean boring = true ; outer : for ( int i = 0 ; i < length ; i += 500 ) { int j = i + 500 ; if ( j > length ) j = length ; TextUtils . getChars ( text , i , j , temp , 0 ) ; int n = j - i ; for ( int a = 0 ; a < n ; a ++ ) { char c = temp [ a ] ; if ( c == '\n' || c == '\t' || c >= FIRST_RIGHT_TO_LEFT ) { boring = false ; break outer ; } } if ( textDir != null && textDir . isRtl ( temp , 0 , n ) ) { boring = false ; break outer ; } } TextUtils . recycle ( temp ) ; if ( boring && text instanceof Spanned ) { Spanned sp = ( Spanned ) text ; Object [ ] styles = sp . getSpans ( 0 , length , ParagraphStyle . class ) ; if ( styles . length > 0 ) { boring = false ; } } if ( boring ) { Metrics fm = metrics ; if ( fm == null ) { fm = new Metrics ( ) ; } TextLine line = TextLine . obtain ( ) ; line . set ( layoutContext , paint , text , 0 , length , DIR_LEFT_TO_RIGHT , DIRS_ALL_LEFT_TO_RIGHT , false , null ) ; fm . width = ( int ) Math . ceil ( line . metrics ( fm ) ) ; TextLine . recycle ( line ) ; return fm ; } else { return null ; } }
returns null if not boring ; the width , ascent , and descent in the provided metrics object ( or a new one if the provided one was null ) if boring .
