The getY () method returns the Y coordinate according to the parent.
GetTop (), on the other hand, returns the Y coordinate according to its parent representation. If the parent element has a value of 300 as a point Y, and the other view inside it is slightly smaller than it, then 100 is returned, unlike the getY method 300 + 100.
source share