Compare commits

..
3 Commits
Author SHA1 Message Date
Jules Aguillon 3e5e5a1979 Release 1.30.1 (44)
Check layouts / Generated files (push) Has been cancelled
Check layouts / check_layout.output (push) Has been cancelled
Check translations / check-translations (push) Has been cancelled
Make Apk CI / Build-Apk (push) Has been cancelled
2024-12-24 01:17:47 +01:00
Jules Aguillon c13e7608fa Fix keyboard drawing behind nav bar on Android 15
Bug added in 038f693.
2024-12-24 01:10:41 +01:00
Jules Aguillon 2e9f69d58c Fix crash on devices with only unsupported languages
This only affected Android 12 and up.
2024-12-23 11:04:39 +01:00
4 changed files with 14 additions and 6 deletions
+2 -2
View File
@@ -14,8 +14,8 @@ android {
applicationId "juloo.keyboard2"
minSdk 11
targetSdkVersion 35
versionCode 43
versionName "1.30.0"
versionCode 44
versionName "1.30.1"
}
sourceSets {
@@ -0,0 +1 @@
Bug fixes
+2
View File
@@ -157,6 +157,8 @@ public class Keyboard2 extends InputMethodService
// Android might return a random subtype, for example, the first in the
// list alphabetically.
InputMethodSubtype current_subtype = imm.getCurrentInputMethodSubtype();
if (current_subtype == null)
return null;
for (InputMethodSubtype s : enabled_subtypes)
if (s.getLanguageTag().equals(current_subtype.getLanguageTag()))
return s;
+9 -4
View File
@@ -42,6 +42,7 @@ public class Keyboard2View extends View
private Config _config;
private float _keyWidth;
private float _bottomMargin;
private Theme _theme;
@@ -257,9 +258,7 @@ public class Keyboard2View extends View
{
DisplayMetrics dm = getContext().getResources().getDisplayMetrics();
int width = dm.widthPixels;
int height =
(int)(_config.keyHeight * _keyboard.keysHeight
+ _config.marginTop + _config.margin_bottom);
_bottomMargin = _config.margin_bottom;
// Compatibility with display cutouts and navigation on the right
if (VERSION.SDK_INT >= 30)
{
@@ -270,7 +269,13 @@ public class Keyboard2View extends View
WindowInsets.Type.statusBars() | WindowInsets.Type.navigationBars()
| WindowInsets.Type.displayCutout());
width = metrics.getBounds().width() - insets.right - insets.left;
// Starting in API 34, keyboard window has LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS
if (VERSION.SDK_INT >= 34)
_bottomMargin += insets.bottom;
}
int height =
(int)(_config.keyHeight * _keyboard.keysHeight
+ _config.marginTop + _bottomMargin);
setMeasuredDimension(width, height);
_keyWidth = (width - (_config.horizontal_margin * 2)) / _keyboard.keysWidth;
}
@@ -287,7 +292,7 @@ public class Keyboard2View extends View
left + (int)_config.horizontal_margin,
top + (int)_config.marginTop,
right - (int)_config.horizontal_margin,
bottom - (int)_config.margin_bottom);
bottom - (int)_bottomMargin);
setSystemGestureExclusionRects(Arrays.asList(keyboard_area));
}
}