43
Crossing the Resolution Divide spanning an application across multiple devices James Ketrenos Cyrene Domogalla

Crossing the Resolution Divide

Embed Size (px)

DESCRIPTION

MeeGo Conference 2011 in San Francisco. Talk on density independence when developing MeeGo applications and how to address the issue through both code and generating proper graphics

Citation preview

Page 1: Crossing the Resolution Divide

Crossing the Resolution Divide spanning an application across multiple devices

James Ketrenos

Cyrene Domogalla

Page 2: Crossing the Resolution Divide

2

Cyrene Domogalla

Intel Interaction and Graphics Designer

James Ketrenos

Intel Software Architect and Developer

Who we are

Page 3: Crossing the Resolution Divide

3

Handset

800x480 – 4” – 233PPI

864x480 – 3.67” – 269PPI

960x640 – 3.5” – 326PPI

MeeGo can run on a variety of resolutions and display sizes -Some examples-

Tablet

1024x768 – 10” – 119PPI

1360x768 – 11.6” – 135PPI

So many choices…

Page 4: Crossing the Resolution Divide

4

So what?

Page 5: Crossing the Resolution Divide

5

Status bar is 30px tall and designed

for 150PPI

Seen on target 150PPI screen: ~5mm

(25.4mm/inch * 30px / 150px/inch)

Seen on 330PPI screen: 2.3mm

Seen on 110PPI screen: ~7mm

150PPI

110PPI

330PPI

Impact Graphics

Page 6: Crossing the Resolution Divide

6

Impact Layout

Page 7: Crossing the Resolution Divide

7

Touchable areas

Higher PPI devices makes buttons smaller and hard to hit

Gesture: Tap vs. Pan

“Tap” – 'down' and 'up' within a specific period of time and little movement

“Pan” – 'down' and more than a little movement

If movement threshold is defined in pixels then on high PPI handsets, triggering the “Tap” becomes difficult.

Impact Interaction

Page 8: Crossing the Resolution Divide

8

Fonts... similar to the graphics problem

Compounded by device usage – reading distance

“96DPI” desktop world defined to make fonts look (roughly) the same size as on paper given recommended viewing distance

Impact Legibility

Page 9: Crossing the Resolution Divide

9

What's the solution?

Page 10: Crossing the Resolution Divide

10

Specify the graphics and layout in physical units

Write your app using MeeGo.Ux.Units

Density Independence

Page 11: Crossing the Resolution Divide

11

QML element which ties into the display density (similar to QtMobility DisplayInfo)

Uses QX11Info::appDpiX()

Assumes square pixels – developers interested in non-square pixels can base similar code on DisplayInfo's full display metrics

What is MeeGo.Ux.Units?

Page 12: Crossing the Resolution Divide

12

real mm - Pixels per millimeter

real inch - Pixels per inch

real vp - Pixels per "virtual-pixel"

MeeGo.Ux.Units properties

Page 13: Crossing the Resolution Divide

13

The properties returned by Units are non-integer

units.mm is 4.3307087 on a 110PPI display

Working directly with units.mm = non-integer #s

Introduces crawling and inconsistent pixel layout

A note on rounding

Page 14: Crossing the Resolution Divide

14

Solution?

Page 15: Crossing the Resolution Divide

15

Use MeeGo.Ux.Units' conversion functions

Page 16: Crossing the Resolution Divide

16

int mm2px (real millimeters)

int inch2px (real inches)

int vp2px (real virtualPixels)

MeeGo.Ux.Units functions

Page 17: Crossing the Resolution Divide

17

A virtual pixel is the size of a pixel on a normalized 330PPI device.

Allows graphics to be designed “pixel perfect” while maintaining density independence

A single pixel border specified in mm/inches can introduce too much rounding error

What is a virtual pixel?

Page 18: Crossing the Resolution Divide

18

$ git clone git://meego.gitorious.org/meego-ux/meego-ux-components $ cd meego-ux-components $ qmake $ make && sudo make install

Getting MeeGo.Ux.Units

Page 19: Crossing the Resolution Divide

19

import Qt 4.7 import MeeGo.Ux.Units 0.1 Rectangle { Units { id: units } width: units.mm2px(100.0) height: units.mm2px(50.0) }

Example!

