Welcome!

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

Native Development

Reply
Regular Contributor
bemipefe
Posts: 75
Registered: ‎06-14-2013
My Device: Z10
Accepted Solution

Navigation Pane: Slide gesture and popped pages

I'm using the NavigationPane to handle the transiction from one app Page to another.

I have two question for you:

 

1) I would like to know if it's possible to disable the slide gesture to "pop" or close the Page by sliding from left to right.

 

2) It would be nice also to avoid the "pop" of the image when the slide gesture is active and I slide to a left page. If I want to go again to the right page I need to push it again in the Navigation pane. Is it possible to avoid this ? For example if I have 3 page I would go to right page and then back to left pages no matter how many times I do it. How can I achieve this ?

Thanks in advance

Developer
BBSJdev
Posts: 6,116
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30

Re: Navigation Pane: Slide gesture and popped pages

1) If you are talking about peek then you can set the peekEnabled property to false to prevent peek, however a drag gesture from left to right on the back button will still slide the page.

 

2) Sorry but I'm struggling to understand your English here, but let me try and summise what you are looking for.

 

You do not need to pop pages off the stack you can keep them there and manage them yourself.

You can control the order with the various navigationPane functions and go back to an unpopped page using the indexOf() or at() functions...

 

http://developer.blackberry.com/native/reference/cascades/bb__cascades__navigationpane.html

 

Just make sure to remove the pages before you exit to avoid leaks.


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Regular Contributor
bemipefe
Posts: 75
Registered: ‎06-14-2013
My Device: Z10

Re: Navigation Pane: Slide gesture and popped pages

Thank you.

Sorry for my English.

 

For question 2):
I want to implement the same behaviour that the Images app has in the BB10. You can slide to a right photo and then you can slide back to a left photo with no limitation. I need to implement the same behaviour with 3 pages of my app using the slide gesture only. The Action bar is hidden for these 3 pages. The problem is that when I slide to a left page the page it's automatically popped in the same way when I press the Back button on the Action bar. I need to keep it in the stack and return to it by sliding to right.

Developer
BBSJdev
Posts: 6,116
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30

Re: Navigation Pane: Slide gesture and popped pages

Ok then yes you can use peekEnabled to disable this behaviour...

http://developer.blackberry.com/native/reference/cascades/bb__cascades__navigationpane.html#property...

I would look at using a horizontal ListView rather than using pages for just switching between images...

http://developer.blackberry.com/native/reference/cascades/bb__cascades__listview.html

If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Regular Contributor
bemipefe
Posts: 75
Registered: ‎06-14-2013
My Device: Z10

Re: Navigation Pane: Slide gesture and popped pages

Thank you.

 

I'm able to set the peeking or "sliding" gesture on or off by using the method setPeekEnabled(bool value)
of the NavigationPane class.

I have used ListView in the past but it's not what I'm looking for. What I'm trying to implement it's more like this: 

http://developer.blackberry.com/native/files/reference/cascades/images/navigation_pane_push_pop.png

but I want the following feature:

1 - Control if you can go back of a specified page.

(This can be done by using the forementioned method of NavigationPane and the setActionBarVisibility method of Page class)

 

2 - Avoid the popping of the page when the user slide to from left to right. Allow the user to turn back to a right page by sliding from right to left.

If point 2 it's impossible to achieve I want put another button in the actionBar next to the "Back" button to allow the user to go "Forward" in the navigation. I tried to use addAction() of the Page class but this put the button inside a TabbedPane like the "New" and "Delete" buttons in this image:

http://developer.blackberry.com/native/files/reference/cascades/images/tabbedpane_action_overflow.pn...

Developer
BBSJdev
Posts: 6,116
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30

Re: Navigation Pane: Slide gesture and popped pages

[ Edited ]

There is no reason you can't have a swipe initiate a push on the next image page or for that matter have a 'Forward' ActionItem both are possible.

Use the OnTouch signal to recognise (unfortunately there is no GestureHandler for this yet) and push the page when the swipe is right-to-left.

Why do you want to avoid the pop?
I can understand you not wanting to destroy the page and keep it in memory for faster loading but there is little to be gained from not popping the page, all this does is take it off the navigationPane stack. Pushing and popping of pages has little impact on efficiency it's effectively just adding or removing a pointer on a list.

If I were you I would implement some kind of caching so that as you wander back and forth between pages you keep say 5 in memory with two either side of the current image and destroy the rest outside that cache. As you move one way or the other you asynchronously create the page two pages away in that direction. This way you keep the memory requirements low and keep the speed of transition high.


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.