Fix key preview appearing wrongly depending on key height

This commit is contained in:
Aleksandras Kostarevas 2024-05-06 16:54:28 -05:00
parent 80272cbab4
commit c937a618e1
3 changed files with 3 additions and 3 deletions

View File

@ -41,7 +41,7 @@
<dimen name="config_more_keys_keyboard_vertical_correction_holo">-22.4dp</dimen> <dimen name="config_more_keys_keyboard_vertical_correction_holo">-22.4dp</dimen>
<dimen name="config_key_preview_offset_holo">1.6dp</dimen> <dimen name="config_key_preview_offset_holo">1.6dp</dimen>
<dimen name="config_key_preview_height_holo">80dp</dimen> <dimen name="config_key_preview_height_holo">80dp</dimen>
<dimen name="config_key_preview_offset_lxx">43.6dp</dimen> <dimen name="config_key_preview_offset_lxx">0.0dp</dimen>
<dimen name="config_key_preview_height_lxx">122dp</dimen> <dimen name="config_key_preview_height_lxx">122dp</dimen>
<fraction name="config_key_preview_text_ratio">90%</fraction> <fraction name="config_key_preview_text_ratio">90%</fraction>
<fraction name="config_key_letter_ratio_holo">65%</fraction> <fraction name="config_key_letter_ratio_holo">65%</fraction>

View File

@ -44,7 +44,7 @@
<dimen name="config_more_keys_keyboard_vertical_correction_holo">-26.4dp</dimen> <dimen name="config_more_keys_keyboard_vertical_correction_holo">-26.4dp</dimen>
<dimen name="config_key_preview_offset_holo">8.0dp</dimen> <dimen name="config_key_preview_offset_holo">8.0dp</dimen>
<dimen name="config_key_preview_height_holo">80dp</dimen> <dimen name="config_key_preview_height_holo">80dp</dimen>
<dimen name="config_key_preview_offset_lxx">50.0dp</dimen> <dimen name="config_key_preview_offset_lxx">0.0dp</dimen>
<dimen name="config_key_preview_height_lxx">122dp</dimen> <dimen name="config_key_preview_height_lxx">122dp</dimen>
<fraction name="config_key_preview_text_ratio">82%</fraction> <fraction name="config_key_preview_text_ratio">82%</fraction>
<fraction name="config_key_letter_ratio_holo">66%</fraction> <fraction name="config_key_letter_ratio_holo">66%</fraction>

View File

@ -133,7 +133,7 @@ public final class KeyPreviewChoreographer {
// The key preview is placed vertically above the top edge of the parent key with an // The key preview is placed vertically above the top edge of the parent key with an
// arbitrary offset. // arbitrary offset.
final int previewY = key.getY() - previewHeight + mParams.mPreviewOffset final int previewY = key.getY() - previewHeight + mParams.mPreviewOffset
+ CoordinateUtils.y(originCoords); + CoordinateUtils.y(originCoords) + key.getHeight();
ViewLayoutUtils.placeViewAt( ViewLayoutUtils.placeViewAt(
keyPreviewView, previewX, previewY, previewWidth, previewHeight); keyPreviewView, previewX, previewY, previewWidth, previewHeight);