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

Commit 07ee3fda authored by Amith Yamasani's avatar Amith Yamasani
Browse files

DO NOT MERGE. Already in master. 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 4ca6659f
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ import android.os.Handler;
import android.os.Message;
import android.os.SystemClock;
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;
@@ -825,10 +826,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);
            }
        }