diff options
author | Hyunyoung Song <hyunyoungs@google.com> | 2016-10-05 16:27:48 -0700 |
---|---|---|
committer | Hyunyoung Song <hyunyoungs@google.com> | 2016-10-06 10:57:29 -0700 |
commit | 0de011705b132eacdd10f7bfb5cdc4bd79a147e8 (patch) | |
tree | 6e9e2b5693ac5b9fbc30577679cc84bcfeac1428 /src/com/android/launcher3/graphics | |
parent | cc257380fe46d344ccc5132ac278355d16e4b3b0 (diff) | |
download | android_packages_apps_Trebuchet-0de011705b132eacdd10f7bfb5cdc4bd79a147e8.tar.gz android_packages_apps_Trebuchet-0de011705b132eacdd10f7bfb5cdc4bd79a147e8.tar.bz2 android_packages_apps_Trebuchet-0de011705b132eacdd10f7bfb5cdc4bd79a147e8.zip |
Code sanitization
- Removed bad method/class name typos
Change-Id: Ie6900e9e3d9ce9b550d2a2442a5dac3f7050a573
Diffstat (limited to 'src/com/android/launcher3/graphics')
-rw-r--r-- | src/com/android/launcher3/graphics/DragPreviewProvider.java | 6 | ||||
-rw-r--r-- | src/com/android/launcher3/graphics/IconNormalizer.java | 18 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/com/android/launcher3/graphics/DragPreviewProvider.java b/src/com/android/launcher3/graphics/DragPreviewProvider.java index 7ad1e3a43..a7d4c63a1 100644 --- a/src/com/android/launcher3/graphics/DragPreviewProvider.java +++ b/src/com/android/launcher3/graphics/DragPreviewProvider.java @@ -44,7 +44,7 @@ public class DragPreviewProvider { // The padding added to the drag view during the preview generation. public final int previewPadding; - public Bitmap gerenatedDragOutline; + public Bitmap generatedDragOutline; public DragPreviewProvider(View view) { mView = view; @@ -120,11 +120,11 @@ public class DragPreviewProvider { } public final void generateDragOutline(Canvas canvas) { - if (ProviderConfig.IS_DOGFOOD_BUILD && gerenatedDragOutline != null) { + if (ProviderConfig.IS_DOGFOOD_BUILD && generatedDragOutline != null) { throw new RuntimeException("Drag outline generated twice"); } - gerenatedDragOutline = createDragOutline(canvas); + generatedDragOutline = createDragOutline(canvas); } /** diff --git a/src/com/android/launcher3/graphics/IconNormalizer.java b/src/com/android/launcher3/graphics/IconNormalizer.java index f90b2d72e..14109172b 100644 --- a/src/com/android/launcher3/graphics/IconNormalizer.java +++ b/src/com/android/launcher3/graphics/IconNormalizer.java @@ -186,16 +186,16 @@ public class IconNormalizer { } /** - * Modifies {@param xCordinates} to represent a convex border. Fills in all missing values + * Modifies {@param xCoordinates} to represent a convex border. Fills in all missing values * (except on either ends) with appropriate values. - * @param xCordinates map of x coordinate per y. + * @param xCoordinates map of x coordinate per y. * @param direction 1 for left border and -1 for right border. * @param topY the first Y position (inclusive) with a valid value. * @param bottomY the last Y position (inclusive) with a valid value. */ private static void convertToConvexArray( - float[] xCordinates, int direction, int topY, int bottomY) { - int total = xCordinates.length; + float[] xCoordinates, int direction, int topY, int bottomY) { + int total = xCoordinates.length; // The tangent at each pixel. float[] angles = new float[total - 1]; @@ -205,7 +205,7 @@ public class IconNormalizer { float lastAngle = Float.MAX_VALUE; for (int i = topY + 1; i <= bottomY; i++) { - if (xCordinates[i] <= -1) { + if (xCoordinates[i] <= -1) { continue; } int start; @@ -213,14 +213,14 @@ public class IconNormalizer { if (lastAngle == Float.MAX_VALUE) { start = first; } else { - float currentAngle = (xCordinates[i] - xCordinates[last]) / (i - last); + float currentAngle = (xCoordinates[i] - xCoordinates[last]) / (i - last); start = last; // If this position creates a concave angle, keep moving up until we find a // position which creates a convex angle. if ((currentAngle - lastAngle) * direction < 0) { while (start > first) { start --; - currentAngle = (xCordinates[i] - xCordinates[start]) / (i - start); + currentAngle = (xCoordinates[i] - xCoordinates[start]) / (i - start); if ((currentAngle - angles[start]) * direction >= 0) { break; } @@ -229,11 +229,11 @@ public class IconNormalizer { } // Reset from last check - lastAngle = (xCordinates[i] - xCordinates[start]) / (i - start); + lastAngle = (xCoordinates[i] - xCoordinates[start]) / (i - start); // Update all the points from start. for (int j = start; j < i; j++) { angles[j] = lastAngle; - xCordinates[j] = xCordinates[start] + lastAngle * (j - start); + xCoordinates[j] = xCoordinates[start] + lastAngle * (j - start); } last = i; } |