From 183cb71663320f16149d83eeebaff7795a4b55f2 Mon Sep 17 00:00:00 2001 From: linyuh Date: Wed, 27 Dec 2017 17:02:37 -0800 Subject: Remove field prefixes. Test: Existing tests PiperOrigin-RevId: 180230450 Change-Id: I0b2589cfeeaef81e42a04efa48af24b4e4d0e95f --- .../answer/impl/classifier/ClassifierData.java | 36 +++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'java/com/android/incallui/answer/impl/classifier/ClassifierData.java') diff --git a/java/com/android/incallui/answer/impl/classifier/ClassifierData.java b/java/com/android/incallui/answer/impl/classifier/ClassifierData.java index ae07d27a0..fe3fbe0cf 100644 --- a/java/com/android/incallui/answer/impl/classifier/ClassifierData.java +++ b/java/com/android/incallui/answer/impl/classifier/ClassifierData.java @@ -26,31 +26,31 @@ import java.util.concurrent.TimeUnit; * example, provide information on the current touch state. */ class ClassifierData { - private SparseArray mCurrentStrokes = new SparseArray<>(); - private ArrayList mEndingStrokes = new ArrayList<>(); - private final float mDpi; - private final float mScreenHeight; + private SparseArray currentStrokes = new SparseArray<>(); + private ArrayList endingStrokes = new ArrayList<>(); + private final float dpi; + private final float screenHeight; public ClassifierData(float dpi, float screenHeight) { - mDpi = dpi; - mScreenHeight = screenHeight / dpi; + this.dpi = dpi; + this.screenHeight = screenHeight / dpi; } public void update(MotionEvent event) { - mEndingStrokes.clear(); + endingStrokes.clear(); int action = event.getActionMasked(); if (action == MotionEvent.ACTION_DOWN) { - mCurrentStrokes.clear(); + currentStrokes.clear(); } for (int i = 0; i < event.getPointerCount(); i++) { int id = event.getPointerId(i); - if (mCurrentStrokes.get(id) == null) { + if (currentStrokes.get(id) == null) { // TODO (keyboardr): See if there's a way to use event.getEventTimeNanos() instead - mCurrentStrokes.put( - id, new Stroke(TimeUnit.MILLISECONDS.toNanos(event.getEventTime()), mDpi)); + currentStrokes.put( + id, new Stroke(TimeUnit.MILLISECONDS.toNanos(event.getEventTime()), dpi)); } - mCurrentStrokes + currentStrokes .get(id) .addPoint( event.getX(i), event.getY(i), TimeUnit.MILLISECONDS.toNanos(event.getEventTime())); @@ -58,27 +58,27 @@ class ClassifierData { if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL || (action == MotionEvent.ACTION_POINTER_UP && i == event.getActionIndex())) { - mEndingStrokes.add(getStroke(id)); + endingStrokes.add(getStroke(id)); } } } void cleanUp(MotionEvent event) { - mEndingStrokes.clear(); + endingStrokes.clear(); int action = event.getActionMasked(); for (int i = 0; i < event.getPointerCount(); i++) { int id = event.getPointerId(i); if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL || (action == MotionEvent.ACTION_POINTER_UP && i == event.getActionIndex())) { - mCurrentStrokes.remove(id); + currentStrokes.remove(id); } } } /** @return the list of Strokes which are ending in the recently added MotionEvent */ public ArrayList getEndingStrokes() { - return mEndingStrokes; + return endingStrokes; } /** @@ -86,11 +86,11 @@ class ClassifierData { * @return the Stroke assigned to the id */ public Stroke getStroke(int id) { - return mCurrentStrokes.get(id); + return currentStrokes.get(id); } /** @return the height of the screen in inches */ public float getScreenHeight() { - return mScreenHeight; + return screenHeight; } } -- cgit v1.2.3