Add dimension in dimens.xml:
<dimen name="text_medium">18sp</dimen>
Set the size in code:
textView.setTextSize(TypedValue.COMPLEX_UNIT_PX, getResources().getDimension(R.dimen.text_medium));
Related Contents:
- Making TextView scrollable on Android
- How to put a border around an Android TextView?
- How to make a background 20% transparent on Android
- How to set the font style to bold, italic and underlined in an Android TextView?
- How do you change text to bold in Android?
- Android, How to limit width of TextView (and add three dots at the end of text)?
- How to set text color of a TextView programmatically? [duplicate]
- How to change the font on the TextView?
- How do I add a newline to a TextView in Android?
- How to assign text size in sp value using java code
- Remove an onclick listener
- Shadow Effect for a Text in Android?
- How do I use a compound drawable instead of a LinearLayout that contains an ImageView and a TextView
- Font size of TextView in Android application changes on changing font size from native settings
- How to programmatically set maxLength in Android TextView?
- Multiline TextView in Android?
- How to set a ripple effect on textview or imageview on Android?
- Kotlin addTextChangeListener lambda?
- Is there an easy way to strike through text in an app widget?
- TextView Marquee not working [duplicate]
- How do I enable standard copy paste for a TextView in Android?
- How to pass a view’s onClick event to its parent on Android?
- How to set emoji by unicode in a textview?
- Remove underline from links in TextView – Android
- How to add bulleted list to android application?
- Is dp the same as dip? [duplicate]
- how to change text in Android TextView
- Is it possible to display inline images from html in an Android TextView?
- Highlighting Text Color using Html.fromHtml() in Android?
- Put constant text inside EditText which should be non-editable – Android
- How to get rid of the underline in a Spannable String with a Clickable Object?
- Android – Set text to TextView
- How to make the textview blinking
- Which HTML tags are supported by Android TextView?
- Android: how to add Icon at the left side of the TextView [duplicate]
- How to align the text inside the TextView in Android?
- Android: java.lang.ClassCastException: android.widget.imageView cannot be cast to android.widget.textView
- Android: textview hyperlink
- How to disable the TextView maxLines programmatically?
- How to show 3 dots at the end of text in textview
- Add “View More” at the end of TextView after 3 lines [duplicate]
- Android Transparent TextView?
- Android and displaying multi-lined text in a TextView in a TableRow
- Hyphenation in Android
- Android Html.fromHtml(String) doesn’t work for text
- Android Swipe on List
- How to apply shadow to ImageView?
- Align top of image to top of TextView
- How to set font weight as light, regular in Android
- Programmatically create TextView with ellipsis