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

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

Add new public attribute mPointerId to PointerTracker

It is easier to track each pointer if a PointerTracker object keeps
its pointer id.

Bug: 2910379
Change-Id: If3e3b0cf3d834d22302598f4d85d54c9a4ce92ba
parent 2085d43d
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -774,7 +774,6 @@ public class LatinKeyboardBaseView extends View implements View.OnClickListener,
        if (DEBUG) {
            if (mShowTouchPoints) {
                for (PointerTracker tracker : mPointerTrackers) {
                    if (tracker == null) continue;
                    int startX = tracker.getStartX();
                    int startY = tracker.getStartY();
                    int lastX = tracker.getLastX();
@@ -1047,7 +1046,7 @@ public class LatinKeyboardBaseView extends View implements View.OnClickListener,
        // Create pointer trackers until we can get 'id+1'-th tracker, if needed.
        for (int i = pointers.size(); i <= id; i++) {
            final PointerTracker tracker =
                new PointerTracker(mHandler, mKeyDetector, this);
                new PointerTracker(i, mHandler, mKeyDetector, this);
            if (keys != null)
                tracker.setKeyboard(keys, mDebounceHysteresis);
            if (listener != null)
+4 −1
Original line number Diff line number Diff line
@@ -32,6 +32,8 @@ public class PointerTracker {
        public boolean isMiniKeyboardOnScreen();
    }

    public final int mPointerId;

    // Timing constants
    private static final int REPEAT_START_DELAY = 400;
    /* package */  static final int REPEAT_INTERVAL = 50; // ~20 keys per second
@@ -77,9 +79,10 @@ public class PointerTracker {
    // pressed key
    private int mPreviousKey = NOT_A_KEY;

    public PointerTracker(UIHandler handler, KeyDetector keyDetector, UIProxy proxy) {
    public PointerTracker(int id, UIHandler handler, KeyDetector keyDetector, UIProxy proxy) {
        if (proxy == null || handler == null || keyDetector == null)
            throw new NullPointerException();
        mPointerId = id;
        mProxy = proxy;
        mHandler = handler;
        mKeyDetector = keyDetector;