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
Developer
BBSJdev
Posts: 6,094
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Overriding peek for customcontrol

I have a customcontrol that uses OnTouch() to detect a swipe from left to right, the trouble is I have to disable peek to stop the peek functionality from happening inadvertently (not desirable).

 

I've messed around with Touch Policies but can't seem to get it to work and I'm starting to suspect that the OS peek gets the signal first thus locking me out from affecting it.

 

On the other hand I can't believe it's not possible, does anyone have some example code of how to stop this happening?

 

As a side observation why does peek have to work from any left to right swipe? Why not just bezel to right?


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.
Please use plain text.
Developer
Zmey
Posts: 1,512
Registered: ‎12-18-2012
My Device: PlayBook, Z10, DAC

Re: Overriding peek for customcontrol

Peek works differently when swiping on bezel. On bezel the topmost page is shown, otherwise the previous page is shown.

Andrey Fidrya, @zmeyc on twitter
Please use plain text.
Developer
BBSJdev
Posts: 6,094
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Overriding peek for customcontrol

Thanks for your answer wasn't aware of this differentiation.

 

I still feel that more programmatic control is needed over this feature.


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.
Please use plain text.
Contributor
xtravanta
Posts: 46
Registered: ‎03-25-2011
My Device: Blackberry Z10
My Carrier: KPN

Re: Overriding peek for customcontrol

if you dont want to use it at all you can just disable it?

NavigationPane.setPeekEnabled(boolean)
Please use plain text.
Developer
BBSJdev
Posts: 6,094
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Overriding peek for customcontrol

Thanks I was aware of this and am disabling it in QML at the moment.

 

I would like my users to be able to use this feature however so I really need an example of someone implementing onTouch in a CustomControl  which does not effect Peek?


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.
Please use plain text.
Developer
BBSJdev
Posts: 6,094
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Overriding peek for customcontrol

I'm not surprised there's no answer as even Cascade controls don't cope well.

 

Try this simple example and you'll see that scrolling left to right is broken, peeking to the previous screen instead of scrolling.

 

		ListView {
		    dataModel: XmlDataModel { source: "models/recipemodel.xml" }
		    layout: StackListLayout {
		        headerMode: ListHeaderMode.None
		        orientation: LayoutOrientation.LeftToRight
		    }
		    listItemComponents: [
		        ListItemComponent {
		            type: "recipeitem"
		 
		            ImageView {
		                rightMargin: 6
		                bottomMargin: 6
		                imageSource: ListItemData.image

		        }
		    ]
		}

 

 


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.
Please use plain text.
Developer
BBSJdev
Posts: 6,094
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Overriding peek for customcontrol

If BlackBerry want developers to use Peek can we have a solution to this problem.

 

Thanks.


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.
Please use plain text.
Developer
BBSJdev
Posts: 6,094
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Overriding peek for customcontrol

No response so I've submitted as bug.

 

https://www.blackberry.com/jira/browse/BBTEN-811

 

An example of this is that BlackBerry world suffers with this issue, on a dev alpha or z10 in BlackBerry World select an app with screenshots. Scroll the screenshots to the right then back to the left the obvious intention is to scroll back to the first screenshot instead peek is invoked and you end up on previous screen.


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.
Please use plain text.
Contributor
xtravanta
Posts: 46
Registered: ‎03-25-2011
My Device: Blackberry Z10
My Carrier: KPN

Re: Overriding peek for customcontrol

Is it a option to disable it on touch and enable on touch up or cancel ? This is what I did to fix it..
Please use plain text.
Developer
BBSJdev
Posts: 6,094
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Overriding peek for customcontrol

[ Edited ]

xtravanta wrote:
Is it a option to disable it on touch and enable on touch up or cancel ? This is what I did to fix it..

 

My customcontrol is in C++ and the navigation page to control peek 2 pages back all in QML.

 

To do this I'd need to pass a variable on the navmain page through two pages and in to a property for the custom control so possible but incredibly yucky.

 

Why should  a custom control have knowledge of what layout environment its in (several containers up), its bad programming.

 

AFAIK what's missing is a way of simply turning it on and off within C++?

Blocking the signal to peek would do this but I can't find this in any of the documentation.

 

Did your solution get around this?

 

If we are all having to write workarounds for this then it warrents calling it a bug.


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.
Please use plain text.