Code example for DynamicLayout

Methods: draw

0
 
			if (!TextUtils.isEmpty(mSubText)) {
				canvas.save();
				if (recalculateText)
					mDynamicDetailLayout = new DynamicLayout(mSubText, mPaintDetail,
							((Number) mBestTextPosition[2]).intValue(), Layout.Alignment.ALIGN_NORMAL,
							1.2f, 1.0f, true); 
				canvas.translate(mBestTextPosition[0], mBestTextPosition[1] + 12 * metricScale);
				mDynamicDetailLayout.draw(canvas);
				canvas.restore();
 
			} 
		} 
 
		super.dispatchDraw(canvas);
 
	} 
 
	private float[] getBestTextPosition(int canvasW, int canvasH) {
 
		//if the width isn't much bigger than the voided area, just consider top & bottom