Code example for StaticLayout

Methods: getWidthincreaseWidthTo

0
	 * Creates layouts 
	 * @param widthItems width of items layout 
	 * @param widthLabel width of label layout 
	 */ 
	private void createLayouts(int widthItems, int widthLabel) {
		if (itemsLayout == null || itemsLayout.getWidth() > widthItems) {
			String text = buildText();
			if (text == null) {
				text = "";
			} 
			itemsLayout = new StaticLayout(text, 0, text.length(), itemsPaint, widthItems,
					widthLabel > 0 ? Layout.Alignment.ALIGN_OPPOSITE : Layout.Alignment.ALIGN_CENTER,
					1, getAdditionalItemHeight(), false, TextUtils.TruncateAt.END, widthItems);
		} else { 
			itemsLayout.increaseWidthTo(widthItems);
		} 
 
		if (valueLayout == null || valueLayout.getWidth() > widthItems) {
			String text = getAdapter() != null ? getAdapter().getItem(currentItem) : null;
			valueLayout = new StaticLayout(text != null ? text : "",