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
Highlighted
Developer
Posts: 78
Registered: ‎12-03-2009
My Device: Not Specified
Accepted Solution

Focused custom HorizontalFieldManager does not accept click on Storm

Hello everybody!

 

I'm facing one problem to make an application compatible to Storm. These application contains some field managers and inside one of that we have a list of custom HorizontalFieldManagers.

 

Those fields are accepting touch and for set up the focus  we implement just the bellow code:

 

 

protected boolean touchEvent(TouchEvent event){
	switch(event.getEvent()){
	case TouchEvent.DOWN:
		if(!this.focused){ 
			this.setFocus();
			invalidate();
		}
		break;
	}
	return false;
}

 So, if we click directly in a field without focus it works as expected. But if the field is already focused the click does not work! The method navigationClick is not invoked. In the order hand, as mentioned above, if the field is not focused the navigationClick is invoked accordly.

 

 

protected boolean navigationClick(int status, int time) {
	return clickListener.onNavigationBallClicked(this, status, time);
}

 

What we have to do to handle this click when the field that is already focused? Or better, what are we doing wrong?

 

 

Thanks!!!

 

--
Feel free to press the kudos button on the left side to thank the user that helped you.
Please mark posts as solved if you found a solution.
Developer
Posts: 78
Registered: ‎12-03-2009
My Device: Not Specified

Re: Focused custom HorizontalFieldManager does not accept click on Storm

We still having no clue about this problem...

Does anybody have some suggestion?

--
Feel free to press the kudos button on the left side to thank the user that helped you.
Please mark posts as solved if you found a solution.
Developer
Posts: 78
Registered: ‎12-03-2009
My Device: Not Specified

Re: Focused custom HorizontalFieldManager does not accept click on Storm

[ Edited ]

Sorted out!

The trick is bellow:

 

protected boolean touchEvent(TouchEvent event){
	switch(event.getEvent()){
	case TouchEvent.DOWN:
		if(!this.focused){ 
			this.setFocus();
			invalidate();
		}
		break;
	case TouchEvent.UNCLICK:
	       return clickListener.onNavigationBallClicked(this, 0, 0);
	}
	return false;
}

 

 

--
Feel free to press the kudos button on the left side to thank the user that helped you.
Please mark posts as solved if you found a solution.