开发者

BlackBerry: define direction of Scroll or Focus change

开发者 https://www.devze.com 2022-12-28 14:36 出处:网络
Does BlackBerry provide any functionality to track focus or scroll change direction? On our UI we have a horizontal tab bar, and under that a list.

Does BlackBerry provide any functionality to track focus or scroll change direction?

On our UI we have a horizontal tab bar, and under that a list.

If the user has navigated far down the list and 开发者_运维技巧decides to click another tab, it is difficult to get the focus back on the Tab control. The user must scroll up to the first list item and then the focus will move to the tab.

Since the list has no left-right component, can I catch horizontal scroll events to change the currently focused tab? Similarly, I would like to catch vertical scroll events to go back to the list.


For navigation control you can override

protected boolean navigationMovement(int dx, int dy,
                    int status, int time) {
                // TODO Auto-generated method stub
                return super.navigationMovement(dx, dy, status, time);
            }

here dx for horizontal navigation and dy for vertical navigation.

if you want to listen focus change you can implement this method

public void focusChangeNotify(int arg0) {
                // TODO Auto-generated method stub
                super.focusChangeNotify(arg0);
            }
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号