Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyboardVisibilityEvent Status is open on devices having big status bar #41

Closed
deepak786 opened this issue Jul 5, 2019 · 3 comments · Fixed by #50
Closed

KeyboardVisibilityEvent Status is open on devices having big status bar #41

deepak786 opened this issue Jul 5, 2019 · 3 comments · Fixed by #50

Comments

@deepak786
Copy link

With Android 9 on some devices, the status bar height is large so the event listener for KetboardVisibilityEvent is always open.

Here is the attached screenshot of the device emulator having the big status bar:
device-2019-07-05-144756

I tried to get the values of Screen Height, Height Difference, Status Bar, etc and here are the results:

  1. ScreenHeight = 1920
  2. StatusBarHeight = 171
  3. Rectangle = Rect(0, 171 - 1080, 1794)
  4. HeightDifference = 297
  5. KeyboardMinHeight = ScreenHeight * KeyboardMinRatio = 1920*0.15 = 288

As you can see that the HeightDifference is bigger than KeyboardMinHeight. Due to this the status is always open.

I think we need to include status bar height in calculation to make it work.
Can you please check?

Let me know if you need more details

Thanks

@yshrsmz
Copy link
Owner

yshrsmz commented Jul 8, 2019

Sounds reasonable 👍
It would be great if the library can handle different size of status/navigation bar.
Would you like to submit a PR?

arquimago added a commit to arquimago/KeyboardVisibilityEvent that referenced this issue Jul 9, 2019
arquimago added a commit to arquimago/KeyboardVisibilityEvent that referenced this issue Jul 12, 2019
@deepak786
Copy link
Author

#42 Solved the issue for me. Thanks @arquimago

@yshrsmz
Copy link
Owner

yshrsmz commented Feb 14, 2020

I've just released 3.0.0-RC1 with the fix for this issue.
Please let me know if it works or not 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants