Slide 1

Slide 1 text

A11y lessons from iOS Weather App design . accessibility . android Karan Sharma www.ksharma.xyz

Slide 2

Slide 2 text

DayTile()

Slide 3

Slide 3 text

Font Scale: Normal Font Scale: Large DayTile() Observation ● When the font size is increased to an extent that the text / items cannot be displayed next to each other horizontally, then display the items vertically. ● Hide the TemperatureBar and display L and H prefix for low and high temperature. ● The start position of each element such as icon, text, temperature bar for each item in a list should be same.

Slide 4

Slide 4 text

Font Scale: Large DayTile() What not to do ? At Large font scale, the horizontal space for the day text is limited. Also, the temperature bar is utilizing a lot of space which may not be useful at large font scale.

Slide 5

Slide 5 text

Font Scale: Normal Font Scale: Large DayTile() Technical Approach There are multiple ways to achieve this. We want to display either a Row or a Column of items based on font scale value. 1. One approach is to use an if else conditional logic to switch between a Row and Column. 2. Another approach can be to use a ConstraintLayout, however it will be hard to maintain all the conditional constraints. Since, maintaining the conditional constraints of the layout will be challenging, therefore, the first approach of switching between a Row and a Column seems easy and optimal at this time.

Slide 6

Slide 6 text

Font Scale: Normal Font Scale: Large DayTile() Code Code

Slide 7

Slide 7 text

Header()

Slide 8

Slide 8 text

Font Scale: Large Header() Font Scale: Normal Observation ● When the font size is increased beyond a certain threshold, then the text is aligned to the start of the screen in order to utilize all the given width.

Slide 9

Slide 9 text

TextAlign: Center Header() TextAlign: Start Observation Why is it a good idea to align to Start ? ● Aligning to Start will look more pretty ● Will also provide more room to grow for text. The difference is especially visible when the text is large and spans across more than one line. v/s

Slide 10

Slide 10 text

Header() Code Font Scale: Normal Font Scale: Large

Slide 11

Slide 11 text

WeatherConditionTile()

Slide 12

Slide 12 text

Font Scale: Large Font Scale: Normal Observation ● When the font size is increased beyond a certain threshold, then the tiles stretch to occupy all the horizontal space. ● The sticky header is also disabled while scrolling so as to provide maximum visibility area on the screen to read text. WeatherConditionTile()

Slide 13

Slide 13 text

Font Scale: Large Font Scale: Normal Observation ● The tiles are square in shape. I.e with equal height and width. The uniformity is maintained in all the tiles. ● When the font size is increased beyond a certain threshold, then the tiles stretch to occupy all the horizontal space. ● The sticky header is also disabled while scrolling so as to provide maximum visibility area on the screen to read text. WeatherConditionTile()

Slide 14

Slide 14 text

Code WeatherConditionTile()

Slide 15

Slide 15 text

Font Scale: Normal Foldable: Fold state ● Always display the UI in full stretch across the screen as the available width is very less. ~330dp WeatherConditionTile()

Slide 16

Slide 16 text

Font Scale: Normal Foldable: Unfold state When font scale is: ● Normal: 3 Column Layout ● Large: 1 Column Layout WeatherConditionTile() Font Scale: Large

Slide 17

Slide 17 text

Font Scale: Normal Mobile When font scale is: ● Normal: 2 Column Layout ● Large: 1 Column Layout WeatherConditionTile() Font Scale: Large

Slide 18

Slide 18 text

Font Scale: Large Tablet : Landscape Mode When font scale is: ● Normal: 5 Column Layout ● Large: 1 Column Layout WeatherConditionTile() Font Scale: Normal

Slide 19

Slide 19 text

Tablet : Portrait Mode When font scale is: ● Normal: 3 Column Layout ● Large: 1 Column Layout WeatherConditionTile() Font Scale: Normal