Code example for TextPaint

Methods: getFontMetricsInt

	private int getLineHeight() { 
		return Math.round(mTextPaint.getFontMetricsInt(mTextPaint
	 * Calculates text length based on max width of the view. It will return the 
	 * last space index on text based on the view width. 
	 * @param text 
	 *            whole text to be written on view. 
	 * @param maxWidth 
	 *            view max width available to write the text. 
	 * @return the last space index on text based on the width value. 
	private int getTextSlice(String text, float maxWidth) {
Experience pair programming with AI  Get Codota for Java