- On a new Virtual Device (Pixel 4, api version 30, Android 11) I open Chrome, and click "Accept & Continue" on the Welcome to Chrome Screen.
- At this point Chrome in is on "Turn on Sync" screen and there is a "No thanks" button on the screen.
- Then I switch to the terminal on my mac and run
adb shell dumpsys activity top
Result contains following lines:
org.chromium.chrome.browser.signin.AccountSigninView{1080,0-2160,1977}
android.widget.LinearLayout{0,1790-1080,1977 #7f0b009c app:id/button_bar}
org.chromium.ui.widget.ButtonCompat{44,44-299,143 #7f0b02d1 app:id/negative_button}
AccountSigninView has coordinates 1080,0-2160,1977 that are outside of the screen, but the button is visible on the screen.
This behaviour is not reproduced on my phone.
Questions:
- How can I understand that this button is actually visible and not outside of the screen?
- How can adjust emulator so that it has the same behaviour as my regular phone?
Update 1:
I tried running adb shell uiautomator dump and although there are no controls outside of screen bounds, the coordinates of button are zero.
<node
resource-indroid.chrome:id/negative_button"
...
bounds="[0,0][0,0]"/>
I don't know exactly how to parse the output of
dumpsys acticity top, but the 1080 and 2160 are the upper y and lower y coordinates of the layout. As to the other 2 numbers - I don't know how to parse them.If you want to get the bounds of any view, you better use the
uiautomator dumpcommand. It outputs an xml file, where you can find the bounds of any view in the screen.