mirror of
https://github.com/Julow/Unexpected-Keyboard.git
synced 2025-08-18 14:52:25 +02:00
Compare commits
3 Commits
insets-nav
...
edge-to-ed
Author | SHA1 | Date | |
---|---|---|---|
|
ea78c2ae5e | ||
|
e6019a179d | ||
|
2d847e53ec |
@@ -315,6 +315,7 @@ public class Keyboard2 extends InputMethodService
|
|||||||
WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS;
|
WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS;
|
||||||
// Allow to draw behind system bars
|
// Allow to draw behind system bars
|
||||||
wattrs.setFitInsetsTypes(0);
|
wattrs.setFitInsetsTypes(0);
|
||||||
|
window.setDecorFitsSystemWindows(false);
|
||||||
}
|
}
|
||||||
updateLayoutHeightOf(window, ViewGroup.LayoutParams.MATCH_PARENT);
|
updateLayoutHeightOf(window, ViewGroup.LayoutParams.MATCH_PARENT);
|
||||||
final View inputArea = window.findViewById(android.R.id.inputArea);
|
final View inputArea = window.findViewById(android.R.id.inputArea);
|
||||||
|
@@ -277,28 +277,13 @@ public class Keyboard2View extends View
|
|||||||
width = metrics.getBounds().width();
|
width = metrics.getBounds().width();
|
||||||
WindowInsets wi = metrics.getWindowInsets();
|
WindowInsets wi = metrics.getWindowInsets();
|
||||||
int insets_types =
|
int insets_types =
|
||||||
WindowInsets.Type.statusBars()
|
WindowInsets.Type.systemBars()
|
||||||
| WindowInsets.Type.displayCutout()
|
| WindowInsets.Type.displayCutout()
|
||||||
| WindowInsets.Type.mandatorySystemGestures()
|
| WindowInsets.Type.mandatorySystemGestures();
|
||||||
| WindowInsets.Type.navigationBars();
|
|
||||||
Insets insets = wi.getInsets(insets_types);
|
Insets insets = wi.getInsets(insets_types);
|
||||||
insets_left = insets.left;
|
insets_left = insets.left;
|
||||||
insets_right = insets.right;
|
insets_right = insets.right;
|
||||||
// On API 35, the keyboard is allowed to draw under the
|
insets_bottom = Math.max(insets.bottom, _config.bottomInsetMin);
|
||||||
// button-navigation bar but on lower APIs, it must be discounted from
|
|
||||||
// the width.
|
|
||||||
if (VERSION.SDK_INT < 35)
|
|
||||||
{
|
|
||||||
Insets nav_insets = wi.getInsets(WindowInsets.Type.navigationBars());
|
|
||||||
width -= nav_insets.left + nav_insets.right;
|
|
||||||
insets_left -= nav_insets.left;
|
|
||||||
insets_right -= nav_insets.right;
|
|
||||||
}
|
|
||||||
// [insets.bottom] doesn't take into account the buttons that appear in
|
|
||||||
// the gesture navigation bar when the IME is showing so ensure a minimum
|
|
||||||
// of margin is added.
|
|
||||||
if (VERSION.SDK_INT >= 35)
|
|
||||||
insets_bottom = Math.max(insets.bottom, _config.bottomInsetMin);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user