Open flgubler-ergon opened 2 months ago
This issue needs more information before it can be addressed. In particular, the reporter needs to provide a minimal sample app that demonstrates the issue. If no sample app is provided within 15 days, the issue will be closed.
Please see the Contributing Guide for how to create a Sample App.
Thanks! Ionitron 💙
Here you go https://github.com/flgubler-ergon/capacitor-bug-full-screen-detection
If you open the app on Android and click into the input-field, you will notice a light-grey bar between the keyboard and the web-view (I set a blue back-ground-color in the webview to make this more obvious).
Aso you will be able to see, the app is in full-screen mode (some text is behind the status-bar). However, they keyboard-plugin does not recognize this - due to the problem described above.
As the bug only appears in Android, I only created an android app (no iOS)
Bug Report
Plugin(s)
@capacitor/keyboard
Capacitor Version
Platform(s)
Android
Current Behavior
As you surely know, the flag
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
has been deprecated by Android for some time now. For that reason, I am using the newerWindowCompat.setDecorFitsSystemWindows(window, false)
to configure my app as a full-screen app (i.e. to make sure that the web-view covers the entire screen).However, the
Keyboard
class contains the following methodAs a result, this logic does not recognize that my app is a full-screen app and the method
computeUsableHeight()
returns the wrong value. As a consequence, the web-view's height is reduced more than it needs to be, leaving some empty space between the keyboard and the web-view.Expected Behavior
The new way of configuring a full-screen app, namely
WindowCompat.setDecorFitsSystemWindows(window, false)
which is officially recommended by Google (see Google Developer Documentation) should also be recognized as full-screen. => the height of the keyboard should be computed correctly. This can easilby be done usingwindow.decorFitsSystemWindows()
which returns a boolean: if the boolean is false, it is a full-screen app. Update: unfortunately, that method is hidden in the API. Therefore, the fix may be a bit more complicated.