Thursday, March 15, 2012

[android-developers] Alert Dialog surface uses relative coordinates on canvas

Hi,
I am not sure, but I think my previous post was not published.. so I am sending it again.
I have a simple program that opens up an alert dialog whenever a user
presses a button (yes, tis a VERY simple program...).
I can see that whenever the dialog appears a new canvas is created (I
made a few changes to the platform code that notify me whenever this
happens).
So far, whenever a drawing (any drawing) was performed on the canvas,
it was using absolute coordinates , HOWEVER, when the dialog appears,
all canvas operations are performed on relative coordinates (relative
to the dialog box).
I am not sure why this happens. .
- Why is the drawing of a dialog using a different coordinate system
(while buttons, lists etc. don't)?
- How can the canvas instance know that it is now drawing to some
position not relative to the normal screen coordinates?
- I've also noticed that gravity affects the position of the dialog
box. Who is in charge of these gravity calculations (not the canvas
anyway)?
- To what surface does this canvas belong? I could not find any
indication of new surface creation when the dialog was created.


I think that understanding this would finally unveil this major
building brick I am missing in the Android views architecture.

Thanks a lot

--
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

No comments:

Post a Comment