简体   繁体   中英

How to alternate a manager's fields when focus changes

I've been trying to have the field contents of a FlowFieldManager change to an informational snippet ie ( Contains Field1 and 34 more fields ), whenever the manager looses focus.

I constructed a FlowFieldManager thus:

new FlowFieldManager(FOCUSABLE);

And then I proceeded to set FocusChangeListeners , and even override both onFocus and onUnfocus methods, but nothing so far.

The desired behaviour is to have a manager with an extensive number of LabelField s signifying an item. The user can add as many items as they want into that manager. However, this can clutter the screen, so I want it such that when focus leaves the manager's visible area, it's contents change to a description of the number of fields, so that other managers on the screen can be visible.

You might have better luck overriding nextFocus() on your Manager:

protected int nextFocus(int direction, int axis);
    int next = super.nextFocus(directions, axis);
    if(next == -1) {
        //do stuff when you're losing focus
    }
    return next;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM