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

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

Rename InputPointers.addPointer and ResizableIntArray.add

Change-Id: I5580250c91b29f93ed886b080ce33845b3b67ace
parent e13cc9d7
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -157,19 +157,19 @@ public final class GestureStrokeDrawingPoints {
            for (int i = 1; i < segments; i++) {
                final float t = i / (float)segments;
                mInterpolator.interpolate(t);
                eventTimes.add(d1, (int)(dt * t) + t1);
                xCoords.add(d1, (int)mInterpolator.mInterpolatedX);
                yCoords.add(d1, (int)mInterpolator.mInterpolatedY);
                eventTimes.addAt(d1, (int)(dt * t) + t1);
                xCoords.addAt(d1, (int)mInterpolator.mInterpolatedX);
                yCoords.addAt(d1, (int)mInterpolator.mInterpolatedY);
                if (GestureTrailDrawingPoints.DEBUG_SHOW_POINTS) {
                    types.add(d1, GestureTrailDrawingPoints.POINT_TYPE_INTERPOLATED);
                    types.addAt(d1, GestureTrailDrawingPoints.POINT_TYPE_INTERPOLATED);
                }
                d1++;
            }
            eventTimes.add(d1, pt[p2]);
            xCoords.add(d1, px[p2]);
            yCoords.add(d1, py[p2]);
            eventTimes.addAt(d1, pt[p2]);
            xCoords.addAt(d1, px[p2]);
            yCoords.addAt(d1, py[p2]);
            if (GestureTrailDrawingPoints.DEBUG_SHOW_POINTS) {
                types.add(d1, GestureTrailDrawingPoints.POINT_TYPE_SAMPLED);
                types.addAt(d1, GestureTrailDrawingPoints.POINT_TYPE_SAMPLED);
            }
        }
        return lastInterpolatedDrawIndex;
+5 −6
Original line number Diff line number Diff line
@@ -55,15 +55,14 @@ public final class InputPointers {
        mTimes.fill(lastTime, fromIndex, fillLength);
    }

    // TODO: Rename this method to addPointerAt
    public void addPointer(int index, int x, int y, int pointerId, int time) {
        mXCoordinates.add(index, x);
        mYCoordinates.add(index, y);
        mPointerIds.add(index, pointerId);
    public void addPointerAt(int index, int x, int y, int pointerId, int time) {
        mXCoordinates.addAt(index, x);
        mYCoordinates.addAt(index, y);
        mPointerIds.addAt(index, pointerId);
        if (LatinImeLogger.sDBG || DEBUG_TIME) {
            fillWithLastTimeUntil(index);
        }
        mTimes.add(index, time);
        mTimes.addAt(index, time);
    }

    @UsedForTesting
+1 −1
Original line number Diff line number Diff line
@@ -186,7 +186,7 @@ public final class WordComposer {
            // (See {@link #setBatchInputWord}).
            if (!mIsBatchMode) {
                // TODO: Set correct pointer id and time
                mInputPointers.addPointer(newIndex, keyX, keyY, 0, 0);
                mInputPointers.addPointerAt(newIndex, keyX, keyY, 0, 0);
            }
        }
        mIsFirstCharCapitalized = isFirstCharCapitalized(
+1 −2
Original line number Diff line number Diff line
@@ -34,8 +34,7 @@ public final class ResizableIntArray {
        throw new ArrayIndexOutOfBoundsException("length=" + mLength + "; index=" + index);
    }

    // TODO: Rename this method to addAt.
    public void add(final int index, final int val) {
    public void addAt(final int index, final int val) {
        if (index < mLength) {
            mArray[index] = val;
        } else {
+1 −1
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@ public class InputPointersTests extends AndroidTestCase {
            final int y = i * 2;
            final int pointerId = i * 3;
            final int time = i * 4;
            src.addPointer(i, x, y, pointerId, time);
            src.addPointerAt(i, x, y, pointerId, time);
            assertEquals("size after add at " + i, i + 1, src.getPointerSize());
        }
        for (int i = 0; i < limit; i += step) {
Loading