fix broken width of emoji & clipboard bottom rows in one-handed mode

This commit is contained in:
Helium314 2025-01-11 11:33:24 +01:00
parent fce02d4669
commit ce61fa9a21

View file

@ -218,9 +218,8 @@ public final class KeyboardLayoutSet {
public static KeyboardLayoutSet buildEmojiClipBottomRow(final Context context, @Nullable final EditorInfo ei) { public static KeyboardLayoutSet buildEmojiClipBottomRow(final Context context, @Nullable final EditorInfo ei) {
final Builder builder = new Builder(context, ei); final Builder builder = new Builder(context, ei);
builder.mParams.mMode = KeyboardId.MODE_TEXT; builder.mParams.mMode = KeyboardId.MODE_TEXT;
// always full width, but height should consider scale and number row to align nicely final int width = ResourceUtils.getKeyboardWidth(context, Settings.getInstance().getCurrent());
// actually the keyboard does not have full height, but at this point we use it to get correct key heights // actually the keyboard does not have full height, but at this point we use it to get correct key heights
final int width = ResourceUtils.getDefaultKeyboardWidth(context);
final int height = ResourceUtils.getKeyboardHeight(context.getResources(), Settings.getInstance().getCurrent()); final int height = ResourceUtils.getKeyboardHeight(context.getResources(), Settings.getInstance().getCurrent());
builder.setKeyboardGeometry(width, height); builder.setKeyboardGeometry(width, height);
builder.setSubtype(RichInputMethodManager.getInstance().getCurrentSubtype()); builder.setSubtype(RichInputMethodManager.getInstance().getCurrentSubtype());