Postingan

Menampilkan postingan dengan label text

What’s new for text in Android Q

Gambar
Posted by Florina Muntenescu , Android Developer Advocate Displaying text is an important task in most apps, so in Android Q we're continuing to introduce new features to support your needs and improve performance. We disabled hyphenation by default, enabled creating a typeface using multiple fonts or font families, exposed the list of fonts installed on the device, and improved some of the most-used text styling APIs. Hyphenation is off by default in Android Q and AppCompat v1.1.0 Our performance tests showed that when hyphenation is enabled, up to 70% of the time spent on measuring text is on hyphenation. Hyphenation takes up to 70% of the time spent measuring text Given that hyphenation often isn’t needed for all TextViews in an app, and because of the impact on performance, we decided to turn hyphenation off by default in Android Q and AppCompat v1.1.0. If you want to use hyphenation, you need to manually turn it on in your app by setting the hyphenation frequency to normal. Y...

What's new for text in Android P

Gambar
Posted by Florina Muntenescu , Developer Advocate & Siyamed Sinir Android Text Technical Lead In " What's new in Android P Beta " we mentioned two of the new text features in Android.. Now that Android P Beta 2 and the final APIs are here, it's time to dive deeper into what's new for text. We know that TextView is one of the most critical components of the Android view system. This is why we continue to invest in both developer- and user-facing features and API improvements. PrecomputedText Displaying text can be complex, encompassing features like multiple fonts, line spacing, letter spacing, text direction, line breaking, hyphenation and more. TextView has to do a lot of work to measure and lay out the given text: reading the font file, finding a glyph, decide the shape, measure the bounding box, and caching the word in an internal word cache. What's more, all of this work takes place on the UI thread, where it could potentially cause your app to drop...