[android-developers] Re: Catching "button" behavior
If you need to catch the ACTION_UP event, using a Button view is not
the best approach. Use an ImageView with a state-based drawable as the
background (as Kostya suggested), but you need to do your own
capturing of ACTION_DOWN and ACTION_UP. I've implemented this myself,
but I don't have the code handy so can't tell you how to get that
ACTION_UP...all I can say is: its possible :)
On Oct 22, 8:51 am, Kostya Vasilyev <kmans...@gmail.com> wrote:
> Sure, there is a better way: use a button with a custom background, which
> should be a state-based drawable, pointing to individual images for various
> states: default, selected, disabled, etc...
>
> --
> Kostya Vasilyev --http://kmansoft.wordpress.com
>
> 22.10.2010 1:36 пользователь "Bill C" <wtcogg...@gmail.com> написал:
>
> I need to specify the full button images for both the up and down
> positions. My impression is that the most probable choice is to use
> an custom button based on the ImageView and specify the image for up
> and down positions. I am using the OnTouchEvent method to capture the
> ACTION_DOWN, but I'm not getting the ACTION_UP event.
>
> Is there a better choice for creating a button that controls the full
> button image, catches the Down/Up and can subdivide the down time into
> time slices? If not, how do I catch the up event.
>
> My application expects a screen touch on the "button" and not a
> keyboard action.
>
> Thx,
> Bill
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscribe@googlegroups.com<android-developers%2Bunsubscribe@googlegroups.com>
> For more options, visit this group athttp://groups.google.com/group/android-developers?hl=en
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home