SlideShare ist ein Scribd-Unternehmen logo
1 von 39
Downloaden Sie, um offline zu lesen
How to get that native look & feel
using bbUI.js and Alice.js

@n_adam_stanley
May 25, 2012
Welcome

 Adam Stanley
     Mobile web specialist
     BlackBerry Developer Relations

 Follow me on Twitter:
     @n_adam_stanley

 Likes:
     HTML5
     Bacon
     Ninjas                           2
BlackBerry Web Platform

    Driven by strong Web
     standards support
    Powered by WebKit      http://html5test.com   http://acid3.acidtests.org

    HTML5 and CSS3
    Flash 11 and WebGL




                                http://www.craftymind.com/guimark3/
BlackBerry 10

 Next generation platform
     HTML5 / WebWorks
     Native NDK
     Android
     Adobe AIR


 BlackBerry 10 Jam World Tour
     Moscow: June 26, 2012
     http://www.blackberryjamworldtour.com/
bbUI.js
BlackBerry UI JavaScript framework




                                     5
Framework Goals

   BlackBerry Look and Feel
   Common UI
   Inline with BlackBerry UX guidelines
   Screen Management
   Performance and Memory optimization
   Open and collaborative



                                           6
Philosophy

 Scales with the platform
       Both capabilities and resolution/pixel density
   Dynamic based on capabilities
   Custom HTML “data-” attributes
   Control based layout
   Off-DOM manipulation

               Performance                               Memory Usage


                                                                        7
Current State

 Now version 0.9.1 BETA

 Supports BlackBerry OS v.5, 6, 7, PlayBook and BB10
     BlackBerry OS 5 support needs a bit of work…

 Open Source:
   http://www.github.com/blackberry/bbUI.js


 Still in the “incubating” phase
                                                        8
bbUI.js
Time for a demo!




                   9
Configuration document
 Config.xml:
     <rim:navigation mode=“focus”/>
     <feature id=“blackberry.system.event” />
     <feature id=“blackbery.app” />

 If using dropdowns on BlackBerry 5/6/7:
     <feature id=“blackberry.ui.dialog” />

 If using menus
     <feature id=“blackberry.ui.menu”/>
     <feature id=“blackberry.app.event”/>
                                                 10
Toolkit Initialization

 Mandatory initialization using bb.init(myoptions)
 Should be the first code you run on your main page
  myoptions = {
    onbackkey: null,                // Custom handler for back key on BlackBerry 5/6/7 smartphones
    onscreenready: null,            // Manipulate your screen before it's inserted into the DOM
    ondomready: null,               // Manipulate your screen after it's inserted into the DOM
    bb10ActionBarDark: false,        // If set to true, the action bar will use the dark theme
    bb10ControlsDark: false,        // If set to true, the controls and screen will use the dark theme
    bb10ForPlayBook: false,         // If set to true, PlayBook will be considered a BB10 device
    bb10AccentColor: '#2D566F',     // An accent color to be used for title bars and other areas
    bb10HighlightColor: '#00A8DF„   // A highlight color to use when a user selects an item
  }


                                                                                                         11
Screens

 Each screen is an individual HTML fragment file
     data-bb-type=“screen”

 Transition effects

 Title bar
     Back button on PlayBook
     Appears as an action bar back button on BlackBerry 10


                                                              12
Screen Code

<div data-bb-type="screen" data-bb-title="My Screen">

  <div data-bb-type="title"
      data-bb-caption="Title bar caption"
      data-bb-back-caption="Back">
  </div>

 <p> Hello World ! </p>

</div>
Screen Management

 App = Single page
     bbui-0.9.1.js/css files loaded once into this single page
     Screen = HTML fragment
     Screens loaded via AJAX

 Screen stack
     bb.pushscreen(…), bb.popscreen()
     bbUI.js traps HW “back” key to auto-close screens on BB5/6/7
     bbUI.js automatically handles “back” if you specify a back button
      on PlayBook or BlackBerry 10
                                                                          14
Screen Events

 onscreenready
     Assigned once, passed screen element
     Fires synchronously

 ondomready
     Assigned once, passed screen element
     Fires asynchronously




                                             15
Screen Management Code
<html>
  <head>
       <script type="text/javascript">
             bb.init({
               onscreenready : function(element, id) {
                         console.log(id + ‘ ready’); }
                     });
       </script>
  </head>
  <body onload="bb.pushScreen('menu.htm’,'menu');">
  </body>
