Best code examples for TextView setTextSize method (android.widget.TextView.setTextSize)

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

TextView setTextSize examples from Open Source projects
This code example shows how to use the following methods: setPadding, setText, setTextColor, setTextSize
174:	textView.setPadding((int)(20 * scale) * (leftPadding ? 2 : 1), (int)(20 * scale) * (!leftPadding && topPadding ? 1 : 0), (int)(20 * scale), 0); 
175:	textView.setText(item); 
176:	textView.setTextColor(Color.BLACK); 
177:	textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: setGravity, setPadding, setText, setTextSize
65:	TextView scoreText = new TextView(parent.getContext()); 
66:	scoreText.setText(String.valueOf(score.getScore())); 
67:	scoreText.setGravity(Gravity.RIGHT); 
68:	scoreText.setPadding(10, 10, 10, 10); 
69:	scoreText.setTextSize(16); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getHeight, setGravity, setText, setTextColor, setTextSize
94:	TextView textView = new TextView(context); 
95:	textView.setText(prompt); 
96:	textView.setTextSize(14); 
97:	textView.setTextColor(Color.BLACK); 
-
104:	LinearLayout.LayoutParams.WRAP_CONTENT,textView.getHeight()); 
-
108:	textView.setGravity(Gravity.CENTER); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: setLayoutParams, setText, setTextColor, setTextSize
69:	textView = new TextView(context); 
70:	textView.setTextSize(16); 
71:	textView.setTextColor(0xffffffff); 
72:	textView.setText(textId); 
73:	textView.setLayoutParams(new LinearLayout.LayoutParams( 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: setGravity, setMaxWidth, setMinWidth, setPadding, setText
66:	TextView messageText = new TextView(parent.getContext()); 
67:	messageText.setText(this.getMessageText(pos)); 
68:	messageText.setGravity(Gravity.LEFT); 
69:	messageText.setPadding(10, 10, 10, 10); 
70:	messageText.setMaxWidth(200); 
71:	messageText.setMinWidth(200); 
72:	messageText.setTextSize(16); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: setId, setLayoutParams, setGravity, setText, setTextColor
58:	final TextView title = new TextView(getContext()); 
59:	title.setText(getTitle()); 
60:	title.setTextSize(24); 
61:	title.setTextColor(Color.WHITE); 
62:	title.setTypeface(Typeface.DEFAULT, Typeface.NORMAL); 
63:	title.setGravity(Gravity.LEFT); 
64:	title.setLayoutParams(titleparams); 
65:	title.setId(TITLE_ID); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setLayoutParams, setText, setTextSize, setTypeface
42:	tvFormattedName.setText("Add " + bookmark.getName()); 
43:	tvFormattedName.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 18); 
44:	tvFormattedName.setTypeface(Typeface.DEFAULT_BOLD); 
-
48:	tvFormattedName.setLayoutParams(para); 
-
58:	tvFormattedName.setText("[" + bookmark.getObjectType() + "] " + bookmark.getName()); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: setLayoutParams, setSingleLine, setText, setTextColor, setTextSize
166:	textView = new TextView(getContext()); 
167:	textView.setSingleLine(true); 
-
173:	textView.setText(text); 
-
177:	textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, textSize); 
-
180:	textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 11); 
-
183:	textView.setTypeface(Typeface.DEFAULT_BOLD); 
184:	textView.setTextColor((textColor == null) ? DEFAULT_TEXT_COLOR : textColor); 
185:	textView.setLayoutParams(textParams); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setGravity, setLines, setTextColor, setTextSize, setTypeface
222:	view.setTextColor(textColor); 
223:	view.setGravity(Gravity.CENTER); 
224:	view.setTextSize(textSize); 
225:	view.setLines(1); 
226:	view.setTypeface(Typeface.SANS_SERIF, Typeface.BOLD); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setLayoutParams, getText, length, setText, setTextColor
182:	TextView tv = new TextView(this); 
-
187:	tv.setLayoutParams(lp); 
-
189:	tv.setText(info.activityInfo.loadLabel(getPackageManager())); 
190:	tv.setTextColor(Color.BLACK); 
191:	tv.setTextSize(15); 
-
194:	tv.setText(tv.getText(), TextView.BufferType.SPANNABLE); 
195:	Spannable str = (Spannable) tv.getText(); 
-
200:	0, tv.length(), 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setGravity, setLines, setTextColor, setTextSize, setTypeface
239:	view.setTextColor(textColor); 
240:	view.setGravity(Gravity.CENTER); 
241:	view.setTextSize(textSize); 
242:	view.setLines(1); 
-
245:	view.setTypeface(textTypeface); 
-
247:	view.setTypeface(Typeface.SANS_SERIF, Typeface.BOLD); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getId, setId, setLayoutParams, setGravity, setText
76:	final TextView title = new TextView(getContext()); 
77:	title.setText(getTitle()); 
78:	title.setTextSize(24); 
79:	title.setTextColor(Color.WHITE); 
80:	title.setTypeface(Typeface.DEFAULT, Typeface.NORMAL); 
81:	title.setGravity(Gravity.LEFT); 
82:	title.setLayoutParams(titleparams); 
83:	title.setId(TITLE_ID); 
-
90:	descriptionparams.addRule(RelativeLayout.BELOW, title.getId()); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setTextSize, setTypeface
170:	m_label.setTypeface(aTypeface); 
171:	m_label.setTextSize(aSize); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setGravity, setText, setTextSize
13:	TextView textView = new TextView(this); 
14:	textView.setText("Activity two"); 
15:	textView.setGravity(Gravity.CENTER); 
16:	textView.setTextSize(48); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: setMinimumHeight, setMinimumWidth, setOnClickListener, setText, setTextSize
61:	button = new Button(mContext); 
62:	button.setMinimumWidth(300); 
63:	button.setMinimumHeight(70); 
64:	button.setTextSize(14); 
65:	button.setText("Play sample"); 
66:	button.setOnClickListener(buttonListener); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setGravity, setTextSize
53:	mValueText = new TextView(mContext); 
54:	mValueText.setGravity(Gravity.CENTER_HORIZONTAL); 
55:	mValueText.setTextSize(32); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setText, setTextColor, setTextSize
149:	TextView textView = new TextView(mContext); 
150:	textView.setTextColor(mInactiveTextColor.getColor()); 
151:	textView.setTextSize(16); 
152:	textView.setText(label); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getPaintFlags, getTypeface, setTextSize
119:	Typeface tf = mColumn1.getTypeface(); 
-
123:	+ " S=" + ((mColumn1.getPaintFlags() & Paint.SUBPIXEL_TEXT_FLAG) != 0 ? 1 : 0) 
-
313:	mColumn1.setTextSize(mFontSize); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setGravity, setTextSize
78:	mValueText = new TextView(mContext); 
79:	mValueText.setGravity(Gravity.CENTER_HORIZONTAL); 
80:	mValueText.setTextSize(32); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setText, setTextColor, setTextSize, setTypeface
50:	TextView telop = new TextView(this); 
51:	telop.setText("TextViewをVideoViewに重ねます"); 
52:	telop.setTextColor(Color.RED); 
53:	telop.setTextSize(40); 
54:	telop.setTypeface(Typeface.DEFAULT, 1); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setLayoutParams, setGravity, setTextSize
29:	mTextView = new TextView(context); 
30:	mTextView.setLayoutParams(new LayoutParams( 
-
32:	mTextView.setGravity(Gravity.CENTER_HORIZONTAL 
-
34:	mTextView.setTextSize(18.0f); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setTextSize, setTypeface
172:	title.setTypeface(aTypeface); 
173:	title.setTextSize(aSize); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setGravity, setText, setTextColor, setTextSize
22:	TextView textView = new TextView(context); 
23:	textView.setTextSize(14.0f); 
-
25:	textView.setText(inode.getDisplayName()); 
26:	textView.setGravity(Gravity.CENTER); 
-
34:	textView.setTextColor(Color.WHITE); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setGravity, setTextSize
112:	valueTextView = new TextView(context); 
113:	valueTextView.setGravity(Gravity.CENTER_HORIZONTAL); 
114:	valueTextView.setTextSize(32); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setLayoutParams, setTextColor, setTextSize, setTypeface
100:	mText = new TextView(mContext); 
101:	mText.setTextColor(0xFF8F8F8F); 
102:	mText.setTextSize(12); 
103:	mText.setTypeface(Typeface.DEFAULT_BOLD); 
104:	mText.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setLayoutParams, setGravity, setTextSize
36:	mTextView = new TextView(context); 
37:	mTextView.setLayoutParams(new LayoutParams( 
-
39:	mTextView.setGravity(Gravity.CENTER_HORIZONTAL 
-
41:	mTextView.setTextSize(18.0f); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setTextSize, setTypeface
203:	textView.setTypeface(aTypeface); 
204:	textView.setTextSize(aSize); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setGravity, setTextSize
51:	mValueText = new TextView(mContext); 
52:	mValueText.setGravity(Gravity.CENTER_HORIZONTAL); 
53:	mValueText.setTextSize(32); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setTag, setPadding, setText, setTextSize
278:	TextView label = new TextView(this); 
279:	label.setTag(id); 
280:	label.setText(value); 
281:	label.setTextSize(20); 
282:	label.setPadding(0, 5, 0, 0); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setBackgroundColor, setGravity, setText, setTextColor, setTextSize
31:	TextView v = new TextView(getActivity()); 
32:	v.setGravity(Gravity.CENTER); 
33:	v.setTextSize(40); 
34:	v.setTextColor(Color.BLACK); 
35:	v.setBackgroundColor(colour); 
36:	v.setText("Fragment ID: " + identifier); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setGravity, setPadding, setText, setTextColor, setTextSize
39:	TextView tv = new TextView(context); 
40:	tv.setPadding(10, 10, 10, 10); 
41:	tv.setGravity(Gravity.CENTER_HORIZONTAL); 
42:	tv.setTextSize(20); 
43:	tv.setText(obj.toString()); 
44:	tv.setTextColor(0xaaffffff); 
-
47:	tv.setTypeface(font); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getText, setPadding, setTextColor, setTextSize
111:	final String option = tv.getText().toString(); 
-
119:	tv.setTextSize(24.0f); 
-
124:	tv.setTextColor(Color.BLACK); 
125:	tv.setPadding(10, 3, 3, 3); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getTextSize, setTextSize
178:	float fontPixelSize = view.getTextSize(); 
-
182:	view.setTextSize(TypedValue.COMPLEX_UNIT_PX, fontPixelSize*ratio); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setId, setPadding, setTextSize, setTypeface
44:	textView = new TextView(getContext()); 
45:	textView.setId(android.R.id.title); 
46:	textView.setPadding(padding,padding,padding,padding); 
-
49:	textView.setTextSize(textSize); 
-
52:	textView.setTypeface(null, Typeface.BOLD_ITALIC); 
-
54:	textView.setTypeface(null, Typeface.BOLD); 
-
56:	textView.setTypeface(null, Typeface.ITALIC); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setId, setLayoutParams, setShadowLayer, setSingleLine, setTextColor
114:	dateTextView = new TextView(context); 
115:	dateTextView.setId(DATE_TEXT_VIEW_ID); 
-
122:	dateTextView.setLayoutParams(params); 
123:	dateTextView.setShadowLayer(1, 0, 1, Color.WHITE); 
124:	dateTextView.setSingleLine(true); 
125:	dateTextView.setTextColor(Color.GRAY); 
126:	dateTextView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 15); 
127:	dateTextView.setTypeface(null, Typeface.ITALIC); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setLayoutParams, setTextSize
41:	TextView label = new TextView( activity ); 
-
50:	label.setLayoutParams( labelParams ); 
-
52:	label.setTextSize( 15.0f ); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setGravity, setTextSize
74:	TextView t = new TextView(this); 
75:	t.setGravity(Gravity.TOP | Gravity.CENTER_HORIZONTAL); 
76:	t.setTextSize(36); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setText, setTextColor, setTextSize
189:	textView = new TextView(getContext()); 
190:	textView.setText(localizationService.getString(displayTextKey)); 
191:	textView.setTextColor(txtColor); 
192:	textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setLayoutParams, setPadding, setText, setTextSize
45:	final TextView currentRow = new TextView(mContext); 
46:	currentRow.setLayoutParams(new AbsListView.LayoutParams(AbsListView.LayoutParams.MATCH_PARENT, AbsListView.LayoutParams.WRAP_CONTENT)); 
47:	currentRow.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16); 
48:	currentRow.setPadding(24, 10, 0, 10); 
49:	currentRow.setText(mEvents.get(position).getmTitle()); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setGravity, setPadding, setTextSize
53:	mFieldType = new TextView(context); 
54:	mFieldType.setTextSize(16); 
55:	mFieldType.setPadding(4, 4, 4, 8); 
56:	mFieldType.setGravity(Gravity.RIGHT); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setPadding, setTextColor, setTextSize
63:	mLabel = new TextView(getContext()); 
-
85:	mLabel.setPadding(0, 0, 0, new Float(padding).intValue()); 
86:	mLabel.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12.0f); 
87:	mLabel.setTextColor(sUnselectedTextColor); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setLayoutParams, setGravity, setText, setTextSize
159:	this.tvColorLabel = new TextView(getContext()); 
160:	this.tvColorLabel.setText(this.mColorLabelText); 
161:	this.tvColorLabel.setTextSize(TypedValue.COMPLEX_UNIT_SP, DEFAULT_LABEL_TEXT_SIZE_SP); 
162:	this.tvColorLabel.setGravity(Gravity.BOTTOM | Gravity.LEFT); 
163:	this.tvColorLabel.setLayoutParams(lp2); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setLayoutParams, setGravity, setText, setTextSize
60:	TextView t = new TextView(mContext); 
61:	t.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT)); 
62:	t.setText(mData[position]); 
63:	t.setTextSize(30); 
64:	t.setGravity(Gravity.CENTER); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setLayoutParams, setText, setTextColor, setTextSize
163:	TextView title = new TextView(this); 
164:	title.setText("授权"); 
165:	title.setTextColor(Color.WHITE); 
166:	title.setTextSize(24f); 
-
170:	title.setLayoutParams(titleParams); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setBackgroundDrawable, setId, setLayoutParams, setText, setTextColor
176:	Button button = new Button(context); 
177:	button.setId(UPDATE_BUTTON_ID); 
-
186:	button.setLayoutParams(params); 
187:	button.setBackgroundDrawable(getButtonSelector()); 
188:	button.setText("Update"); 
189:	button.setTextColor(Color.WHITE); 
190:	button.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setLayoutParams, setTextSize
137:	edtIpAddress = new EditText(this); 
138:	edtIpAddress.setTextSize(12.0f); 
-
141:	edtIpAddress.setLayoutParams(p); 
Full Snippet Info
6
CodeRank
Related TextView setTextSize Questions & Answers:
setTextSize Method Overview
Set the default text size to the given value, interpreted as "scaled pixel" units.
See Also