Search code examples
java-melwuit

LWUIT Scrolling Clicking Issue


this is a very general Question to LWUIT.

I'm developing for Nokia S40 phones.

I'm having a List in a form which functions as a Menu. The Form has an ActionListener which listens to SoftkeyEvents and also the List click events.

It's doing this by e.g.:

if (evt.getCommand() != null) {
        if (evt.getCommand().getCommandName().equals("Back")) {
            if    (Display.getInstance().getCurrent().getUIID().equals("SubMenu")) {

and:

if (Display.getInstance().getCurrent().getUIID().equals("Menu") ) {

The problem is: the menu seems to be hypersensitive to scrolling but not sensitive enough to clicking.

Means: If you try to click a menu entry in the List, the List very often scrolls instead of actually catching the link.

Is there some way to influence this behaviour?


Solution

  • Updated answer: FYI We had S40 touch phones and our QA didn't report these issues as far as I recall. Keep in mind this is a resistive screen hence it can't handle fingers, it works best with the finger nail and you will get bad results otherwise. With the finger you will get drag events all over the place which is why you are probably experiencing what I explain bellow.

    You are probably seeing this because LWUIT received pointerDragged events from the phone and hence made the decision that a drag operation is in progress. There are general rule of thumb values for pointer drag event blocking within LWUIT implementation (to prevent over eager platforms from sending too many drag events). If a platform sends "inappropriate" drag events LWUIT will just drop them to avoid confusing your application.

    Display.setDragStartPercentage() allows you to tune the percentage of the screen that the finger needs to move in order to trigger a drag. By default if the system sends 7 drag events we activate the drag regardless, that option is only configurable to the LWUITImplementation authors.