Используйте getOffsetWidth()
и getOffsetHeight(
) методы. Документ здесь:
Gets the object's offset width in pixels. This is the total width of the object,
including decorations such as border, margin, and padding.
Методы определены в UiObject, поэтому общие для всех виджетов.