</html>                                                  16
Styling & Scripting

 Screen specific CSS
     Inline OR linked (relative to app root)

 Dynamic resolution handling
     Fonts
     Images

 Screen specific JS
     Unload event fired if you need to do some clean-up

                                                           17
Code


<div data-bb-type="screen”>
  <link rel="stylesheet" href="css/screen1.css"></link>

  <script id="screen1JS" src="js/tabs.js"
      onunload="unloadPushListeners()">
  </script>
</div>




                                                      18
BlackBerry 10 Grid Lists

 Current
      Image data layouts
      Items declared in groups and rows
      Optional group headers
      16:9 format
      Images sized based on # items / row

 Next
    Allow “square” images
    Allow removal of titles
                                             19
BlackBerry 10 Action Bar

 Current
    Buttons and tabs
    Actions are for everything
     viewed on the screen
    Built in “Back” button
    >5 actions create slide in
     action overflow menu

 Next
    Tab overflow menu

                                  20
BlackBerry 10 Context Menu

 Current
    Press and hold context menu
    Actions to perform on a
     selection
    peek() or Show()
    Peek and then swipe gesture
    Get selected menu item
    Image list integration

 Next
    Integrate into Grid List
                                   21
Image Lists

 Seen in:
    Options screens
    Inbox
    Contacts
 Image, Title, Description,
  Accent Text
 Auto scaled
 Headers
 onclick events for items
                               22
Image List

<div data-bb-type="image-list">
  <div data-bb-type="item”
       data-bb-img="icon1.png”
       data-bb-title="Input Controls">
      Use native looking input controls
  </div>
  ...
</div>

                                          23
Buttons

 Can be used anywhere
 Buttons size to text
    Can stretch
 Onclick
 Enable/Disable




                         24
Buttons

<div data-bb-type="label-control-horizontal-row">
  <div data-bb-type="label">Font Style:</div>
  <div data-bb-type="button”
       onclick="alert('click');”
       id="plain">
    Plain
  </div>
</div>



                                                    25
Label/Control Container

 Used with rounded panel

 Supported formats:
    Left-justified label
    Right-justified button
    Stretched inputs

 Based on rows
                              26
Label/Control Container

<div data-bb-type="round-panel">
  <div data-bb-type="panel-header">Buttons</div>
  <div data-bb-type="label-control-container">
      <div data-bb-type="row">
            <div data-bb-type="label">Choose a
                  city:</div>
            <div data-bb-type="button"
                  onclick="openCityScreen()">
                  Brasilia
            </div>
...
                                                   27
Dropdowns

 <select>
 Can be used anywhere
 size to largest item
    Can stretch
 onchange
 setSelectedItem



                         28
Arrow Lists

 Variation on the Image list
 data-bb-type=
      “text-arrow-list”
• Items are:
   data-bb-type=“item”




                                29
BBM Bubbles

 Great for BBM-
  connected WebWorks
  apps
 Bubbles contain item(s)
 Bubbles left/right justified
 Items:
    Image
    Text description

                                 30
Future

 Goals:
     Stabilize BlackBerry 5 support
     Add more PlayBook elements
     More core controls for BlackBerry 10
     More transition effects


 How can you help?
     Become a contributor!
     http://www.github.com/blackberry/bbUI.js

                                                 31
Alice.js
A Lightweight Independent CSS Engine




                                       32
Framework Goals

 Visual effects library
     Hardware accelerated for fast animations and transitions
     Adds randomization to effects so they never go stale

 One line of code
     Apply an effect to any HTML element

 Open and collaborative
     http://blackberry.github.com/Alice
     Apache 2 license
                                                                 33
AliceJS Philosophy

 Simplicity
     One line of code for any effect
 CSS likeness
     Easy to one day perhaps integrate in the standard
 DOM-level animations
     Not just for image galleries
 Rich
     Collection of effects
 Organics
     effects are always mysteriously slightly different
Alice.js
Time for a demo!




                   35
Using Alice.js
<html>
  <body>
     <img id="e1" src="images/logo.png" onClick="animate(‘e1’)">
     <input id="e2" type="text" onClick="animate(‘e2’)" />

    <script src="js/src/alice.core.js"></script>
    <script src="js/src/alice.plugins.cheshire.js"></script>
    <script>
      var a = alice.init();

      function animate(id) {
          a.wobble([id], 10, "center", "1000ms", "ease-in-out");
      }
    </script>
  </body>
</html>
                                                                   36
CSS Likeness

