Hi,
I have a view on a tablerow that is clickable. When I click it I like to start an animation from that view growing into a popup. For this I need to know exactly the top,left coodinates of the view as well as the size. The latter is fine, while I have a hard time with the top,left coordinates.
My attempt was to traverse the view hierarchy upwards while adding the left and top coords. I would have thought that would equal the screen coords ... unfortunately it does not.
function findAbsoluteScreenLocation(component) { var x = component.rect.x; var y = component.rect.y; while (component.getParent() != null) { var parent = component.getParent(); x += parent.rect.x; y += parent.rect.y; component = parent; } return { x: x, y: y } }
Anyone with some smart trick here? Is it possible to get this information directly w/o traversing the UI-hierarchy?