Ok, here's a shot - and rather awkward, but shorter:
* ,
* ,
*
-
private boolean isTooLarge (TextView text, String newText) {
float textWidth = text.getPaint().measureText(newText);
return (textWidth >= text.getMeasuredWidth ());
}
:
numLinesPerPage=mTextView.getHeight()/mTextView.getLineHeight(); //not this doesn't handle special cases where you've changed the font, bolded it etc
, , , ( , ).
note: getHeight , - onDraw , , onMeasure, .