-
Notifications
You must be signed in to change notification settings - Fork 19
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
Toolbar appeared on bottom for android phones with physical navigation bar #3
Comments
Hey @gogoout, thanks for bringing this up! I own an Samsung S8 with a virtual (bottom) navigation bar and was able to reproduce the issue when the virual nav bar is hidden: the toolbar sticks to the bottom, at the position where the nav bar would have been otherwise. Unfortunately, your code didn't fix it for me, but I found another way to fix it. Hopefully it works for you as well. Version 1.0.2 just shipped to npm. |
Hi @EddyVerbruggen ,
However, the second one is still there.
I guess the problem is still that the following code doesn't work for me (I'm testing on a ng program) // at this point, topmost().currentPage is null, so do it like this:
let page: any = parent;
while (!page && !page.frame) {
page = page.parent;
}
const {y} = parent.getLocationOnScreen();
const newHeight = parent.getMeasuredHeight();
// this is the bottom navbar - which may be hidden by the user.. so figure out its actual height
this.isNavbarVisible = page.getMeasuredHeight() < Toolbar.getUsableScreenSizeY();
this.navbarHeight = Toolbar.getNavbarHeight(); Here is some screenshot of the debugging which you can see the states. Hope this may help. |
@EddyVerbruggen I'm facing the same problem as @gogoout with my Huawei P10 with disabled navbar. |
The bug is described in EddyVerbruggen#3
If the demo apps cannot help and there is no issue for your problem, tell us about it
First of all, thanks for the great plugin. I have a test on this plugin, and find it works like a charm on the simulator and phones with the virtual navigation bar. But when it runs on the phone with the physical navigation bar, there are 2 problems:
Which platform(s) does your issue occur on?
Android (phones with physical navigation bar)
Is there any code involved?
I've debugged with the real device and found out that the problem is caused by the code here
I find that the
page.getMeasuredHeight()
is returning the exact height as thenewHeight
which clearly is wrong.Further more, I tried using
parent.page.getMeasuredHeight()
to compare withToolbar.getUsableScreenSizeY()
which is still not working(maybe becausegetUsableScreenSizeY
is taking status bar into account).Anyway, so I change the way to find out if there is a virtual navigation bar. You can see the complete code below.
I guess the problem here is that there is actually no need to minus the
this.navbarHeight
anymore. Since the only thing changed should just be thelastKeyboardHeight
, right?You can see the complete changes here, hope this can be helpful.
PS: I'm also using the
getViewForId
in android since I've encountered that problem appeared in iOS.The text was updated successfully, but these errors were encountered: