ImageButton press feedback

by Venkatesh D » Tue, 04 Aug 2009 01:29:17 GMT


Sponsored Links
 Hi all,

I am developing an application which has many cool image buttons. On
press or click of any image button there is no feed back to the user
either color change or any kind of contrast change in the button.

I don't prefer to have multiple images for a single image button
loaded onKeyDown and onKeyUp callbacks, simply to avoid the size of
the APK.

Is there any default property provided by the framework which just
takes care of Image Button press and release events with some kind of
feedback to the user on both the events?

--~--~---------~--~----~------------~-------~--~----~



ImageButton press feedback

by Jeff Sharkey » Tue, 04 Aug 2009 12:53:52 GMT


 The framework offers "stateful" drawables that automatically change
based on user interaction, such as focus or touch.  Here's an example
of the default Button background is defined:

 http://android.git.kernel.org/?p=platform/frameworks/base.git ;a=blob;f=core/res/res/drawable/btn_default.xml;hb=cupcake

When a drawable like this is set as a android:background or
android:src, the framework will handle swapping out the icon based on
state for you.  (You don't need to write onKeyDown, etc.)

j






-- 
Jeff Sharkey
jshar...@android.com

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. Amazon link

Question.  We would like to link some music in our app to the Amazon
MP3 store.  But when clicking on the link
http://www.amazon.com/gp/dmusic/order/handle-buy-box.html/ref=sr_bb_tr_7?ie=UTF8&isTrack=1&asin.0=B002NHVFNY&qid=1269449332&initial=1&tryInPlace=0&sr=1-8&session-id=183-1058621-7357063
It opens browser instead of the Amazon MP3 app?  Is there a string or
url that I am missing to make this happen?

-- 

2. Developing Google Maps in Android

How can I put text on a google map on an android app when I touch an
overlay? Does anyone knows if android support ah-hoc mode? I found
that it doesn't but maybe you have another opinion.

-- 

3. How to debug SIGSEV?

4. Javascript problem with Webview runing under a HTC Desire

5. Is it possible to use the camera's auto focus function to calculate the distance to an object in focus?

6. Getting location data via wifi.

7. Android emulator problems