mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-06-24 18:10:54 +00:00
Always default popup VisibleOffset
to keyboard.mVerticalGap
(#1722)
This commit is contained in:
parent
d356f9f54b
commit
e062efb3d4
1 changed files with 8 additions and 12 deletions
|
@ -360,25 +360,21 @@ public final class MainKeyboardView extends KeyboardView implements DrawingProxy
|
|||
public void onKeyPressed(@NonNull final Key key, final boolean withPreview) {
|
||||
key.onPressed();
|
||||
invalidateKey(key);
|
||||
if (withPreview && !key.noKeyPreview()) {
|
||||
|
||||
final Keyboard keyboard = getKeyboard();
|
||||
if (keyboard == null) {
|
||||
return;
|
||||
}
|
||||
mKeyPreviewDrawParams.setVisibleOffset(-keyboard.mVerticalGap);
|
||||
if (withPreview && !key.noKeyPreview() && mKeyPreviewDrawParams.isPopupEnabled()) {
|
||||
showKeyPreview(key);
|
||||
}
|
||||
}
|
||||
|
||||
private void showKeyPreview(@NonNull final Key key) {
|
||||
final Keyboard keyboard = getKeyboard();
|
||||
if (keyboard == null) {
|
||||
return;
|
||||
}
|
||||
final KeyPreviewDrawParams previewParams = mKeyPreviewDrawParams;
|
||||
if (!previewParams.isPopupEnabled()) {
|
||||
previewParams.setVisibleOffset(-keyboard.mVerticalGap);
|
||||
return;
|
||||
}
|
||||
|
||||
locatePreviewPlacerView();
|
||||
getLocationInWindow(mOriginCoords);
|
||||
mKeyPreviewChoreographer.placeAndShowKeyPreview(key, keyboard.mIconsSet, getKeyDrawParams(),
|
||||
mKeyPreviewChoreographer.placeAndShowKeyPreview(key, getKeyboard().mIconsSet, getKeyDrawParams(),
|
||||
KeyboardSwitcher.getInstance().getWrapperView().getWidth(), mOriginCoords, mDrawingPreviewPlacerView);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue