ToolTipDialog
ToolTipDialog copied to clipboard
[BUG] addPeekThroughView dialog position
Describe the bug I was looking at the sample here, and I have noticed that the addPeekThroughView add a new view in the wrong position. I am using a Google Pixel 4a, OS 12.
To Reproduce Steps to reproduce the behavior:
- Go to Sample activity
- Toggle shade on
- Click on Pointing up
- See error: The attached view is not in the same position of the original.
Expected behavior The view in the dialog should be in the same xy position as the original one.
Screenshots
Additional context
Add any other context about the problem here.
Thanks for reporting this. I've confirmed the same behavior on my pixel 6a, api 31. My hunch is that it has to do with the display cutouts for the camera throwing off the pixel measurements. Looking through it, nothing sticks out as on obvious fix.
Thanks for your feedback! I have not gone through the code and tested it enough, but what about replacing statusBarHeight = screenUtils.getScreenHeight(context) - windowHeight with val statusBarHeightId = context.resources.getIdentifier("status_bar_height", "dimen", "android") statusBarHeight = context.resources.getDimensionPixelSize(statusBarHeightId) It seems that the statusBarHeight is not correct