Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Pushing Android’s Boundaries For Pinterest’s New Look

Thorben Primke
September 29, 2016

Pushing Android’s Boundaries For Pinterest’s New Look

Thorben Primke

September 29, 2016
Tweet

More Decks by Thorben Primke

Other Decks in Technology

Transcript

  1. Core Experience team — Speed / Stability / Dev velocity

    Lin Wang Shopping team — Making Pins buyable Thorben Primke
  2. Brio point •Basic unit of measurement •Device size independent •Platform

    independent 3x3 sw160dp 4x4 sw360dp 6x5 sw480dp dp Boint dp Boint Boint dp Brio point (Boint)
  3. Brio point Boint to DP ratio Device width in DP

    Category Device Horizontal DP per Boint Vertical DP per Boint sw160dp Small Phone sw360dp Phone sw480dp Note sw600dp Tablet Boint dp
  4. Brio point Boint to DP ratio Device width in DP

    Category Device Horizontal DP per Boint Vertical DP per Boint sw160dp Small Phone Samsung S3 Mini sw360dp Phone Samsung S6 sw480dp Note Galaxy Note 4 sw600dp Tablet Nexus 9 Boint dp
  5. Brio point Boint to DP ratio Device width in DP

    Category Device Horizontal DP per Boint Vertical DP per Boint sw160dp Small Phone Samsung S3 Mini 3 3 sw360dp Phone Samsung S6 4 4 sw480dp Note Galaxy Note 4 6 5 sw600dp Tablet Nexus 9 8 6 Boint dp
  6. Brio point Design example •Pin representation •1 brio point is

    4dp horizontally and vertically 2dp Boint dp dp Boint dp Boint
  7. Framework •12 columns •13 gutters •Fixed gutter width: 4 Brio

    points •Variable column width 12:3 0 column gutter Brio grid
  8. Brio grid •12 columns •13 gutters •Fixed gutter width: 4

    Brio points •Variable column width •Content aligned on columns •Content acquire more attentions 12:3 0 12:3 0 column gutter Framework
  9. Brio grid Brio units 12:30 10bt 1bt 6c Boint dp

    dp Boint dp Boint column gutter
  10. Brio grid 12:30 10bt 1bt 6c James Greenfield This is

    a sample message that crosses over in two lines and goes on for a while. 27 Jun Alvin Armstrong This is a sample message that crosses over in two lines and goes on for a while.This is a sample message that crosses over in two lines and goes on fo… 2h Lisa Richards This is a sample message that crosses over in two lines and goes on for a while.This is a sample message. 10h Lisa Richards This is a sample message that crosses over in two lines and goes on for a while.This is a sample message. 10h Owen Brown This is a sample message that crosses over in two lines and goes on for a while.This is a sample message that crosses over in two lines and goes on fo… 2d Owen Brown This is a sample message that crosses over in two lines and goes on for a while.This is a sample message that crosses over in two lines and goes on fo… 2d Lester Nygaard This is a sample message that crosses over in two lines and goes on for a while.This is a sample message. 2d 2d Lorne Malvo This is a sample message that crosses over in two lines and goes on for a while.This is a sample message that crosses over in two lines and goes on fo… 18 Jul Messages 12:00 4c 1bt 10bt
  11. Brio grid 12:30 10bt 1bt 6c James Greenfield This is

    a sample message that crosses over in two lines and goes on for a while. 27 Jun Alvin Armstrong This is a sample message that crosses over in two lines and goes on for a while.This is a sample message that crosses over in two lines and goes on fo… 2h Lisa Richards This is a sample message that crosses over in two lines and goes on for a while.This is a sample message. 10h Lisa Richards This is a sample message that crosses over in two lines and goes on for a while.This is a sample message. 10h Owen Brown This is a sample message that crosses over in two lines and goes on for a while.This is a sample message that crosses over in two lines and goes on fo… 2d Owen Brown This is a sample message that crosses over in two lines and goes on for a while.This is a sample message that crosses over in two lines and goes on fo… 2d Lester Nygaard This is a sample message that crosses over in two lines and goes on for a while.This is a sample message. 2d 2d Lorne Malvo This is a sample message that crosses over in two lines and goes on for a while.This is a sample message that crosses over in two lines and goes on fo… 18 Jul Messages 12:00 4c 1bt 10bt
  12. Brio grid 12:30 10bt 1bt 6c James Greenfield This is

    a sample message that crosses over in two lines and goes on for a while. 27 Jun Alvin Armstrong This is a sample message that crosses over in two lines and goes on for a while.This is a sample message that crosses over in two lines and goes on fo… 2h Lisa Richards This is a sample message that crosses over in two lines and goes on for a while.This is a sample message. 10h Lisa Richards This is a sample message that crosses over in two lines and goes on for a while.This is a sample message. 10h Owen Brown This is a sample message that crosses over in two lines and goes on for a while.This is a sample message that crosses over in two lines and goes on fo… 2d Owen Brown This is a sample message that crosses over in two lines and goes on for a while.This is a sample message that crosses over in two lines and goes on fo… 2d Lester Nygaard This is a sample message that crosses over in two lines and goes on for a while.This is a sample message. 2d 2d Lorne Malvo This is a sample message that crosses over in two lines and goes on for a while.This is a sample message that crosses over in two lines and goes on fo… 18 Jul Messages 12:00 4c 1bt 10bt
  13. Brio grid 12:30 10bt 1bt 6c James Greenfield This is

    a sample message that crosses over in two lines and goes on for a while. 27 Jun Alvin Armstrong This is a sample message that crosses over in two lines and goes on for a while.This is a sample message that crosses over in two lines and goes on fo… 2h Lisa Richards This is a sample message that crosses over in two lines and goes on for a while.This is a sample message. 10h Lisa Richards This is a sample message that crosses over in two lines and goes on for a while.This is a sample message. 10h Owen Brown This is a sample message that crosses over in two lines and goes on for a while.This is a sample message that crosses over in two lines and goes on fo… 2d Owen Brown This is a sample message that crosses over in two lines and goes on for a while.This is a sample message that crosses over in two lines and goes on fo… 2d Lester Nygaard This is a sample message that crosses over in two lines and goes on for a while.This is a sample message. 2d 2d Lorne Malvo This is a sample message that crosses over in two lines and goes on for a while.This is a sample message that crosses over in two lines and goes on fo… 18 Jul Messages 12:00 4c 1bt 10bt 6c 10bt 1bt
  14. Brio in xml 12:30 10bt 1bt 6c Define custom attributes

    in attrs.xml Support dp, Brio point, column, gutter 2 1
  15. Lint and validation Custom lint rule •Pattern correctness • valid:

    5bt, g2-g5, 3dp, etc • invalid: 2, abc, -, 3bts, g3-g1 •Android and Brio attributes uniqueness • choose either brio:paddingLeft or android:paddingLeft •String reference validation • brio:paddingLeft=“@string/dimen_common_padding_1bt” • <string name=“dimen_common_padding_1bt”>1bt</string>
  16. Performance Average time (ms) spent on view inflation • org

    - Original settings view • profile - Settings view + 100 text views • profile_brio - Settings view + 100 text views (Brio attributes) • profile_huge - Settings view + 1000 text views (Brio attributes) Galaxy S7 org profile profile_brio profile_huge Use generic inflater (off) use hooks (off) 11.83 45.84 46.31 391.52 Use generic inflater (on) use hooks (off) 13.03 44.75 47.15 371.63 Use generic inflater (on) use hooks (on) 15.82 58.82 69.69 589.36
  17. Performance Average time (ms) spent on view inflation Galaxy S7

    org profile profile_brio profile_huge Use generic inflater (off) use hooks (off) 11.83 45.84 46.31 391.52 Use generic inflater (on) use hooks (off) 13.03 44.75 47.15 371.63 Use generic inflater (on) use hooks (on) 15.82 58.82 69.69 589.36 • org - Original settings view • profile - Settings view + 100 text views • profile_brio - Settings view + 100 text views (Brio attributes) • profile_huge - Settings view + 1000 text views (Brio attributes)
  18. Inflate in Java Internal Brio conversion functions •Performance • Most

    efficient without xml parsing •Readability • Poor, boilerplate code
  19. (Kotlin) •Readability • as clear as xml •Performance • No

    xml parsing, same as Do it in Java •Usability • Most xml attributes are defined in DSL • Easy to add if not Anko
  20. Leading support Available since day one •Line spacing in TextView

    (Api 1) •Multiplier, additive value Typography is awesome. Delights pinners. Typography is awesome. Delights pinners. Typography is awesome. Delights pinners.
  21. Tracking support Lollipop for the win •Tracking or letter spacing

    (Api 21) •Value in “em” Typography is awesome. Delights pinners. Typography is awesome. Delights pinners. Typography is awesome. Delights pinners.
  22. Tracking support Spans to the rescue … D r o

    i d c o n N Y C D r o i d c o n N Y C •ScaleXSpan •Non-breaking space •Increase/decrease space width
  23. Word spacing support Beyond the limits •No TextView support •Span

    technique Droidcon NYC Droidcon NYC Droidcon NYC
  24. Auto fitting support Avoids endless tweaking •Internationalization •Single or multi

    line •Max reduce two text styles •Last option ellipsis
  25. Beyond TextView Reusing the foundation Leading Tracking (21+) Word spacing

    AutoFit TextView x x x x EditText x x Button x x x TextPaint x x
  26. Feedback to the user •Solution at the platform level •Changeable

    across all usages •Support nested elements Tap state animations
  27. Feedback to the user •Solution at the platform level •Changeable

    across all usages •Support nested elements Tap state animations
  28. Feedback to the user •Solution at the platform level •Changeable

    across all usages •Support nested elements •No interference Tap state animations Button