32

Advanced webOS, Stanford

  • Upload
    fpatton

  • View
    1.573

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Advanced webOS, Stanford
Page 2: Advanced webOS, Stanford

Advanced webOSJustin Tulloss

Sr. Software EngineerApril 24, 2010

Page 3: Advanced webOS, Stanford

Overview

• Multi-Stage basics• Dashboards• Popups• Relaunching• The Future• Q&A

Page 4: Advanced webOS, Stanford

Why is this so complicated?

• Big departure from normal browser behavior• webOS offers a lot of different interactions• Performance issues led to complications• Expected globals (document, window, etc.)• Late recognition of the problem by Palm. Sorry.

The web isn’t designed for multi-window apps

Page 5: Advanced webOS, Stanford

Multi-Stage

Page 6: Advanced webOS, Stanford

Things to consider

• Do you need another stage? Every time?• What is the most appropriate stage type?

• How often do you rely on globals?• Prototype, jquery, document?

• What state is shared between children?

Page 7: Advanced webOS, Stanford

Basic APIs

Page 8: Advanced webOS, Stanford

From a scene assistant

Page 9: Advanced webOS, Stanford

Stage Types

• Card• Dashboard• Popup

Page 10: Advanced webOS, Stanford

Dashboards and

Page 11: Advanced webOS, Stanford

Example: MainAssistant

Page 12: Advanced webOS, Stanford

Example: DashboardStageAssistant

Page 13: Advanced webOS, Stanford

Example: Message View

Page 14: Advanced webOS, Stanford

Example: MessageAssistant

Page 15: Advanced webOS, Stanford

Popups

Page 16: Advanced webOS, Stanford

Some new twists

• Refactor child stage assistant to be generic• Not all stylesheets are loaded

• Some styles are changed to assume a notification• Popups can have their height specified• Closing child windows is easy

Page 17: Advanced webOS, Stanford

Example: New ChildStageAssistant

Page 18: Advanced webOS, Stanford

Example: Pushing dashboard scene moved

Page 19: Advanced webOS, Stanford

Example: Creating a popup

Page 20: Advanced webOS, Stanford

Example: Popup scene

Page 21: Advanced webOS, Stanford

Example: Popup assistant

Page 22: Advanced webOS, Stanford

Example: Very simple popup

Page 23: Advanced webOS, Stanford

Relaunching

Page 24: Advanced webOS, Stanford

Relaunching basics

• Certain actions cause your app to be “relaunched”• The appManager service passes in arguments• Your AppAssistant can change default launch

behavior• You should never have to worry about whether or

not your app was already open

Page 25: Advanced webOS, Stanford

AppAssistant

• Shared across all child stages• Handles relaunching• Convenient place to stick shared state

• Try not to share state.

Page 26: Advanced webOS, Stanford

Example: App Assistant

Page 27: Advanced webOS, Stanford

Example: Setting Default Stage

Page 28: Advanced webOS, Stanford

Example: Launch Parameters in banner

Page 29: Advanced webOS, Stanford

The Future

Page 30: Advanced webOS, Stanford

Upcoming API improvements

• Default dashboards no longer require markup boilerplate• Just provide an icon, some text, and a count• Handles going from single item to multiple

• SingletonStages• No more stageProxy shenanigans.• Failure cases are handled more elegantly

Page 31: Advanced webOS, Stanford

&Q A

Page 32: Advanced webOS, Stanford