mirror of
https://github.com/Julow/Unexpected-Keyboard.git
synced 2025-06-26 12:41:43 +02:00
Fix status bar artifact on opens and closes
On API 30 to 34, the status bar changes color when the keyboard appears and disappears. A ghost of the changed status bar is animated by the same animation used for the keyboard, which is unexpected.
This commit is contained in:
parent
926b99cbfe
commit
5b5d8c692e
@ -292,8 +292,9 @@ public class Keyboard2 extends InputMethodService
|
||||
|
||||
private void updateSoftInputWindowLayoutParams() {
|
||||
final Window window = getWindow().getWindow();
|
||||
// On API >= 30, Keyboard2View behaves as edge-to-edge
|
||||
if (VERSION.SDK_INT >= 30)
|
||||
// On API >= 35, Keyboard2View behaves as edge-to-edge
|
||||
// APIs 30 to 34 have visual artifact when edge-to-edge is enabled
|
||||
if (VERSION.SDK_INT >= 35)
|
||||
{
|
||||
WindowManager.LayoutParams wattrs = window.getAttributes();
|
||||
wattrs.layoutInDisplayCutoutMode =
|
||||
|
@ -264,7 +264,7 @@ public class Keyboard2View extends View
|
||||
int insets_bottom = 0;
|
||||
// LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS is set in [Keyboard2#updateSoftInputWindowLayoutParams].
|
||||
// and keyboard is allowed do draw behind status/navigation bars
|
||||
if (VERSION.SDK_INT >= 30)
|
||||
if (VERSION.SDK_INT >= 35)
|
||||
{
|
||||
WindowMetrics metrics =
|
||||
((WindowManager)getContext().getSystemService(Context.WINDOW_SERVICE))
|
||||
|
Loading…
x
Reference in New Issue
Block a user