JavaScript Code:
      a.wobble(["e1", "e2"], {value: 20, randomness: 80}, "center",
                             {value: 1000, randomness: 20}, "ease-in-out");

Putting CSS glasses on, it could look like this:
      #MyDiv {
        animate-wobble: randomize(20deg, 80%) center randomize(1000ms, 20%) ease-in-out;
      }

Or
      #MyDiv {
        animate-wobble-rotation: 5 80%;
        animate-wobble-anchor: center;
        animate-wobble-duration: 1000ms 20%;
        animate-wobble-timing-function: ease-in-out;
      }
15 OOTB Sub-Effects

                     Bounce         RaceFlag
                     Dance          Slide
                     Drain          Spin
                     Fade           Toss
                     Hinge          Twirl
                     PageFlip       Wobble
                     Pendulum       Zoom
                     PhantomZone    ...


      Use the builder tool to create your own effects
  http://blackberry.github.com/Alice/demos/builder.html
                                                          38
THANK YOU
@n_adam_stanley
May 25, 2012

Weitere ähnliche Inhalte

Andere mochten auch

Sinatra: прошлое, будущее и настоящее
Sinatra: прошлое, будущее и настоящееSinatra: прошлое, будущее и настоящее
Sinatra: прошлое, будущее и настоящее.toster
 
Laurent hasson blackberry
Laurent hasson blackberryLaurent hasson blackberry
Laurent hasson blackberryWeb Summit
 
JP Rangaswami SALESFORCE
JP Rangaswami SALESFORCEJP Rangaswami SALESFORCE
JP Rangaswami SALESFORCEWeb Summit
 
Oren Michels MASHERY
Oren Michels MASHERYOren Michels MASHERY
Oren Michels MASHERYWeb Summit
 
Практики применения JRuby
Практики применения JRubyПрактики применения JRuby
Практики применения JRuby.toster
 
Zvuk analiz sliv
Zvuk analiz slivZvuk analiz sliv
Zvuk analiz slivLoseva
 
Develop with love bb10
Develop with love bb10Develop with love bb10
Develop with love bb10Bhasker Thapan
 

Andere mochten auch (8)

Sinatra: прошлое, будущее и настоящее
Sinatra: прошлое, будущее и настоящееSinatra: прошлое, будущее и настоящее
Sinatra: прошлое, будущее и настоящее
 
Laurent hasson blackberry
Laurent hasson blackberryLaurent hasson blackberry
Laurent hasson blackberry
 
The Blackberry Opportunity (RIM) 160612
The Blackberry Opportunity (RIM) 160612The Blackberry Opportunity (RIM) 160612
The Blackberry Opportunity (RIM) 160612
 
JP Rangaswami SALESFORCE
JP Rangaswami SALESFORCEJP Rangaswami SALESFORCE
JP Rangaswami SALESFORCE
 
Oren Michels MASHERY
Oren Michels MASHERYOren Michels MASHERY
Oren Michels MASHERY
 
Практики применения JRuby
Практики применения JRubyПрактики применения JRuby
Практики применения JRuby
 
Zvuk analiz sliv
Zvuk analiz slivZvuk analiz sliv
Zvuk analiz sliv
 
Develop with love bb10
Develop with love bb10Develop with love bb10
Develop with love bb10
 

Ähnlich wie Native look and feel bbui & alicejs

Web Apps and more
Web Apps and moreWeb Apps and more
Web Apps and moreYan Shi
 
Web app and more
Web app and moreWeb app and more
Web app and morefaming su
 
Windows 8 Pure Imagination - 2012-11-24 - Getting your HTML5 game Windows 8 r...
Windows 8 Pure Imagination - 2012-11-24 - Getting your HTML5 game Windows 8 r...Windows 8 Pure Imagination - 2012-11-24 - Getting your HTML5 game Windows 8 r...
Windows 8 Pure Imagination - 2012-11-24 - Getting your HTML5 game Windows 8 r...Frédéric Harper
 
Building Native Experiences with Electron
Building Native Experiences with ElectronBuilding Native Experiences with Electron
Building Native Experiences with ElectronBen Gotow
 
Netbiscuits @ SXSW Interactive: Android ≠ Android: Lessons Creating a JS Fram...
Netbiscuits @ SXSW Interactive: Android ≠ Android: Lessons Creating a JS Fram...Netbiscuits @ SXSW Interactive: Android ≠ Android: Lessons Creating a JS Fram...
Netbiscuits @ SXSW Interactive: Android ≠ Android: Lessons Creating a JS Fram...dbarkoe
 
openMIC barcamp 11.02.2010
openMIC barcamp 11.02.2010openMIC barcamp 11.02.2010
openMIC barcamp 11.02.2010Patrick Lauke
 
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.es
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.esCreating 3D Worlds with WebGL and Babylon.js - Codemotion.es
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.esdavrous
 
Develop Mobile App Using Android Lollipop
Develop Mobile App Using Android LollipopDevelop Mobile App Using Android Lollipop
Develop Mobile App Using Android LollipopEdureka!
 
Responsive websites. Toolbox
Responsive websites. ToolboxResponsive websites. Toolbox
Responsive websites. ToolboxWojtek Zając
 
“Good design is obvious. Great design is transparent.” — How we use Bootstrap...
“Good design is obvious. Great design is transparent.” — How we use Bootstrap...“Good design is obvious. Great design is transparent.” — How we use Bootstrap...
“Good design is obvious. Great design is transparent.” — How we use Bootstrap...Roni Banerjee
 
MOPCON 2014 - Best software architecture in app development
MOPCON 2014 - Best software architecture in app developmentMOPCON 2014 - Best software architecture in app development
MOPCON 2014 - Best software architecture in app developmentanistar sung
 
BlackBerry10 apps with Adobe AIR & Apache Flex - BlackBerry JAM Europe
BlackBerry10 apps with Adobe AIR & Apache Flex - BlackBerry JAM EuropeBlackBerry10 apps with Adobe AIR & Apache Flex - BlackBerry JAM Europe
BlackBerry10 apps with Adobe AIR & Apache Flex - BlackBerry JAM EuropeMariano Carrizo
 
Mirror - Android UI on steroids: Droidcon Cracow 2014
Mirror - Android UI on steroids: Droidcon Cracow 2014Mirror - Android UI on steroids: Droidcon Cracow 2014
Mirror - Android UI on steroids: Droidcon Cracow 2014Sylwester Madej
 
20150728 100분만에 배우는 windows 10 앱 개발
20150728 100분만에 배우는 windows 10 앱 개발20150728 100분만에 배우는 windows 10 앱 개발
20150728 100분만에 배우는 windows 10 앱 개발영욱 김
 
Android development 1july
Android development 1julyAndroid development 1july
Android development 1julyEdureka!
 
Everything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the WebEverything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the WebJames Rakich
 
Web Development for UX Designers
Web Development for UX DesignersWeb Development for UX Designers
Web Development for UX DesignersAshlimarie
 
JSLab. Ингвар Степанян. "React в разработке нативных WinRT/Windows Phone прил...
JSLab. Ингвар Степанян. "React в разработке нативных WinRT/Windows Phone прил...JSLab. Ингвар Степанян. "React в разработке нативных WinRT/Windows Phone прил...
JSLab. Ингвар Степанян. "React в разработке нативных WinRT/Windows Phone прил...GeeksLab Odessa
 

Ähnlich wie Native look and feel bbui & alicejs (20)

JavaScript Basics
JavaScript BasicsJavaScript Basics
JavaScript Basics
 
Web Apps and more
Web Apps and moreWeb Apps and more
Web Apps and more
 
Web app and more
Web app and moreWeb app and more
Web app and more
 
Windows 8 Pure Imagination - 2012-11-24 - Getting your HTML5 game Windows 8 r...
Windows 8 Pure Imagination - 2012-11-24 - Getting your HTML5 game Windows 8 r...Windows 8 Pure Imagination - 2012-11-24 - Getting your HTML5 game Windows 8 r...
Windows 8 Pure Imagination - 2012-11-24 - Getting your HTML5 game Windows 8 r...
 
Building Native Experiences with Electron
Building Native Experiences with ElectronBuilding Native Experiences with Electron
Building Native Experiences with Electron
 
Netbiscuits @ SXSW Interactive: Android ≠ Android: Lessons Creating a JS Fram...
Netbiscuits @ SXSW Interactive: Android ≠ Android: Lessons Creating a JS Fram...Netbiscuits @ SXSW Interactive: Android ≠ Android: Lessons Creating a JS Fram...
Netbiscuits @ SXSW Interactive: Android ≠ Android: Lessons Creating a JS Fram...
 
openMIC barcamp 11.02.2010
openMIC barcamp 11.02.2010openMIC barcamp 11.02.2010
openMIC barcamp 11.02.2010
 
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.es
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.esCreating 3D Worlds with WebGL and Babylon.js - Codemotion.es
Creating 3D Worlds with WebGL and Babylon.js - Codemotion.es
 
