Skip to main content

Feedback for command buttons

3 replies [Last post]
francisdb
Offline
Joined: 2006-06-16

(double post since the crossposter is down and I did not get any reply on my mail)

Hi all,

As I have a SE850i with touch sensitive buttons at the bottom of the
screen it is nice to have some feedback when the command buttons are
pressed. The phone itself indicates a touch by changing the state for
a short time (color / image overlay). This is also useful for normal
phones when the painting might be a bit slow or when an action takes a
bit to long to avoid users pressing the button multiple times...

Any ideas on how to implement this?

Thanks

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Shai Almog

Hi francisdb,
sorry about that we sometimes miss posts with all the traffic.

Generally the softbuttons in the menu are just LWUIT buttons with
their border disabled, you can customize them in LWUIT using quite a
few different tactics here are a couple I can think of right now:

1. I'm not sure if this is a part of the current drop (if not it will
be in the next drop). You can access the soft button "Button" by
using the API's getSoftButtonCount() and getSoftButton(int).
This can be used to customize the look of the button like a pressed/
unpressed icon etc...

2. You can override the Form's paint method to draw a "pressed"
effect in that area when the command is invoked.

I'm sure there are more maybe Chen can come up with some ideas.

In terms of UI I would suggest you never take a long time to respond,
if anything takes more than a millisecond just start a new thread and
pop open a waiting dialog... Keep in mind that if you take too long
on the event thread/paint thread all UI updates you perform just
won't be shown so you will need a separate thread anyway.

Thanks,
Shai.

> (double post since the crossposter is down and I did not get any
> reply on my mail)
>
> Hi all,
>
> As I have a SE850i with touch sensitive buttons at the bottom of the
> screen it is nice to have some feedback when the command buttons are
> pressed. The phone itself indicates a touch by changing the state for
> a short time (color / image overlay). This is also useful for normal
> phones when the painting might be a bit slow or when an action takes a
> bit to long to avoid users pressing the button multiple times...
>
> Any ideas on how to implement this?
>
> Thanks
> [Message sent by forum member 'francisdb' (francisdb)]
>
> http://forums.java.net/jive/thread.jspa?messageID=281214
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
> For additional commands, e-mail: users-help@lwuit.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net

francisdb
Offline
Joined: 2006-06-16

Thanks Shai,

I know about the 'taking to many time on the edt' but still in normal use there are some tings that take longer than 200 msec, spawning a thread for everything seems like overachieving, and user feedback is going to make the user think the app is fast. I'll have a look at the getsoftbutton, it would be nice to be able to define this application wide and not for every form.

Chen, do you have other ideas?

chenf
Offline
Joined: 2008-04-29

Hi,
You can use the getSoftButton method to get the Button Style and add your Painter to the Style.
When you construct the Painter pass him the Button reference, and in the paint() of the Painter paint the background according to the Button state(use Button.getState())

Regards,
Chen