Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e4037009 authored by Amith Yamasani's avatar Amith Yamasani
Browse files

Fix #1977876 : Key preview in WVGA broken.

Use PX unit when setting the text size since we're getting the size from getTextSize()
Reduce delay for popup.
parent f57117b7
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ import android.inputmethodservice.Keyboard.Key;
import android.os.Handler;
import android.os.Message;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.GestureDetector;
import android.view.Gravity;
import android.view.LayoutInflater;
@@ -162,7 +163,7 @@ public class KeyboardView extends View implements View.OnClickListener {
    private static final int MSG_REPEAT = 3;
    private static final int MSG_LONGPRESS = 4;

    private static final int DELAY_BEFORE_PREVIEW = 70;
    private static final int DELAY_BEFORE_PREVIEW = 40;
    private static final int DELAY_AFTER_PREVIEW = 60;
    
    private int mVerticalCorrection;
@@ -827,10 +828,10 @@ public class KeyboardView extends View implements View.OnClickListener {
            mPreviewText.setCompoundDrawables(null, null, null, null);
            mPreviewText.setText(getPreviewText(key));
            if (key.label.length() > 1 && key.codes.length < 2) {
                mPreviewText.setTextSize(mKeyTextSize);
                mPreviewText.setTextSize(TypedValue.COMPLEX_UNIT_PX, mKeyTextSize);
                mPreviewText.setTypeface(Typeface.DEFAULT_BOLD);
            } else {
                mPreviewText.setTextSize(mPreviewTextSizeLarge);
                mPreviewText.setTextSize(TypedValue.COMPLEX_UNIT_PX, mPreviewTextSizeLarge);
                mPreviewText.setTypeface(Typeface.DEFAULT);
            }
        }