Code example for StaticLayout

Methods: getLineEndgetLineCount

0
	private void calculateDrawingData() { 
		sDefaultPaint.setTextSize(mCoordinates.detailFontSize);
		calculateDetailText(); 
		// mText 
		mDetailLayout = new StaticLayout(mText, sDefaultPaint,
				mCoordinates.detailWidth, Alignment.ALIGN_NORMAL, 1, 0, false /* includePad */);
		if (mCoordinates.detailLineCount < mDetailLayout.getLineCount()) {
			// TODO: ellipsize. 
			int end = mDetailLayout
					.getLineEnd(mCoordinates.detailLineCount - 1);
			mDetailLayout = new StaticLayout(mText.subSequence(0, end),
					sDefaultPaint, mCoordinates.detailWidth,
					Alignment.ALIGN_NORMAL, 1, 0, true);
		} 
 
		// Now, format the name for its width 
		TextPaint namePaint = mRead ? sDefaultPaint : sBoldPaint;
		// And get the ellipsized string for the calculated width 
		if (TextUtils.isEmpty(mSender)) {
			mFormattedFileName = "";
		} else {