01-22-2014 06:52 AM
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
Solved! Go to Solution.
01-22-2014 07:05 AM
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...
Just make sure to remove the pages before you exit to avoid leaks.
01-22-2014 07:34 AM
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.
01-22-2014 07:37 AM
01-23-2014 06:29 AM
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:
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:
01-23-2014 06:56 AM - edited 01-23-2014 06:58 AM
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.