kcrimi / ToolTipDialog

Easy to use library to add tooltips to your app
Apache License 2.0
89 stars 17 forks source link

[BUG] addPeekThroughView dialog position #17

Closed andrea07021981 closed 8 months ago

andrea07021981 commented 2 years ago

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

kcrimi commented 2 years ago

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.

andrea07021981 commented 2 years ago

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

csbenz commented 8 months ago

Any update on this? I'd love to use this library!

kcrimi commented 8 months ago

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 I can confirm that this does not work, sadly :(

@csbenz Sorry, I haven't found a fix for it yet but may get to spend some time looking through it in the coming weeks.

Pull requests are welcome if you're able to find the fix though!

kcrimi commented 8 months ago

@csbenz @andrea07021981 Sorry for the delay, this should be addressed in the most recent release (1.1.5)