0

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?

bharath
  • 14,283
  • 16
  • 57
  • 95
Carl
  • 215
  • 1
  • 11

1 Answers1

1

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.

Shai Almog
  • 51,749
  • 5
  • 35
  • 65
  • I'm talking about touch S40s - C3-01 like devices, since this problem can't happen without having touch. (Several different models). If you try to fire the list, and move your finger just SLIGHTLY while doing this, the List doesn't fire. With a non-touch device or the Nokia Emulator this doesn't happen, since clicks with the mouse can't be misread as a scrolling event. I've tracked this "a bit" further down: If you don't press the button for a very short duration, all is ok. If you press it just a LITTLE BIT longer nothing happens. This also is a click event in LCDUI on Nokia phones. – Carl Jul 15 '11 at 05:57
  • I've recorded a small sample video and will send this to lwuit@sun, I hope you can access this account ;) – Carl Jul 15 '11 at 06:13
  • Thank you for your answer. I tried several things now, to narrow down the problem. I'm referring to REV 1520 at svn. Commenting out line 1368 addInputEvent(createPointerEvent(x, y, POINTER_DRAGGED)); Totally fixes the problem, so the problem is indeed caused by hyper-sensitive dragging. Of course this disables scrolling, too. Changing setDragStartPercentage() to some crazy 99 improves the situation a bit, but it's not perfect and scrolling isn't working nice then. Of course this is totally bad in the emulator then, but I don't care. – Carl Jul 18 '11 at 07:43
  • I then raised getDragAutoActivationThreshold() to some crazy 200 and this is the best result I've achieved so far. Scrolling is ok and clicking is much better than with the original 7. Still it's not working every time, but it's working much more often now with this crazy value. – Carl Jul 18 '11 at 07:44
  • Display.setDragStartPercentage() 10 and getDragAutoActivationThreshold() 200 seems ok - but scrolling is a bit "slow" so not 100% optimal. – Carl Jul 20 '11 at 10:07