I have a LabelField whith style FOCUSABLE and many focusable Fields after it, and I overrided the navigationMovement method of the LabelField.
The problem is that: the code never enters in the new implementation of navigationMovement but the focus is normally moved from LabelField to next Field without passing by navigationMovement implementation !
PS, I also tested using debugger to ensure that it never gets into its implementation.
Why is this happening and how to catch navigationMovement event for FOCUSABLE LabelField ?
CODE:
Here's the class:
public abstract class FocusableLabelField extends LabelField {
public boolean isDownUnfocused = false;
public FocusableLabelField(String text) {
super(text, FOCUSABLE);
}
protected void drawFocus(Graphics graphics, boolean on) {
// DO NOTHING, FOCUS IS HANDLED IN PAINT
}
protected void paint(Graphics graphics) {
if(isDownUnfocused == true)
graphics.setColor(0xFFFFFF);
else {
if(isFocus())
graphics.setColor(0xFFFFFF);
else {
graphics.setColor(0x777777);
}
}
super.paint(graphics);
}
protected void onFocus(int direction) {
isDownUnfocused = false;
onFocusing();
super.onFocus(direction);
}
public abstract void onFocusing();
public void redraw() {
invalidate();
}
protected boolean navigationMovement(int dx, int dy, int status, int time) {
//TODO CHECK WHY IT'S NOT ENTERING HERE !
if(dy>0)
isDownUnfocused = true;
invalidate(); // IF REMOVED NO EFFECT WILL BE APPLIED
return super.navigationMovement(dx, dy, status, time);
}
}
And here's how I use it in a screen:
FocusableLabelField field = new FocusableLabelField("title") {
public void onFocusing() {
// some logic in the screen is done here ...
}
} ;