Say I'm using a canvas, or other surface that I can directly draw to.
Instead of buttons, I have pictures and text areas that are
'clickable'. Now, to find out how to handle the MotionEvent, I just
use a case select procedure and find out which area was clicked.

For example, if the x position was great than 150 but less then 200,
and the y position was greater then 400 but less than 420, I know that
the rectangle on the lower part of the screen was clicked, and I can
handle the event accordingly.

This is all well and good for 320x480 phones, but what about smaller
or bigger resolutions? I realize I can stretch drawable images to fit
the screen, but how do I handle custom, interactive areas? Is there a
class or coding pattern I can use?

Right now, I'm thinking of making all the drawable aspects of this
program as a percentage of the screen (based on 320x480), getting the
screen resolution, and then dynamically calculating the sizes of the
images AND clickable boundaries at runtime. But, if there's a more
common or 'accepted' solution, I'd like to start by doing it the right
way.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to