Develop Mobile App Using Android Lollipop
Develop Mobile App Using Android LollipopDevelop Mobile App Using Android Lollipop
Develop Mobile App Using Android Lollipop
 
Responsive websites. Toolbox
Responsive websites. ToolboxResponsive websites. Toolbox
Responsive websites. Toolbox
 
“Good design is obvious. Great design is transparent.” — How we use Bootstrap...
“Good design is obvious. Great design is transparent.” — How we use Bootstrap...“Good design is obvious. Great design is transparent.” — How we use Bootstrap...
“Good design is obvious. Great design is transparent.” — How we use Bootstrap...
 
MOPCON 2014 - Best software architecture in app development
MOPCON 2014 - Best software architecture in app developmentMOPCON 2014 - Best software architecture in app development
MOPCON 2014 - Best software architecture in app development
 
BlackBerry10 apps with Adobe AIR & Apache Flex - BlackBerry JAM Europe
BlackBerry10 apps with Adobe AIR & Apache Flex - BlackBerry JAM EuropeBlackBerry10 apps with Adobe AIR & Apache Flex - BlackBerry JAM Europe
BlackBerry10 apps with Adobe AIR & Apache Flex - BlackBerry JAM Europe
 
Mirror - Android UI on steroids: Droidcon Cracow 2014
Mirror - Android UI on steroids: Droidcon Cracow 2014Mirror - Android UI on steroids: Droidcon Cracow 2014
Mirror - Android UI on steroids: Droidcon Cracow 2014
 
20150728 100분만에 배우는 windows 10 앱 개발
20150728 100분만에 배우는 windows 10 앱 개발20150728 100분만에 배우는 windows 10 앱 개발
20150728 100분만에 배우는 windows 10 앱 개발
 
Android development 1july
Android development 1julyAndroid development 1july
Android development 1july
 
Everything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the WebEverything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the Web
 
Web Development for UX Designers
Web Development for UX DesignersWeb Development for UX Designers
Web Development for UX Designers
 
React for WinRT apps
React for WinRT appsReact for WinRT apps
React for WinRT apps
 
JSLab. Ингвар Степанян. "React в разработке нативных WinRT/Windows Phone прил...
JSLab. Ингвар Степанян. "React в разработке нативных WinRT/Windows Phone прил...JSLab. Ингвар Степанян. "React в разработке нативных WinRT/Windows Phone прил...
JSLab. Ингвар Степанян. "React в разработке нативных WinRT/Windows Phone прил...
 

Mehr von .toster

Attributes Unwrapped: Lessons under the surface of active record
Attributes Unwrapped: Lessons under the surface of active recordAttributes Unwrapped: Lessons under the surface of active record
Attributes Unwrapped: Lessons under the surface of active record.toster
 
Decyphering Rails 3
Decyphering Rails 3Decyphering Rails 3
Decyphering Rails 3.toster
 
Understanding the Rails web model and scalability options
Understanding the Rails web model and scalability optionsUnderstanding the Rails web model and scalability options
Understanding the Rails web model and scalability options.toster
 
Михаил Черномордиков
Михаил ЧерномордиковМихаил Черномордиков
Михаил Черномордиков.toster
 
Андрей Юношев
Андрей Юношев Андрей Юношев
Андрей Юношев .toster
 
Алексей Тарасенко - Zeptolab
Алексей Тарасенко - ZeptolabАлексей Тарасенко - Zeptolab
Алексей Тарасенко - Zeptolab.toster
 
Maximiliano Firtman - Разработка приложений с помощью PhoneGap
Maximiliano Firtman - Разработка приложений с помощью PhoneGap Maximiliano Firtman - Разработка приложений с помощью PhoneGap
Maximiliano Firtman - Разработка приложений с помощью PhoneGap .toster
 
Вадим Башуров
Вадим БашуровВадим Башуров
Вадим Башуров.toster
 
Вадим Башуров - Как откусить от яблока лимон
Вадим Башуров - Как откусить от яблока лимонВадим Башуров - Как откусить от яблока лимон
Вадим Башуров - Как откусить от яблока лимон.toster
 
Вадим Башуров - Как откусить от яблока лимон
Вадим Башуров - Как откусить от яблока лимонВадим Башуров - Как откусить от яблока лимон
Вадим Башуров - Как откусить от яблока лимон.toster
 
Pablo Villalba -
Pablo Villalba - Pablo Villalba -
Pablo Villalba - .toster
 
Jordi Romero Api for-the-mobile-era
Jordi Romero Api for-the-mobile-eraJordi Romero Api for-the-mobile-era
Jordi Romero Api for-the-mobile-era.toster
 
Презентация Юрия Ветрова (Mail.ru Group)
Презентация Юрия Ветрова (Mail.ru Group)Презентация Юрия Ветрова (Mail.ru Group)
Презентация Юрия Ветрова (Mail.ru Group).toster
 
Внутренняя архитектура и устройства соц. сети "Одноклассники"
Внутренняя архитектура и устройства соц. сети "Одноклассники"Внутренняя архитектура и устройства соц. сети "Одноклассники"
Внутренняя архитектура и устройства соц. сети "Одноклассники".toster
 
Reusable Code, for good or for awesome!
Reusable Code, for good or for awesome!Reusable Code, for good or for awesome!
Reusable Code, for good or for awesome!.toster
 
Matthew Eernisse, NodeJs, .toster {webdev}
Matthew Eernisse, NodeJs, .toster {webdev}Matthew Eernisse, NodeJs, .toster {webdev}
Matthew Eernisse, NodeJs, .toster {webdev}.toster
 
Wild wild web. html5 era
Wild wild web. html5 eraWild wild web. html5 era
Wild wild web. html5 era.toster
 
Web matrix
Web matrixWeb matrix
Web matrix.toster
 

Mehr von .toster (19)

Attributes Unwrapped: Lessons under the surface of active record
Attributes Unwrapped: Lessons under the surface of active recordAttributes Unwrapped: Lessons under the surface of active record
Attributes Unwrapped: Lessons under the surface of active record
 
Decyphering Rails 3
Decyphering Rails 3Decyphering Rails 3
Decyphering Rails 3
 
Understanding the Rails web model and scalability options
Understanding the Rails web model and scalability optionsUnderstanding the Rails web model and scalability options
Understanding the Rails web model and scalability options
 
Михаил Черномордиков
Михаил ЧерномордиковМихаил Черномордиков
Михаил Черномордиков
 
Андрей Юношев
Андрей Юношев Андрей Юношев
Андрей Юношев
 
Алексей Тарасенко - Zeptolab
Алексей Тарасенко - ZeptolabАлексей Тарасенко - Zeptolab
Алексей Тарасенко - Zeptolab
 
Maximiliano Firtman - Разработка приложений с помощью PhoneGap
Maximiliano Firtman - Разработка приложений с помощью PhoneGap Maximiliano Firtman - Разработка приложений с помощью PhoneGap
Maximiliano Firtman - Разработка приложений с помощью PhoneGap
 
Вадим Башуров
Вадим БашуровВадим Башуров
Вадим Башуров
 
Вадим Башуров - Как откусить от яблока лимон
Вадим Башуров - Как откусить от яблока лимонВадим Башуров - Как откусить от яблока лимон
Вадим Башуров - Как откусить от яблока лимон
 
Вадим Башуров - Как откусить от яблока лимон
Вадим Башуров - Как откусить от яблока лимонВадим Башуров - Как откусить от яблока лимон
Вадим Башуров - Как откусить от яблока лимон
 
Pablo Villalba -
Pablo Villalba - Pablo Villalba -
Pablo Villalba -
 
Jordi Romero Api for-the-mobile-era
Jordi Romero Api for-the-mobile-eraJordi Romero Api for-the-mobile-era
Jordi Romero Api for-the-mobile-era
 
Презентация Юрия Ветрова (Mail.ru Group)
Презентация Юрия Ветрова (Mail.ru Group)Презентация Юрия Ветрова (Mail.ru Group)
Презентация Юрия Ветрова (Mail.ru Group)
 
Внутренняя архитектура и устройства соц. сети "Одноклассники"
Внутренняя архитектура и устройства соц. сети "Одноклассники"Внутренняя архитектура и устройства соц. сети "Одноклассники"
Внутренняя архитектура и устройства соц. сети "Одноклассники"
 
Reusable Code, for good or for awesome!
Reusable Code, for good or for awesome!Reusable Code, for good or for awesome!
Reusable Code, for good or for awesome!
 
Matthew Eernisse, NodeJs, .toster {webdev}
Matthew Eernisse, NodeJs, .toster {webdev}Matthew Eernisse, NodeJs, .toster {webdev}
Matthew Eernisse, NodeJs, .toster {webdev}
 
Wild wild web. html5 era
Wild wild web. html5 eraWild wild web. html5 era
Wild wild web. html5 era
 
