BlackBerry touchEvent outside Field triggers fieldChanged

前端 未结 3 1893
滥情空心
滥情空心 2021-01-03 05:32

I am having a problem where if i press/touch outside of a field the fieldChanged() event is triggered for the field that has focus.

The layout for my

3条回答
  •  醉酒成梦
    2021-01-03 05:56

    Just had the same issue. The main problem is that navigationClick and trackwheelClick are called if the touch event is not consumed in touchEvent.

    The solution is to call fieldChangeNotify within the *Click methods only if the click was triggered by a non-touch event. Touch events are given a status of 0 so you can check for that as follows:

    protected boolean navigationClick( int status, int time ){
    
        if (status != 0) fieldChangeNotify(0);
        return true;  
    }
    
    protected boolean trackwheelClick( int status, int time ){        
    
        if (status != 0) fieldChangeNotify(0);
        return true;
    }
    

    This method means you don't need to track whether the touch event was within the bounds of the field.

提交回复
热议问题