I'm using some image buttons in my app's titlebar, using standard Android icons (Holo Light) in a StateListDrawable.
The buttons are 48x48, and I'm using the MDPI icon (32x32) centered, so I get the standard 8dip whitespace around it.
The Enabled state is OK, but I'm not sure how to handle the Pressed state.
From looking at the Gmail and Calendar apps (as good examples), it looks like the pressed state is the same graphic with a blue "highlight" background.
So ideally, I would like to be able to define the Pressed state as "same icon, but different background colour". But I'm not sure if that's possible when using a StateList. Do I need to create my own blue-background icon manually?
And if so, does that mean I have to create 48x48 images that include the whitespace? (The highlighting should go beyond the actual 32x32 icon in the middle of the button.)
Hoping this makes some sense, and really hoping there's a proper, elegant way to do this. It just seems harder than it should be to get a fairly standard behaving image button. (This, admittedly, from a B4A beginner. ;^)
The buttons are 48x48, and I'm using the MDPI icon (32x32) centered, so I get the standard 8dip whitespace around it.
The Enabled state is OK, but I'm not sure how to handle the Pressed state.
From looking at the Gmail and Calendar apps (as good examples), it looks like the pressed state is the same graphic with a blue "highlight" background.
So ideally, I would like to be able to define the Pressed state as "same icon, but different background colour". But I'm not sure if that's possible when using a StateList. Do I need to create my own blue-background icon manually?
And if so, does that mean I have to create 48x48 images that include the whitespace? (The highlighting should go beyond the actual 32x32 icon in the middle of the button.)
Hoping this makes some sense, and really hoping there's a proper, elegant way to do this. It just seems harder than it should be to get a fairly standard behaving image button. (This, admittedly, from a B4A beginner. ;^)