Se ha denunciado esta presentación.
Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.

Android: Recent Text Features

The slide used in Shibuya.apk#31

  • Sé el primero en comentar

Android: Recent Text Features

  1. 1. Recent Text Features Old and New features Seigo Nonaka Android Text @ Google @ttuusskk
  2. 2. PrecomputedText ● Used for background text layout ● Easy integration with RecyclerView recyclerView.adapter = object: RecyclerView.Adapter<Holder>() { override fun onBindViewHolder(holder: Holder, position: Int) { Holder.view.apply { setTextFuture( PrecomputedTextCompat.getTextFuture( sampleText[position], textMetricsParamsCompat, null) ) } } }
  3. 3. Performance Improvement ● Removed global mutex lock during doing text layout. 0 25 50 75 100 milliseconds 125 150 175 API27 API27 API27 API28 1 thread 2 threads 4 thread 8 threads 34.9 49.0 82.1 318.7 22.1 22.5 26.5 82.6
  4. 4. Typeface.Builder ● Replacement for createFromAsset, createFromFile. ● Variable Font Support (later) ● Font Collection Support textView1.typeface = Typeface.Builder(assets, "NotoSansCJK-Regular.ttc") .setTtcIndex(0).build() textView2.typeface = Typeface.Builder(assets, "NotoSansCJK-Regular.ttc") .setTtcIndex(1).build() textView3.typeface = Typeface.Builder(assets, "NotoSansCJK-Regular.ttc") .setTtcIndex(2).build() textView4.typeface = Typeface.Builder(assets, "NotoSansCJK-Regular.ttc") .setTtcIndex(3).build()
  5. 5. Variable Font ● OpenType Variable Font ● Either string representation or FontVariationAxis class can be used. textView1.typeface = Typeface.Builder(assets, "AdobeVFPrototype.ttf") .setFontVariationSettings("'wght' 200").build() textView2.typeface = Typeface.Builder(assets, "AdobeVFPrototype.ttf") .setFontVariationSettings("'wght' 400").build() textView3.typeface = Typeface.Builder(assets, "AdobeVFPrototype.ttf") .setFontVariationSettings("'wght' 700").build() textView4.typeface = Typeface.Builder(assets, "AdobeVFPrototype.ttf") .setFontVariationSettings("'wght' 900").build()
  6. 6. Locale List Fallback ● Font selector is now aware of locale list ● By default, system locale settings is used. textView1.textLocales = LocaleList.forLanguageTags("en-US,ja-JP") textView2.textLocales = LocaleList.forLanguageTags("en-US,zh-CN") textView3.textLocales = LocaleList.forLanguageTags("en-US,zh-TW") textView4.textLocales = LocaleList.forLanguageTags("ja-JP,zh-TW")
  7. 7. Serif Fallback ● System font is now aware of serif font. ● Use serif font if fonFamily=”serif” is specified.
  8. 8. Justification ● Justification by whitespaces ● API is available since API 26, but due to bug, please use it API 28+
  9. 9. Line Spacing Improvement ● Avoid glyph overlap for the taller glyph languages. ● Enabled by default API 28+ ● You can move back to old impl by specifying fallbackLineSpacing=”false”
  10. 10. Thank you for your attention!

    Sé el primero en comentar

    Inicia sesión para ver los comentarios

  • yumios

    Mar. 8, 2021

The slide used in Shibuya.apk#31

Vistas

Total de vistas

492

En Slideshare

0

De embebidos

0

Número de embebidos

16

Acciones

Descargas

0

Compartidos

0

Comentarios

0

Me gusta

1

×