Best code examples for Android StaticLayout class (android.text.StaticLayout)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android StaticLayout class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Android StaticLayout examples from Open Source projects
This code example shows how to use the following methods: draw, getLineCount
168:	StaticLayout layout = new StaticLayout(source, paint, widthPx, Alignment.ALIGN_NORMAL, mSpacingMult, 
-
170:	layout.draw(TEXT_RESIZE_CANVAS); 
-
172:	return layout.getLineCount(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getLineBounds, getWidth
604:	itemsLayout.getLineBounds(visibleItems / 2, bounds); 
-
609:	canvas.translate(itemsLayout.getWidth() + LABEL_OFFSET, bounds.top); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getLineEnd, getLineCount
338:	mCoordinates.subjectWidth, Alignment.ALIGN_NORMAL, 1, 0, false /* includePad */); 
339:	if (mCoordinates.subjectLineCount < mSubjectLayout.getLineCount()) { 
-
341:	int end = mSubjectLayout.getLineEnd(mCoordinates.subjectLineCount - 1); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getHeight
107:	true, TextUtils.TruncateAt.MIDDLE, outerWidth); 
108:	mTitleY = top + (height - mTitleLayout.getHeight()) / 2; 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: draw, getHeight
313:	StaticLayout layout = new StaticLayout(source, paint, width, Alignment.ALIGN_NORMAL, spacingMult, spacingAdd, false); 
314:	layout.draw(textResizeCanvas); 
315:	return layout.getHeight(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getLineCount
123:	Layout layout = new StaticLayout(getText(), mTextPaintOutline, measureWidth(widthMeasureSpec), Layout.Alignment.ALIGN_CENTER, mSpacingMult, mSpacingAdd, mIncludePad); 
-
125:	setMeasuredDimension(measureWidth(widthMeasureSpec) + ex, measureHeight(heightMeasureSpec) * layout.getLineCount() + ex); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods:
131:	return new StaticLayout(workingText, getPaint(), getWidth() - getPaddingLeft() - getPaddingRight(), 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getHeight
306:	StaticLayout layout = new StaticLayout(source, paint, width, Alignment.ALIGN_NORMAL, mSpacingMult, mSpacingAdd, true); 
307:	return layout.getHeight(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getHeight
151:	_alignment, 1, 0, false); 
-
153:	textHeight = (int)Math.ceil(layout.getHeight()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: draw, getHeight
199:	StaticLayout layout = new StaticLayout(source, paint, width, 
-
201:	layout.draw(sTextResizeCanvas); 
202:	return layout.getHeight(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods:
265:	return new StaticLayout(text, mTextPaint, 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: draw, getHeight
200:	StaticLayout layout = new StaticLayout(source, paint, width, Alignment.ALIGN_NORMAL, mSpacingMult, mSpacingAdd, true); 
201:	layout.draw(sTextResizeCanvas); 
202:	return layout.getHeight(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getHeight, getWidth
359:	mTextAlignment, 1.0f, 0.0f, false); 
360:	mTextBounds.set(0, 0, mTextLayout.getWidth(), mTextLayout.getHeight()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: draw, getHeight, getWidth
119:	StaticLayout layout = new StaticLayout(percent + "%", tp, m_width * 2 / 3, 
-
122:	canvas.translate((m_width - layout.getWidth()) / 2, (m_height - layout.getHeight()) / 2); 
123:	layout.draw(canvas); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods:
265:	return new StaticLayout(text, mTextPaint, 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: draw, getHeight, getWidth
90:	StaticLayout layout  = new StaticLayout(message, txtP, this.getWidth() - rpad,Layout.Alignment.ALIGN_NORMAL, 1.3f, 0, false); 
-
93:	layout.getHeight() + 
-
98:	this.setLayoutParams(new LayoutParams(this.getWidth(), layout.getHeight() + 
-
126:	layout.draw(canvas); 
-
129:	canvas.drawBitmap(picture, layout.getWidth()/2 - picture.getWidth()/2, layout.getHeight(), msgP); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods:
201:	StaticLayout l = new StaticLayout(text, 0, text.length(), mTextPaint, 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getHeight
107:	true, TextUtils.TruncateAt.MIDDLE, outerWidth); 
108:	mTitleY = top + (height - mTitleLayout.getHeight()) / 2; 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: draw, getHeight, getWidth
155:	Alignment.ALIGN_NORMAL, 1, 1, true); 
156:	text = Bitmap.createBitmap(titleLayout.getWidth(), 
157:	titleLayout.getHeight(), Bitmap.Config.ARGB_8888); 
-
159:	titleLayout.draw(textC); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: draw, getHeight
612:	StaticLayout layout = new StaticLayout(source, paint, width, Alignment.ALIGN_NORMAL, mSpacingMult, mSpacingAdd, false); 
613:	layout.draw(sTextResizeCanvas); 
614:	return layout.getHeight(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getHeight, getPaint, getText
150:	obj = mTextLayout.getText().toString(); 
151:	textpaint = mTextLayout.getPaint(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods:
116:	StaticLayout staticLayout = new StaticLayout( text, textPaint, width, Alignment.ALIGN_CENTER, 1, 0, false ); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: draw, getHeight
291:	StaticLayout layout = new StaticLayout(source, paint, width, Alignment.ALIGN_NORMAL, 
-
293:	layout.draw(sTextResizeCanvas); 
294:	return layout.getHeight(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getLineEnd, getLineCount
340:	mCoordinates.subjectWidth, Alignment.ALIGN_NORMAL, 1, 0, false /* includePad */); 
341:	if (mCoordinates.subjectLineCount < mSubjectLayout.getLineCount()) { 
-
343:	int end = mSubjectLayout.getLineEnd(mCoordinates.subjectLineCount - 1); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods:
377:	return new StaticLayout(text, mTextPaint, (int) Math.ceil(Layout.getDesiredWidth(text, mTextPaint)), Layout.Alignment.ALIGN_NORMAL, 1.f, 0, true); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: draw, getHeight
172:	StaticLayout layout = new StaticLayout(source, paint, width, Layout.Alignment.ALIGN_NORMAL, mSpacingMult, 
-
175:	layout.draw(TEXT_RESIZE_CANVAS); 
-
179:	return layout.getHeight(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getHeight, getWidth
101:	1.2F,0,false); 
102:	int halfWidth = layout.getWidth()/2; 
103:	int halfHeight = layout.getHeight()/2; 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: draw, getHeight
225:	StaticLayout layout = new StaticLayout(source, paint, width, Layout.Alignment.ALIGN_NORMAL, mSpacingMult, 
-
228:	layout.draw(TEXT_RESIZE_CANVAS); 
-
232:	return layout.getHeight(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: draw, getHeight
305:	StaticLayout layout = new StaticLayout(source, paint, width, Alignment.ALIGN_CENTER, mSpacingMult, mSpacingAdd, true); 
306:	layout.draw(sTextResizeCanvas); 
307:	return layout.getHeight(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: draw, getHeight
297:	StaticLayout layout = new StaticLayout(source, paint, width, Alignment.ALIGN_NORMAL, 
-
299:	layout.draw(sTextResizeCanvas); 
300:	return layout.getHeight(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: draw, getHeight
279:	StaticLayout layout = new StaticLayout(source, paint, width, Alignment.ALIGN_NORMAL, mSpacingMult, mSpacingAdd, false); 
280:	layout.draw(sTextResizeCanvas); 
281:	return layout.getHeight(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: draw, getHeight
293:	StaticLayout layout = new StaticLayout(source, paint, width, Alignment.ALIGN_NORMAL, mSpacingMult, mSpacingAdd, true); 
294:	layout.draw(sTextResizeCanvas); 
295:	return layout.getHeight(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: draw, getHeight
236:	StaticLayout layout = new StaticLayout(source, paint, width, Alignment.ALIGN_NORMAL, this.mSpacingMult, this.mSpacingAdd, true); 
237:	layout.draw(sTextResizeCanvas); 
238:	return layout.getHeight(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: draw, getHeight
289:	StaticLayout layout = new StaticLayout(source, paint, width, Alignment.ALIGN_NORMAL, this.mSpacingMult, this.mSpacingAdd, true); 
290:	layout.draw(sTextResizeCanvas); 
291:	return layout.getHeight(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: draw, getHeight
279:	StaticLayout layout = new StaticLayout(source, paint, width, Alignment.ALIGN_NORMAL, mSpacingMult, mSpacingAdd, false); 
280:	layout.draw(sTextResizeCanvas); 
281:	return layout.getHeight(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: draw, getHeight
278:	StaticLayout layout = new StaticLayout(source, paint, width, Alignment.ALIGN_NORMAL, mSpacingMult, mSpacingAdd, false); 
279:	layout.draw(sTextResizeCanvas); 
280:	return layout.getHeight(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: draw, getHeight
110:	StaticLayout layout = new StaticLayout(cutOff, textPaint, boundedWidth , 
-
113:	layout.draw(new Canvas()); 
-
115:	if ( layout.getHeight() < bookView.getHeight() ) { 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: draw, getHeight
279:	StaticLayout layout = new StaticLayout(source, paint, width, Alignment.ALIGN_NORMAL, mSpacingMult, mSpacingAdd, false); 
280:	layout.draw(sTextResizeCanvas); 
281:	return layout.getHeight(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: draw, getHeight
272:	StaticLayout layout = new StaticLayout(source, paint, width, Alignment.ALIGN_NORMAL, mSpacingMult, mSpacingAdd, false); 
273:	layout.draw(sTextResizeCanvas); 
274:	return layout.getHeight(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: draw
117:	layout = new StaticLayout(getText(), mTextPaint, getWidth(), Layout.Alignment.ALIGN_CENTER, mSpacingMult, mSpacingAdd, mIncludePad); 
118:	layout.draw(canvas); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getLineCount
123:	Layout layout = new StaticLayout(getText(), mTextPaintOutline, measureWidth(widthMeasureSpec), Layout.Alignment.ALIGN_CENTER, mSpacingMult, mSpacingAdd, mIncludePad); 
-
125:	setMeasuredDimension(measureWidth(widthMeasureSpec) + ex, measureHeight(heightMeasureSpec) * layout.getLineCount() + ex); 
Full Snippet Info
5
CodeRank
Related Android StaticLayout Questions & Answers:
See Code Examples for Android StaticLayout Methods: