ionic-team / ionic-team/capacitor-keyboard

@capacitor/keyboard does not recognize Full-Screen app

Open
#22 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
3
Forks
21
PR merge metrics
No merged PRs in 30d

Description

## Bug Report

### Plugin(s)
@capacitor/keyboard

### Capacitor Version
```
💊 Capacitor Doctor 💊

Latest Dependencies:

@capacitor/cli: 6.1.2
@capacitor/core: 6.1.2
@capacitor/android: 6.1.2
@capacitor/ios: 6.1.2

Installed Dependencies:

@capacitor/cli: 6.1.0
@capacitor/android: 6.1.0
@capacitor/core: 6.1.0
@capacitor/ios: 6.1.0
```

### 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 newer `WindowCompat.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 method
```
private boolean isOverlays() {
final Window window = activity.getWindow();
return ((window.getDecorView().getSystemUiVisibility() & View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN) == View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
);
}
```
As 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](https://developer.android.com/develop/ui/views/layout/edge-to-edge-manually#lay-out-in-full-screen)) should also be recognized as full-screen. => the height of the keyboard should be computed correctly.
This can easilby be done using `window.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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.