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

Commit ecfbf462 authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka
Browse files

Add static construct method for SparseArray

Change-Id: I6da97f6ea23578318f403bb5d64c30b1663c69ee
parent 1f05cf6d
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ import android.view.inputmethod.EditorInfo;
import com.android.inputmethod.keyboard.Key;
import com.android.inputmethod.keyboard.Keyboard;
import com.android.inputmethod.keyboard.KeyboardView;
import com.android.inputmethod.latin.CollectionUtils;

/**
 * Exposes a virtual view sub-tree for {@link KeyboardView} and generates
@@ -55,7 +56,7 @@ public class AccessibilityEntityProvider extends AccessibilityNodeProviderCompat
    private final AccessibilityUtils mAccessibilityUtils;

    /** A map of integer IDs to {@link Key}s. */
    private final SparseArray<Key> mVirtualViewIdToKey = new SparseArray<Key>();
    private final SparseArray<Key> mVirtualViewIdToKey = CollectionUtils.newSparseArray();

    /** Temporary rect used to calculate in-screen bounds. */
    private final Rect mTempBoundsInScreen = new Rect();
+1 −1
Original line number Diff line number Diff line
@@ -135,7 +135,7 @@ public class Keyboard {
    public final Key[] mAltCodeKeysWhileTyping;
    public final KeyboardIconsSet mIconsSet;

    private final SparseArray<Key> mKeyCache = new SparseArray<Key>();
    private final SparseArray<Key> mKeyCache = CollectionUtils.newSparseArray();

    private final ProximityInfo mProximityInfo;
    private final boolean mProximityCharsCorrectionEnabled;
+1 −1
Original line number Diff line number Diff line
@@ -117,7 +117,7 @@ public class KeyboardLayoutSet {
        int mWidth;
        // Sparse array of KeyboardLayoutSet element parameters indexed by element's id.
        final SparseArray<ElementParams> mKeyboardLayoutSetElementIdToParamsMap =
                new SparseArray<ElementParams>();
                CollectionUtils.newSparseArray();

        static class ElementParams {
            int mKeyboardXmlId;
+2 −2
Original line number Diff line number Diff line
@@ -130,9 +130,9 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy {
    private final Paint mPaint = new Paint();
    private final Paint.FontMetrics mFontMetrics = new Paint.FontMetrics();
    // This sparse array caches key label text height in pixel indexed by key label text size.
    private static final SparseArray<Float> sTextHeightCache = new SparseArray<Float>();
    private static final SparseArray<Float> sTextHeightCache = CollectionUtils.newSparseArray();
    // This sparse array caches key label text width in pixel indexed by key label text size.
    private static final SparseArray<Float> sTextWidthCache = new SparseArray<Float>();
    private static final SparseArray<Float> sTextWidthCache = CollectionUtils.newSparseArray();
    private static final char[] KEY_LABEL_REFERENCE_CHAR = { 'M' };
    private static final char[] KEY_NUMERIC_HINT_LABEL_REFERENCE_CHAR = { '8' };

+1 −1
Original line number Diff line number Diff line
@@ -91,7 +91,7 @@ public class KeyStyles {

    private class DeclaredKeyStyle extends KeyStyle {
        private final String mParentStyleName;
        private final SparseArray<Object> mStyleAttributes = new SparseArray<Object>();
        private final SparseArray<Object> mStyleAttributes = CollectionUtils.newSparseArray();

        public DeclaredKeyStyle(String parentStyleName) {
            mParentStyleName = parentStyleName;
Loading