react-native-extra-dimensions-android icon indicating copy to clipboard operation
react-native-extra-dimensions-android copied to clipboard

Inconsistent results

Open bobsmits opened this issue 6 years ago • 4 comments

With the latest patch and the fix for notched devices i get mixed results. I want the available screen height with a translucent statusbar. So that should be the actual screen height minus the softmenu bar.

Samsung s10 Has a soft menu. ExtraDimensions.getSoftMenuBarHeight( ) -> 48 -> seems ok ExtraDimensions.isSoftMenuBarEnabled() -> false -> not ok ExtraDimensions.getRealWindowHeight() -> gives the device height - soft menu bar height

Samsung J5 Has no soft menu ExtraDimensions.getSoftMenuBarHeight( ) -> 0 -> seems ok ExtraDimensions.isSoftMenuBarEnabled() -> true -> not ok ExtraDimensions.getRealWindowHeight() -> gives the device height

Simulator Nexus 5x Has a soft menu ExtraDimensions.getSoftMenuBarHeight( ) -> 0 -> not ok ExtraDimensions.isSoftMenuBarEnabled() -> true -> seems ok ExtraDimensions.getRealWindowHeight() -> gives the device height

I'm not a native dev otherwise i would dive in and try to fix it myself.

bobsmits avatar May 03 '19 12:05 bobsmits

According to the source:

https://github.com/Sunhat/react-native-extra-dimensions-android/blob/0d449d2668a61d9900498ca894aec9691cc7a1a7/android/src/main/java/ca/jaysoo/extradimensions/ExtraDimensionsModule.java#L87

currently, all of the simulator's SoftMenuBarHeight will be 0, since the simulator's soft menu bar is controlled by qemu.hw.mainkeys instead of config_showNavigationBar

And I create a PR to fix it: #54

gongdao123 avatar May 20 '19 17:05 gongdao123

@gongdao123 not sure if you would know this. I setup with Genymotion to try and test devices like Pixel3 more accurately since this PR is not part of the project yet. I was trying to test in the simulator provided by studio but with this bug, obviously that is hard. Do you think the same issue would play Genymotion emulators in addition to the regular ones?

countravioli avatar Jul 02 '19 19:07 countravioli

still facing same issue

ManigandanRaamanathan avatar Apr 14 '20 10:04 ManigandanRaamanathan

@bobsmits @gongdao123 i'm trying in samsung s10 Plus. still same issue

ManigandanRaamanathan avatar Apr 14 '20 11:04 ManigandanRaamanathan