Web matrix
Web matrixWeb matrix
Web matrix
 
NodeJS
NodeJSNodeJS
NodeJS
 

Kürzlich hochgeladen

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 

Kürzlich hochgeladen (20)

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

Native look and feel bbui & alicejs

  • 1. How to get that native look & feel using bbUI.js and Alice.js @n_adam_stanley May 25, 2012
  • 2. Welcome  Adam Stanley  Mobile web specialist  BlackBerry Developer Relations  Follow me on Twitter:  @n_adam_stanley  Likes:  HTML5  Bacon  Ninjas 2
  • 3. BlackBerry Web Platform  Driven by strong Web standards support  Powered by WebKit http://html5test.com http://acid3.acidtests.org  HTML5 and CSS3  Flash 11 and WebGL http://www.craftymind.com/guimark3/
  • 4. BlackBerry 10  Next generation platform  HTML5 / WebWorks  Native NDK  Android  Adobe AIR  BlackBerry 10 Jam World Tour  Moscow: June 26, 2012  http://www.blackberryjamworldtour.com/
  • 6. Framework Goals  BlackBerry Look and Feel  Common UI  Inline with BlackBerry UX guidelines  Screen Management  Performance and Memory optimization  Open and collaborative 6
  • 7. Philosophy  Scales with the platform  Both capabilities and resolution/pixel density  Dynamic based on capabilities  Custom HTML “data-” attributes  Control based layout  Off-DOM manipulation Performance Memory Usage 7
  • 8. Current State  Now version 0.9.1 BETA  Supports BlackBerry OS v.5, 6, 7, PlayBook and BB10  BlackBerry OS 5 support needs a bit of work…  Open Source:  http://www.github.com/blackberry/bbUI.js  Still in the “incubating” phase 8
  • 10. Configuration document  Config.xml:  <rim:navigation mode=“focus”/>  <feature id=“blackberry.system.event” />  <feature id=“blackbery.app” />  If using dropdowns on BlackBerry 5/6/7:  <feature id=“blackberry.ui.dialog” />  If using menus  <feature id=“blackberry.ui.menu”/>  <feature id=“blackberry.app.event”/> 10
  • 11. Toolkit Initialization  Mandatory initialization using bb.init(myoptions)  Should be the first code you run on your main page myoptions = { onbackkey: null, // Custom handler for back key on BlackBerry 5/6/7 smartphones onscreenready: null, // Manipulate your screen before it's inserted into the DOM ondomready: null, // Manipulate your screen after it's inserted into the DOM bb10ActionBarDark: false, // If set to true, the action bar will use the dark theme bb10ControlsDark: false, // If set to true, the controls and screen will use the dark theme bb10ForPlayBook: false, // If set to true, PlayBook will be considered a BB10 device bb10AccentColor: '#2D566F', // An accent color to be used for title bars and other areas bb10HighlightColor: '#00A8DF„ // A highlight color to use when a user selects an item } 11
  • 12. Screens  Each screen is an individual HTML fragment file  data-bb-type=“screen”  Transition effects  Title bar  Back button on PlayBook  Appears as an action bar back button on BlackBerry 10 12
  • 13. Screen Code <div data-bb-type="screen" data-bb-title="My Screen"> <div data-bb-type="title" data-bb-caption="Title bar caption" data-bb-back-caption="Back"> </div> <p> Hello World ! </p> </div>
  • 14. Screen Management  App = Single page  bbui-0.9.1.js/css files loaded once into this single page  Screen = HTML fragment  Screens loaded via AJAX  Screen stack  bb.pushscreen(…), bb.popscreen()  bbUI.js traps HW “back” key to auto-close screens on BB5/6/7  bbUI.js automatically handles “back” if you specify a back button on PlayBook or BlackBerry 10 14
  • 15. Screen Events  onscreenready  Assigned once, passed screen element  Fires synchronously  ondomready  Assigned once, passed screen element  Fires asynchronously 15
  • 16. Screen Management Code <html> <head> <script type="text/javascript"> bb.init({ onscreenready : function(element, id) { console.log(id + ‘ ready’); } }); </script> </head> <body onload="bb.pushScreen('menu.htm’,'menu');"> </body> </html> 16
  • 17. Styling & Scripting  Screen specific CSS  Inline OR linked (relative to app root)  Dynamic resolution handling  Fonts  Images  Screen specific JS  Unload event fired if you need to do some clean-up 17
  • 18. Code <div data-bb-type="screen”> <link rel="stylesheet" href="css/screen1.css"></link> <script id="screen1JS" src="js/tabs.js" onunload="unloadPushListeners()"> </script> </div> 18
  • 19. BlackBerry 10 Grid Lists  Current  Image data layouts  Items declared in groups and rows  Optional group headers  16:9 format  Images sized based on # items / row  Next  Allow “square” images  Allow removal of titles 19
  • 20. BlackBerry 10 Action Bar  Current  Buttons and tabs  Actions are for everything viewed on the screen  Built in “Back” button  >5 actions create slide in action overflow menu  Next  Tab overflow menu 20
  • 21. BlackBerry 10 Context Menu  Current  Press and hold context menu  Actions to perform on a selection  peek() or Show()  Peek and then swipe gesture  Get selected menu item  Image list integration  Next  Integrate into Grid List 21
  • 22. Image Lists  Seen in:  Options screens  Inbox  Contacts  Image, Title, Description, Accent Text  Auto scaled  Headers  onclick events for items 22
  • 23. Image List <div data-bb-type="image-list"> <div data-bb-type="item” data-bb-img="icon1.png” data-bb-title="Input Controls"> Use native looking input controls </div> ... </div> 23
  • 24. Buttons  Can be used anywhere  Buttons size to text  Can stretch  Onclick  Enable/Disable 24
  • 25. Buttons <div data-bb-type="label-control-horizontal-row"> <div data-bb-type="label">Font Style:</div> <div data-bb-type="button” onclick="alert('click');” id="plain"> Plain </div> </div> 25
  • 26. Label/Control Container  Used with rounded panel  Supported formats:  Left-justified label  Right-justified button  Stretched inputs  Based on rows 26
  • 27. Label/Control Container <div data-bb-type="round-panel"> <div data-bb-type="panel-header">Buttons</div> <div data-bb-type="label-control-container"> <div data-bb-type="row"> <div data-bb-type="label">Choose a city:</div> <div data-bb-type="button" onclick="openCityScreen()"> Brasilia </div> ... 27
  • 28. Dropdowns  <select>  Can be used anywhere  size to largest item  Can stretch  onchange  setSelectedItem 28
  • 29. Arrow Lists  Variation on the Image list  data-bb-type= “text-arrow-list” • Items are: data-bb-type=“item” 29
  • 30. BBM Bubbles  Great for BBM- connected WebWorks apps  Bubbles contain item(s)  Bubbles left/right justified  Items:  Image  Text description 30
  • 31. Future  Goals:  Stabilize BlackBerry 5 support  Add more PlayBook elements  More core controls for BlackBerry 10  More transition effects  How can you help?  Become a contributor!  http://www.github.com/blackberry/bbUI.js 31
  • 33. Framework Goals  Visual effects library  Hardware accelerated for fast animations and transitions  Adds randomization to effects so they never go stale  One line of code  Apply an effect to any HTML element  Open and collaborative  http://blackberry.github.com/Alice  Apache 2 license 33
  • 34. AliceJS Philosophy  Simplicity  One line of code for any effect  CSS likeness  Easy to one day perhaps integrate in the standard  DOM-level animations  Not just for image galleries  Rich  Collection of effects  Organics  effects are always mysteriously slightly different
  • 36. Using Alice.js <html> <body> <img id="e1" src="images/logo.png" onClick="animate(‘e1’)"> <input id="e2" type="text" onClick="animate(‘e2’)" /> <script src="js/src/alice.core.js"></script> <script src="js/src/alice.plugins.cheshire.js"></script> <script> var a = alice.init(); function animate(id) { a.wobble([id], 10, "center", "1000ms", "ease-in-out"); } </script> </body> </html> 36
  • 37. CSS Likeness JavaScript Code: a.wobble(["e1", "e2"], {value: 20, randomness: 80}, "center", {value: 1000, randomness: 20}, "ease-in-out"); Putting CSS glasses on, it could look like this: #MyDiv { animate-wobble: randomize(20deg, 80%) center randomize(1000ms, 20%) ease-in-out; } Or #MyDiv { animate-wobble-rotation: 5 80%; animate-wobble-anchor: center; animate-wobble-duration: 1000ms 20%; animate-wobble-timing-function: ease-in-out; }
  • 38. 15 OOTB Sub-Effects Bounce RaceFlag Dance Slide Drain Spin Fade Toss Hinge Twirl PageFlip Wobble Pendulum Zoom PhantomZone ... Use the builder tool to create your own effects http://blackberry.github.com/Alice/demos/builder.html 38