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

Java Development

Reply
Developer
Posts: 190
Registered: ‎10-22-2009
My Device: Blackberry Torch
Accepted Solution

Storm2 Visual click feedback?

Hi,

Can anybody helps me to know how to add visual click feedback to the Storm2 device as we see on simulator when we do CLICK or TAP on any app in simualator i.e a circle is created at the coordinates where touch event occurs.

I want that kind of behavior on device also.

 

Thanx

-----------------------------------------------------------------------------------
Please mark posts as solved if you found a solution. Press the kudos button to thank the user who helped you.
BlackBerry Development Advisor
Posts: 15,021
Registered: ‎07-09-2008
My Device: BlackBerry Passport

Re: Storm2 Visual click feedback?

You could do this within your own application by capturing the TouchEvent and drawing a circle/bitmap/etc at that location by overriding the paint method of the screen. First draw the circle and then call super.paint method to perform the rest of the paint operation.

 

It is only possible to capture touch events when your application is in the foreground, which means this would not apply to touch events outside of your own application.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
Posts: 190
Registered: ‎10-22-2009
My Device: Blackberry Torch

Re: Storm2 Visual click feedback?

Thanx for your suggestion.

But there is one more problem CIRCLE which i draw in paint at that location is quick overdrawn by other things following. So impact is not visible to user.

What could be the best way for CIRCLE to have have fade away effects?

Should i use background thread which will reduce the size of circle and call invalidate until its radius

become shorter than some threshold?Problem with this approach is that i m already having a background thread to update some of screen contents. Won't this affect performance?

 

 

-----------------------------------------------------------------------------------
Please mark posts as solved if you found a solution. Press the kudos button to thank the user who helped you.
BlackBerry Development Advisor
Posts: 15,021
Registered: ‎07-09-2008
My Device: BlackBerry Passport

Re: Storm2 Visual click feedback?

 


mohitsharma wrote:

 

Should i use background thread which will reduce the size of circle and call invalidate until its radius

become shorter than some threshold?

 

 


 

Yes, that is what I recommend.  Or if another thread is already updating the screen you may be able to use it to draw the circle.

 

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker