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
Contributor
Posts: 10
Registered: ‎11-09-2010
My Device: torch 9810
My Carrier: telcel

trouble scroll with touch event storm 9500

i have a verticalfieldmanager as container in which i have a gridfieldmanager the trouble here is when i tried to scroll with the touch event. I tested in bold 9900 and torch 9800 and it works great but when i tried it on storm 9500 it just doesnt work out.

 

Do i have to do something special??

 

this is my code

 

public class VerticalManagerSelected extends VerticalFieldManager {

 

    public VerticalManagerSelected(Field f) {
        add(f);
        add(new NullField(NullField.FOCUSABLE));
        add(new SeparatorField(){
            protected void paint(Graphics g) {
                g.setColor(Color.WHITE);
                super.paint(g);
            }
        });
    }
 
    protected boolean navigationClick(int status, int time) {
        actionClick();
        return true;
    }
    protected boolean keyChar(char c, int status, int time) {
        if(c==Characters.ENTER){
            actionClick();
        }
        return super.keyChar(c, status, time);
    }
   
    // added for touch handling
    protected boolean touchEvent(TouchEvent message) {
        int eventCode = message.getEvent();  

        if(eventCode == TouchEvent.GESTURE) {
            TouchGesture gesture = message.getGesture();
            int gestureCode = gesture.getEvent();
            if (gestureCode == TouchGesture.TAP) {
                actionClick();
            }
        }else{
            switch( eventCode ) {
                case TouchEvent.CLICK:
                case TouchEvent.DOWN:  
                     break;
                case TouchEvent.MOVE:
                    isMove = true;
                     break;
                case TouchEvent.UP:
                    if(!isMove){
                        actionClick();
                    }
                     isMove = false;
                     return true;
            }
            return false;
        }
        return true;
    }
    
    protected void actionClick(){};
   

}