From c937a618e18d45d5054d5aeb4f7959eb81d71fbf Mon Sep 17 00:00:00 2001 From: Aleksandras Kostarevas Date: Mon, 6 May 2024 16:54:28 -0500 Subject: [PATCH] Fix key preview appearing wrongly depending on key height --- java/res/values-land/config.xml | 2 +- java/res/values/config.xml | 2 +- .../inputmethod/keyboard/internal/KeyPreviewChoreographer.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/java/res/values-land/config.xml b/java/res/values-land/config.xml index d36f6a0fc..6b1835f10 100644 --- a/java/res/values-land/config.xml +++ b/java/res/values-land/config.xml @@ -41,7 +41,7 @@ -22.4dp 1.6dp 80dp - 43.6dp + 0.0dp 122dp 90% 65% diff --git a/java/res/values/config.xml b/java/res/values/config.xml index a5d04550a..f7addf03e 100644 --- a/java/res/values/config.xml +++ b/java/res/values/config.xml @@ -44,7 +44,7 @@ -26.4dp 8.0dp 80dp - 50.0dp + 0.0dp 122dp 82% 66% diff --git a/java/src/org/futo/inputmethod/keyboard/internal/KeyPreviewChoreographer.java b/java/src/org/futo/inputmethod/keyboard/internal/KeyPreviewChoreographer.java index dc9898103..1c029f76f 100644 --- a/java/src/org/futo/inputmethod/keyboard/internal/KeyPreviewChoreographer.java +++ b/java/src/org/futo/inputmethod/keyboard/internal/KeyPreviewChoreographer.java @@ -133,7 +133,7 @@ public final class KeyPreviewChoreographer { // The key preview is placed vertically above the top edge of the parent key with an // arbitrary offset. final int previewY = key.getY() - previewHeight + mParams.mPreviewOffset - + CoordinateUtils.y(originCoords); + + CoordinateUtils.y(originCoords) + key.getHeight(); ViewLayoutUtils.placeViewAt( keyPreviewView, previewX, previewY, previewWidth, previewHeight);