Skip to content
0:00 / 0:00

#textview#spans#androidperformance

Best practices for text on Android (Google I/O '18)

Android Developers

1.4M subscribers • 20 videos on Hallway

YouTube
  • Recommended by 1 person: 1 on Stack Overflow and its sister sites.
  • Presented by Siyamed Sinir, Clara Bayarri, and Florina Muntenescu
  • Made by the vendor. The company whose product it covers made or sponsored it.
  • May be out of date. Uploaded 8 years ago, in an area where tools change fast.

Intermediate. Assumes working knowledge.

32K views8 years ago1 recommendation

Mobile developmentAndroid and Jetpack ComposePerformance and optimization

Siyamed Sinir, Clara Bayarri, and Florina Muntenescu explain how to work with text in Android, covering styling with spans, hyphenation, and performance optimization.

This session will cover common usages of text in Android apps, and common pitfalls developers fall into that can be avoided. Topics to be covered include styling with spans, working with editable text, measuring your own text, when and how to use different hyphenation algorithms, and a strong emphasis on performance issues and how to avoid them. Some best practices will be demonstrated in a short live demo. Rate this session by signing-in on the I/O website here → goo.gl/mqd1v5 Watch more Android sessions from I/O '18 here → goo.gl/R9L42F See all the sessions from Google I/O '18 here → goo.gl/q1Tr8x Subscribe to the Android Developers channel → goo.gl/GEh1ds #io18 event: Google I/O 2018; re_ty: Publish; product: Android - Platform; fullname: Siyamed Sinir, Clara Bayarri, Florina Muntenescu; event: Google I/O 2018;

Why it's here

1 person recommends this

What people say. Recommended for troubleshooting Android TextView auto-sizing and text break strategies.

Moments people linked to

android developeron Stack Overflow • Recommends

On “Android autosizing TextViews split up words before decreasing font size”

I've actually reported about this issue in the past ( here and here , one you've already found out about), but it seems there is a solution, or at least it seems to work for me. I think the tip could help: link to this video https://developer.android.com/reference/android/widget/TextView#setBreakStrategy(int) This means you can choose the break strategy for the textView. Example: <TextView android:layout_width="250dp" android:layout_height="wrap_content" android:background="#f00" android:breakStrategy="balanced" android:hyphenationFrequency="none" android:text="This is an example text" android:textSize="30dp" app:autoSizeTextType="uniform"/> Sadly, this doesn't always seem to w…
6View the answer