×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Feb 2008
    Posts
    5

    S60 Widget specification

    Hi All,

    i am trying to understand the widget specification for s60.
    It has 2 methods prepareForTransition and performTransition. I am not able to understand what is the objective behind these two functions.

    Is it something to do with the rendering mechanism.

    Cheers,
    Ashish

  2. #2
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,355

    Re: S60 Widget specification

    Though I am not "the expert" on this subject you are right, it is related to rendering and more precisely to avoiding flickering by making sure that all the components are updated at once.

    So first you call prepareForTransition, then make the needed changes to your components (show/hide some things, update their formatting or values) and then trigger the screen update by calling performTransition.

    The Wiki has some nice examples about widgets, make sure you check them out.

    P.S. I've moved this post to the right forum, you will get better advices here.

  3. #3
    Registered User
    Join Date
    Feb 2008
    Posts
    5

    Re: S60 Widget specification

    thanks for your quick reply.

    I am also studying the apple's dashboard specification which also has the widget's methods as :

    prepareForTransition

    Notifies Dashboard that you are about to perform a transition to or from its reverse side.
    widget.prepareForTransition(transition)
    This method prepares your widget for either showing or hiding its reverse side.
    Passing the string “ToFront” for transition disables screen updates within your widget’s user
    interface so that you can prepare it for displaying your widget’s reverse side. Passing the string
    “ToBack” for transition freezes your widget’s user interface so that you can prepare it for displaying
    the main contents again. When your HTML layers are ready, call performTransition to display
    them.

    performTransition

    Runs an animation to toggle between your widget’s reverse and contents.
    widget.performTransition()
    You call this method after first calling prepareForTransition, which indicates whether you are
    displaying your widget’s reverse side or contents. When you call performTransition, Dashboard
    begins an animation that makes the widget appear to flip over and display the new content.
    Prior to calling this method, you should also adjust the style sheet properties of your HTML to reflect
    the change in what is about to be displayed. For example, before calling this method to show your
    reverse side, you should show the HTML elements associated with your reverse side and hide those
    elements associated with your widget’s contents.

    this description is a little confusing for me. I thought both of them to be same. aren't they ?

    Thanks
    Ashish

  4. #4
    Registered User
    Join Date
    Feb 2008
    Posts
    5

    Re: S60 Widget specification

    Hi ltomuta,

    thnx for ur reply.
    I am still wondering what utility is been served by having these two functions. The webkit has its own rendering mechanism so by introducing these two functions which is highly optimized. So i dont understand why do we want to change it .

    Kindly help me in finding the solution for it.

    Ashish

  5. #5
    Regular Contributor
    Join Date
    Dec 2007
    Posts
    60

    Re: S60 Widget specification

    Quote Originally Posted by meetashish View Post
    Hi ltomuta,
    thnx for ur reply.
    I am still wondering what utility is been served by having these two functions. The webkit has its own rendering mechanism so by introducing these two functions which is highly optimized. So i dont understand why do we want to change it .
    The functions you mention are used to guide the web-runtime through a transition between two screens (or views) in a widget. You use them when you want to use the web-runtime -provided animation for a smooth view transition.

    The first function is a way for the widget to tell the web-runtime that the widget is now in the state that the transition will be done FROM. After calling that function the widget can perform its own state transition and the web-runtime will not update the rendering. I.e. at this point you could switch the view in the widget.

    The second function is a way for the widget to tell the web-runtime that the widget is now in the state that the transition will be done TO. After calling that function the web-runtime can render an animation that shows the widget transitioning smoothly between the two states (FROM => TO). Currently the web-runtime implements this transition as a cross-fade but the transition could basically be anything. 3D flips, fly-ins and fly-outs, etc.

    In principle you could just switch the view using JavaScript but then you'd be limited to the kind of effects you can do with HTML, CSS and JavaScript. In order to allow for more rich effects you need these two functions to synchronize the web-runtime and the widget through the state change.

    One way to think of it is so that each of those two functions takes a "photo" or "screenshot" of your widget. The first "photo" is from the FROM-state and the second is from the TO-state. After the second photo is taken the web-runtime will do some kind of nice transition animation between the two photos, e.g. cross-fade between them. The two functions are needed to allow the widget to tell the web-runtime when the widget is in the proper states for the "photos" to be taken.

    I hope that clears it up!

    Peppe
    Last edited by peppe@peppe.net; 2008-05-02 at 07:30.

  6. #6
    Registered User
    Join Date
    Apr 2008
    Posts
    14

    Re: S60 Widget specification

    Where is documented the transition values? How to define speed of the effect?

    Thanks

  7. #7
    Registered User
    Join Date
    Nov 2009
    Posts
    1

    Smile Re: S60 Widget specification

    where can i download this specification?
    thanks!

  8. #8
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,355

    Re: S60 Widget specification

    You can find an online version of the Web Developer's Library at http://library.forum.nokia.com (or browsing the Tools, Docs & code section above).
    -- Lucian

    If you are not yet a DVLUP member it is time to correct that mistake :) Click here to join: http://www.dvlup.com/lucian/Invite

  9. #9
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,405

    Re: S60 Widget specification

    Hi veilkrand,

    currently, the only supported transition mode is "fade". Also, you cannot specify the speed effect: a default value is always used.

    Pit

Similar Threads

  1. Replies: 158
    Last Post: 2012-05-23, 19:00
  2. UA Profile and Accept headers for S60 3rd Ed. FP 1 Browser
    By Nokia Ron in forum Mobile Web Site Development
    Replies: 5
    Last Post: 2009-10-07, 20:43
  3. HTTP headers for S60 3rd Ed. Browser
    By Nokia Ron in forum Mobile Web Site Development
    Replies: 16
    Last Post: 2009-09-22, 14:28
  4. Replies: 0
    Last Post: 2007-03-28, 08:59
  5. Almost all tools (S60 MIDP SDK B0.1, Nokia S60 SDK Symbian OS v0.3) Crashes
    By alexandershalamov in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2002-07-03, 13:44

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •