Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon


[ Edited ]

Here is an inwork copy of PageViewStack that allows pages to be animated in from any side.  You will probably need to change it's package path to get it to compile into your project.


To use it, in your root Sprite:

public class MyApp extends Sprite
  private var stack : PageViewStack;
  private var page1 : UIComponent = new UIComponent();
  private var page2 : UIComponent = new UIComponent();

  public function MyApp()
    this.stack = new PageViewStack( this );
    this.stack.addChild( this.page1 );
    this.stack.addChild( this.page2 );
    this.stage.nativeWindow.visible = true;

The pages (page1 and page2) would be typically derived classes from UIComponent.  You can have any number of pages.  The first page added will be shown by default.  The PageViewStack does not get added to the display list, it is just a manager of the pages.


To set a page, say from page1 (current page) to page2:

this.stack.setPageIndex( 1, PageViewStack.RIGHT_LEFT );


To go back to page1 (index 0);

this.stack.setPageIndex( 0, PageViewStack.LEFT_RIGHT );

 You can also got top/bottom and bottom/top.

The class also allows for left/right/top/bottom padding incase you have an application control bar somewhere.  Once the PB provides some means of orientation changes, the class will take care of that automatically (but each page will still need to reposition the components).


You can also set the time of the transition.  The default is 1.5 seconds.


This is still a work in progress.  Any input is appreciated.

Posts: 43
Registered: ‎12-22-2010
My Device: Not Specified

Re: Do we have any documentation for qnx.views package

OK, so I am not really an expert on Adobe platforms yet I think I can add something to here.

1. Views, as far as I understand, are non existing in Flex 4 but are heavily integrated in 4.5 (hero) mobile app dev framework by adobe. Now, I am not sure, but it seems that qnx view are basically deep implementation of those components -- or maybe similar concept natively supported.

The idea is very simple though, you organize your UI into pages and flip those pages (views) as you go in and out along your program logic. Note that AFAIK, Adobe want people to depply integrate that into their app logic and specifically at the UI level, i.e. the under the hood omponents are desired to be in the main part of the app.


2. There are multiple solutions to the "multi-page/view/etc" app logic implementation currently available in Flex 4.

2.1. States: If you are familiar with them, states are basically differet views of the same app, but the easy part is that you can tell components to show up at which states and you can even set different styles for them which will automatically change as states are switched. Furthermore, states can be switched by just runing a line of code like: currentState=State1. They are INMHO ver similar to views (or the other way around) but Adobe insists that they are not, so let it be (they are in fact a bit different).

2.2 Using vavigator components, like Page stack, tab navigator, acardione, etc. which are just what the prev poster has schemed, they are built in and are quiet comprehensive. Look them up for detail with navigator components in flex and you would enjoy what they already offer.


I hope it helps you guys with your cool apps. Smiley Happy

a) If you like my response/post, please provide a Kudo (white star to the left).
b) If my post solved your problem please click on the Accept as Solution button.
New Developer
Posts: 7
Registered: ‎12-28-2010
My Device: Curve 8900

Re: Do we have any documentation for qnx.views package

[ Edited ]




Wouldn't this be worth a Kudo?
(If yes, please click the white star to the left)