07-08-2009 01:31 AM - edited 07-08-2009 11:57 AM
I have a relatively simple Horizontal field manager, with subclassed
ButtonFields BitmapFields in it. I draw some hilighting when each button gets the focus.
On my 220.127.116.11 Storm simulator, and previously on my actual device, when I would tap and drag (really a "swipe") in the field manager, each button would get the focus as my finger swiped across it. Now on my Verizon 9530 Storm, 18.104.22.168, the swipe gets "stuck" on the button you tap on. I can still tap on any of the buttons, I just can't swipe between them.
Note that my HorizontalFieldManager does override touchEvent, but calls super.touchEvent(message) almost all the time (other than when touchEvent is UP).
Was this change on purpose? Is there a recommended way to get the old behavior?
P.S. I've confirmed this also happens in the 148 simulator.
07-08-2009 04:16 AM
Are you returning false in touchEvent(message) to indicate that you are not consuming touch event.
07-08-2009 11:56 AM
No, but I am calling super.touchEvent(message) and returning the value. I thought that was the recommended pattern.
I feel like the BitmapField subclass I am using for buttons that may be the thing that has changed, and that it now "captures" the initial tap.
07-09-2009 12:23 AM
Write something like this in the touchEvent()
07-09-2009 01:03 AM
07-10-2009 11:01 AM
07-20-2009 03:47 PM
Here is a simple app. It has a main screen, which contains a HorizontalFieldManager with four BitmapFields, and also a LabelField to display info.
The MainScreen is the FocusChangeListener for the four BitmapFields.
In 22.214.171.124, I can tap and swipe across the BitmapFields, and as I go over each one, the FocusChangeListener will trigger.
In 126.96.36.199, I can tap and swipe across the BitmapFields, but the focus stays "stuck" on whichever BitmapField I tap on first.
While the 148 behavior actually makes more sense to me (the initial target "captures" the subsequent gestures, like swipes), I liked the old behavior since it made my "toolbar" more like a menu, where the user could swipe across it and see tooltips for each button in turn.
Is there any way to make 148 act more like 75 in this regard?
I can also send you a zip file with the app. I don'tsee how to attach files to these posts up here.
public class BitmapMenuBarApp extends UiApplication
public static void main(String args)
BitmapMenuBarApp app = new BitmapMenuBarApp();
public class BitmapMenuBarScreen extends MainScreen implements FocusChangeListener
BitmapField _bf1, _bf2, _bf3, _bf4;
super(MainScreen.DEFAULT_CLOSE | MainScreen.DEFAULT_MENU);
_mgr = new HorizontalFieldManager();
_bf1 = new BitmapField(Bitmap.getBitmapResource("status.png")
_bf2 = new BitmapField(Bitmap.getBitmapResource("tmActive.png
_bf3 = new BitmapField(Bitmap.getBitmapResource("tmPaused.png
_bf4 = new BitmapField(Bitmap.getBitmapResource("tmStopped.pn
_lblInfo = new LabelField("no info yet");
public void focusChanged(Field field, int eventType)
int i = field.getIndex();
if (eventType == FocusChangeListener.FOCUS_GAINED)
_lblInfo.setText("focusGained for " + String.valueOf(i));
07-21-2009 12:45 AM
I think line field.getIndex(); will not work correctly because all your fields are in a horizontalmanager and it will return the same index every time.You should try to type cast that field object into horizontalfield manager object and then use horizontalfieldmanager functions to get the index of the field.
HorizontalFieldManager class has many functions like getIndex(),getSelectedIndex() etc.
07-21-2009 02:48 AM
I appreciate the advice, though that part of the code is not so much the focus of the post/question. Note that the FocusChangeListener is attached to each of the BitmapFields in the HorizontalFieldManager, and so the field argument to the focusChange method is the BitmapField with the current focus, rather than the HorizontalFieldManager itself. In any case, this part of the code seems to work just fine.