ToolTipDialog icon indicating copy to clipboard operation
ToolTipDialog copied to clipboard

[BUG] addPeekThroughView dialog position

Open andrea07021981 opened this issue 1 year ago • 2 comments

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:

  1. Go to Sample activity
  2. Toggle shade on
  3. Click on Pointing up
  4. 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. dialog

andrea07021981 avatar Aug 06 '22 17:08 andrea07021981

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.

kcrimi avatar Sep 13 '22 03:09 kcrimi

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

andrea07021981 avatar Sep 13 '22 15:09 andrea07021981