Page 20: Crossing the Resolution Divide

20

But... units only get you so far!

Page 21: Crossing the Resolution Divide

21

„Scaling up‟ preserves layout but not aesthetics

Scaling and Layout

Page 22: Crossing the Resolution Divide

22

A UI can‟t always just be scaled to fit the device specs.

Scaling and Layout

Page 23: Crossing the Resolution Divide

23

The paradigm likely will not fit

The UI may need to be completely redesigned

Scaling Down

www.funny-cat-pictures.com/

Page 24: Crossing the Resolution Divide

24

It is better to have a higher resolution image and scale

down than be stuck with an inflexible low res image

The problem with scaling

Page 25: Crossing the Resolution Divide

25

Sometimes you just have to make pixel perfect sized graphics for a larger or smaller design.

This is especially important when dealing with icons.

The problem with scaling

Page 26: Crossing the Resolution Divide

26

Separate your graphics from your icons

Icons are typically fixed size and connote a contextual meaning.

Graphics are used to create your layout - they provide the backgrounds, borders, and color but do not add any specific meaning.

Use BorderImage with sci files

Design Theme

Page 27: Crossing the Resolution Divide

27

BorderImage breaks images into 9 blocks

Border dimensions specifies which region of graphical asset to scale when filling

BorderImage with 4 pixel border on each side

Result when applied to a 200x32 element

Crash course on „BorderImage‟

Page 28: Crossing the Resolution Divide

28

QML allows you to specify the border dimensions directly in the QML

Crash course on SCI

Page 29: Crossing the Resolution Divide

29

However this is not designer friendly and could require code change with a graphics

update

Crash course on SCI

Page 30: Crossing the Resolution Divide

30

Instead – use SCI files

Crash course on SCI

Page 31: Crossing the Resolution Divide

31

SCI example

Instead of:

BorderImage { source: “frame.png” border.top: 4

border.right: 4 border.bottom: 4 border.left: 4 }

BorderImage { source: “frame.sci” }

and in frame.sci: source: frame.jpg border.top: 4

border.right: 4 border.bottom: 4 border.left: 4

Use:

Crash course on SCI

Page 32: Crossing the Resolution Divide

32

Generating Assets

Page 33: Crossing the Resolution Divide

33

Make sure your graphics are as scalable as possible.

Vector based graphics

Benefits of a vector graphic are -- super powers. They're based on math instead of pixels. You can easily manipulate them; they are easily update-able.

You can use scripts to pull them out of the application they are in.

Vector graphics

Page 34: Crossing the Resolution Divide

34

Regardless of your ability to use SVGs in MeeGo currently, graphics

made as SVG standard compliant will help you in the long run

The pretty pieces

Page 35: Crossing the Resolution Divide

35

Commercial:

Photoshop and Illustrator

Open source

Gimp and Inkscape

Illustrator and Inkscape are your vector programs

Gimp and Photoshop are better for layout

Tools

Page 36: Crossing the Resolution Divide

Interaction Best Practices

36

Page 37: Crossing the Resolution Divide

37

Interaction Best Methods

Think about how the user would hold the device

Does this effect your layout?

Does it need to change when the orientation changes

Where are the fingers likely to be?

Sides and bottom work well

Top is often a good spot for actions used less often

Page 38: Crossing the Resolution Divide

38

Interaction Best Methods

Keep your user in the know. Do your best to keep the

context of the interaction

How can you use animations to describe the touch

interaction?

Page 39: Crossing the Resolution Divide

39

Interaction Best Methods

Negative Space is your ally.

Page 40: Crossing the Resolution Divide

40

If you can, prototype.

Interaction Best Methods

Page 41: Crossing the Resolution Divide

41

Being clever can be brilliant or it can be trouble, so be

carefull!

Basically stick to the paradigms. It is tempting to re-invent,

but if it is confusing it is useless.

Use the components; they're there to help!

Interaction Best Methods

Page 42: Crossing the Resolution Divide

42

MeeGo Future

SVG support in theming

Automatic change if device density changes (screen migration)

Enhance BorderImage to support virtual pixel borders in .sci files

Pixel perfect size preference vs. automatic scaling

User and device specified font scaling support

Input resolution properties

Page 43: Crossing the Resolution Divide

43

Demo!