From 0de011705b132eacdd10f7bfb5cdc4bd79a147e8 Mon Sep 17 00:00:00 2001 From: Hyunyoung Song Date: Wed, 5 Oct 2016 16:27:48 -0700 Subject: [PATCH] Code sanitization - Removed bad method/class name typos Change-Id: Ie6900e9e3d9ce9b550d2a2442a5dac3f7050a573 --- src/com/android/launcher3/CellLayout.java | 4 +-- src/com/android/launcher3/DropTarget.java | 21 ------------ src/com/android/launcher3/IconCache.java | 2 +- src/com/android/launcher3/ItemInfo.java | 2 +- src/com/android/launcher3/Launcher.java | 6 ++-- .../android/launcher3/LauncherAppState.java | 4 +-- src/com/android/launcher3/PagedView.java | 6 ++-- .../android/launcher3/PendingAddItemInfo.java | 2 +- .../launcher3/PreloadIconDrawable.java | 4 +-- src/com/android/launcher3/Utilities.java | 2 +- src/com/android/launcher3/Workspace.java | 34 +++++++++---------- ...ava => AccessibleDragListenerAdapter.java} | 4 +-- .../OverviewAccessibilityDelegate.java | 2 +- .../allapps/AllAppsFastScrollHelper.java | 2 +- .../allapps/AlphabeticalAppsList.java | 4 +-- .../allapps/VerticalPullDetector.java | 2 +- .../compat/PackageInstallerCompatVL.java | 6 ++-- .../launcher3/dragndrop/DragController.java | 6 ++-- .../launcher3/dragndrop/DragLayer.java | 2 +- src/com/android/launcher3/folder/Folder.java | 4 +-- .../launcher3/folder/FolderPagedView.java | 2 +- .../graphics/DragPreviewProvider.java | 6 ++-- .../launcher3/graphics/IconNormalizer.java | 18 +++++----- .../logging/UserEventDispatcher.java | 2 +- .../launcher3/provider/LauncherDbUtils.java | 2 +- .../widget/WidgetsContainerView.java | 2 +- 26 files changed, 65 insertions(+), 86 deletions(-) rename src/com/android/launcher3/accessibility/{AccessibileDragListenerAdapter.java => AccessibleDragListenerAdapter.java} (93%) diff --git a/src/com/android/launcher3/CellLayout.java b/src/com/android/launcher3/CellLayout.java index 6714d9f17c..5d3cbb2990 100644 --- a/src/com/android/launcher3/CellLayout.java +++ b/src/com/android/launcher3/CellLayout.java @@ -1054,11 +1054,11 @@ public class CellLayout extends ViewGroup implements BubbleTextShadowHandler { final int oldDragCellX = mDragCell[0]; final int oldDragCellY = mDragCell[1]; - if (outlineProvider == null || outlineProvider.gerenatedDragOutline == null) { + if (outlineProvider == null || outlineProvider.generatedDragOutline == null) { return; } - Bitmap dragOutline = outlineProvider.gerenatedDragOutline; + Bitmap dragOutline = outlineProvider.generatedDragOutline; if (cellX != oldDragCellX || cellY != oldDragCellY) { Point dragOffset = dragObject.dragView.getDragVisualizeOffset(); Rect dragRegion = dragObject.dragView.getDragRegion(); diff --git a/src/com/android/launcher3/DropTarget.java b/src/com/android/launcher3/DropTarget.java index efdeb1fa37..e91fc15e04 100644 --- a/src/com/android/launcher3/DropTarget.java +++ b/src/com/android/launcher3/DropTarget.java @@ -107,17 +107,6 @@ public interface DropTarget { /** * Handle an object being dropped on the DropTarget - * - * @param source DragSource where the drag started - * @param x X coordinate of the drop location - * @param y Y coordinate of the drop location - * @param xOffset Horizontal offset with the object being dragged where the original - * touch happened - * @param yOffset Vertical offset with the object being dragged where the original - * touch happened - * @param dragView The DragView that's being dragged around on screen. - * @param dragInfo Data associated with the object being dragged - * */ void onDrop(DragObject dragObject); @@ -137,16 +126,6 @@ public interface DropTarget { /** * Check if a drop action can occur at, or near, the requested location. * This will be called just before onDrop. - * - * @param source DragSource where the drag started - * @param x X coordinate of the drop location - * @param y Y coordinate of the drop location - * @param xOffset Horizontal offset with the object being dragged where the - * original touch happened - * @param yOffset Vertical offset with the object being dragged where the - * original touch happened - * @param dragView The DragView that's being dragged around on screen. - * @param dragInfo Data associated with the object being dragged * @return True if the drop will be accepted, false otherwise. */ boolean acceptDrop(DragObject dragObject); diff --git a/src/com/android/launcher3/IconCache.java b/src/com/android/launcher3/IconCache.java index 8edfdf593b..79097376c6 100644 --- a/src/com/android/launcher3/IconCache.java +++ b/src/com/android/launcher3/IconCache.java @@ -363,7 +363,7 @@ public class IconCache { } /** - * Updates {@param values} to contain versoning information and adds it to the DB. + * Updates {@param values} to contain versioning information and adds it to the DB. * @param values {@link ContentValues} containing icon & title */ private void addIconToDB(ContentValues values, ComponentName key, diff --git a/src/com/android/launcher3/ItemInfo.java b/src/com/android/launcher3/ItemInfo.java index c0c22a325a..20437721ed 100644 --- a/src/com/android/launcher3/ItemInfo.java +++ b/src/com/android/launcher3/ItemInfo.java @@ -59,7 +59,7 @@ public class ItemInfo { public long container = NO_ID; /** - * Iindicates the screen in which the shortcut appears. + * Indicates the screen in which the shortcut appears. */ public long screenId = -1; diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 164dc518b7..b1700ccbbc 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -1340,7 +1340,7 @@ public class Launcher extends Activity } // Setup the drag controller (drop targets have to be added in reverse order in priority) - mDragController.setDragScoller(mWorkspace); + mDragController.setDragScroller(mWorkspace); mDragController.setScrollView(mDragLayer); mDragController.setMoveTarget(mWorkspace); mDragController.addDropTarget(mWorkspace); @@ -2516,7 +2516,7 @@ public class Launcher extends Activity * on the home screen. */ public void onClickWallpaperPicker(View v) { - if (!Utilities.isWallapaperAllowed(this)) { + if (!Utilities.isWallpaperAllowed(this)) { Toast.makeText(this, R.string.msg_disabled_by_admin, Toast.LENGTH_SHORT).show(); return; } @@ -3693,7 +3693,7 @@ public class Launcher extends Activity if (DEBUG_WIDGETS) { Log.d(TAG, "Removing restored widget: id=" + item.appWidgetId + " belongs to component " + item.providerName - + ", as the povider is null"); + + ", as the provider is null"); } LauncherModel.deleteItemFromDatabase(this, item); return; diff --git a/src/com/android/launcher3/LauncherAppState.java b/src/com/android/launcher3/LauncherAppState.java index 7861a106fd..1ee4a1a375 100644 --- a/src/com/android/launcher3/LauncherAppState.java +++ b/src/com/android/launcher3/LauncherAppState.java @@ -86,10 +86,10 @@ public class LauncherAppState { private LauncherAppState() { if (sContext == null) { - throw new IllegalStateException("LauncherAppState inited before app context set"); + throw new IllegalStateException("LauncherAppState initiated before app context set"); } - Log.v(Launcher.TAG, "LauncherAppState inited"); + Log.v(Launcher.TAG, "LauncherAppState initiated"); if (TestingUtils.MEMORY_DUMP_ENABLED) { TestingUtils.startTrackingMemory(sContext); diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java index 0b9bf09dfb..136d48db94 100644 --- a/src/com/android/launcher3/PagedView.java +++ b/src/com/android/launcher3/PagedView.java @@ -1082,7 +1082,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc canvas.translate(display.left, display.top); canvas.rotate(270); - getEdgeVerticalPostion(sTmpIntPoint); + getEdgeVerticalPosition(sTmpIntPoint); canvas.translate(display.top - sTmpIntPoint[1], 0); mEdgeGlowLeft.setSize(sTmpIntPoint[1] - sTmpIntPoint[0], display.width()); if (mEdgeGlowLeft.draw(canvas)) { @@ -1096,7 +1096,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc canvas.translate(display.left + mPageScrolls[mIsRtl ? 0 : (getPageCount() - 1)], display.top); canvas.rotate(90); - getEdgeVerticalPostion(sTmpIntPoint); + getEdgeVerticalPosition(sTmpIntPoint); canvas.translate(sTmpIntPoint[0] - display.top, -display.width()); mEdgeGlowRight.setSize(sTmpIntPoint[1] - sTmpIntPoint[0], display.width()); @@ -1111,7 +1111,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc /** * Returns the top and bottom position for the edge effect. */ - protected abstract void getEdgeVerticalPostion(int[] pos); + protected abstract void getEdgeVerticalPosition(int[] pos); @Override public boolean requestChildRectangleOnScreen(View child, Rect rectangle, boolean immediate) { diff --git a/src/com/android/launcher3/PendingAddItemInfo.java b/src/com/android/launcher3/PendingAddItemInfo.java index 31820d7424..76de3e7644 100644 --- a/src/com/android/launcher3/PendingAddItemInfo.java +++ b/src/com/android/launcher3/PendingAddItemInfo.java @@ -20,7 +20,7 @@ import android.content.ComponentName; /** * Meta data that is used for deferred binding. - * e.g., this object is used to pass information on dragable targets when they are dropped onto + * e.g., this object is used to pass information on draggable targets when they are dropped onto * the workspace from another container. */ public class PendingAddItemInfo extends ItemInfo { diff --git a/src/com/android/launcher3/PreloadIconDrawable.java b/src/com/android/launcher3/PreloadIconDrawable.java index b064c47fc7..8295b45e8b 100644 --- a/src/com/android/launcher3/PreloadIconDrawable.java +++ b/src/com/android/launcher3/PreloadIconDrawable.java @@ -18,7 +18,7 @@ public class PreloadIconDrawable extends Drawable { private static final float ANIMATION_PROGRESS_STARTED = 0f; private static final float ANIMATION_PROGRESS_COMPLETED = 1.0f; - private static final float MIN_SATUNATION = 0.2f; + private static final float MIN_SATURATION = 0.2f; private static final float MIN_LIGHTNESS = 0.6f; private static final float ICON_SCALE_FACTOR = 0.5f; @@ -242,7 +242,7 @@ public class PreloadIconDrawable extends Drawable { // Make sure that the dominant color has enough saturation to be visible properly. float[] hsv = new float[3]; Color.colorToHSV(mIndicatorColor, hsv); - if (hsv[1] < MIN_SATUNATION) { + if (hsv[1] < MIN_SATURATION) { mIndicatorColor = DEFAULT_COLOR; return mIndicatorColor; } diff --git a/src/com/android/launcher3/Utilities.java b/src/com/android/launcher3/Utilities.java index b4f0a498c1..95e3d82692 100644 --- a/src/com/android/launcher3/Utilities.java +++ b/src/com/android/launcher3/Utilities.java @@ -618,7 +618,7 @@ public final class Utilities { return ATLEAST_LOLLIPOP && powerManager.isPowerSaveMode(); } - public static boolean isWallapaperAllowed(Context context) { + public static boolean isWallpaperAllowed(Context context) { if (isNycOrAbove()) { try { WallpaperManager wm = context.getSystemService(WallpaperManager.class); diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index 0bf8241ac8..d2524601c7 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -56,7 +56,7 @@ import android.widget.TextView; import com.android.launcher3.Launcher.CustomContentCallbacks; import com.android.launcher3.Launcher.LauncherOverlay; import com.android.launcher3.UninstallDropTarget.DropTargetSource; -import com.android.launcher3.accessibility.AccessibileDragListenerAdapter; +import com.android.launcher3.accessibility.AccessibleDragListenerAdapter; import com.android.launcher3.accessibility.OverviewAccessibilityDelegate; import com.android.launcher3.accessibility.OverviewScreenAccessibilityDelegate; import com.android.launcher3.accessibility.WorkspaceAccessibilityHelper; @@ -303,7 +303,7 @@ public class Workspace extends PagedView LauncherOverlay mLauncherOverlay; boolean mScrollInteractionBegan; boolean mStartedSendingScrollEvents; - float mLastOverlaySroll = 0; + float mLastOverlayScroll = 0; // Total over scrollX in the overlay direction. private int mUnboundedScrollX; private boolean mForceDrawAdjacentPages = false; @@ -407,7 +407,7 @@ public class Workspace extends PagedView @Override public void onDragStart(DropTarget.DragObject dragObject, DragOptions options) { if (ENFORCE_DRAG_EVENT_ORDER) { - enfoceDragParity("onDragStart", 0, 0); + enforceDragParity("onDragStart", 0, 0); } if (mOutlineProvider != null) { @@ -464,7 +464,7 @@ public class Workspace extends PagedView @Override public void onDragEnd() { if (ENFORCE_DRAG_EVENT_ORDER) { - enfoceDragParity("onDragEnd", 0, 0); + enforceDragParity("onDragEnd", 0, 0); } if (!mDeferRemoveExtraEmptyScreen) { @@ -582,7 +582,7 @@ public class Workspace extends PagedView /** * Initializes and binds the first page - * @param qsb an exisitng qsb to recycle or null. + * @param qsb an existing qsb to recycle or null. */ public void bindAndInitFirstWorkspaceScreen(View qsb) { if (!FeatureFlags.QSB_ON_FIRST_SCREEN) { @@ -1462,7 +1462,7 @@ public class Workspace extends PagedView boolean shouldScrollOverlay = mLauncherOverlay != null && ((amount <= 0 && !mIsRtl) || (amount >= 0 && mIsRtl)); - boolean shouldZeroOverlay = mLauncherOverlay != null && mLastOverlaySroll != 0 && + boolean shouldZeroOverlay = mLauncherOverlay != null && mLastOverlayScroll != 0 && ((amount >= 0 && !mIsRtl) || (amount <= 0 && mIsRtl)); if (shouldScrollOverlay) { @@ -1471,8 +1471,8 @@ public class Workspace extends PagedView mLauncherOverlay.onScrollInteractionBegin(); } - mLastOverlaySroll = Math.abs(amount / getViewportWidth()); - mLauncherOverlay.onScrollChange(mLastOverlaySroll, mIsRtl); + mLastOverlayScroll = Math.abs(amount / getViewportWidth()); + mLauncherOverlay.onScrollChange(mLastOverlayScroll, mIsRtl); } else if (shouldOverScroll) { dampedOverScroll(amount); } @@ -1616,7 +1616,7 @@ public class Workspace extends PagedView } @Override - protected void getEdgeVerticalPostion(int[] pos) { + protected void getEdgeVerticalPosition(int[] pos) { View child = getChildAt(getPageCount() - 1); pos[0] = child.getTop(); pos[1] = child.getBottom(); @@ -2266,7 +2266,7 @@ public class Workspace extends PagedView layout.prepareChildForDrag(child); if (options.isAccessibleDrag) { - mDragController.addDragListener(new AccessibileDragListenerAdapter( + mDragController.addDragListener(new AccessibleDragListenerAdapter( this, CellLayout.WORKSPACE_ACCESSIBILITY_DRAG) { @Override protected void enableAccessibleDrag(boolean enable) { @@ -2788,7 +2788,7 @@ public class Workspace extends PagedView @Override public void onDragEnter(DragObject d) { if (ENFORCE_DRAG_EVENT_ORDER) { - enfoceDragParity("onDragEnter", 1, 1); + enforceDragParity("onDragEnter", 1, 1); } mCreateUserFolderOnDrop = false; @@ -2805,7 +2805,7 @@ public class Workspace extends PagedView @Override public void onDragExit(DragObject d) { if (ENFORCE_DRAG_EVENT_ORDER) { - enfoceDragParity("onDragExit", -1, 0); + enforceDragParity("onDragExit", -1, 0); } // Here we store the final page that will be dropped to, if the workspace in fact @@ -2838,14 +2838,14 @@ public class Workspace extends PagedView mLauncher.getDragLayer().hidePageHints(); } - private void enfoceDragParity(String event, int update, int expectedValue) { - enfoceDragParity(this, event, update, expectedValue); + private void enforceDragParity(String event, int update, int expectedValue) { + enforceDragParity(this, event, update, expectedValue); for (int i = 0; i < getChildCount(); i++) { - enfoceDragParity(getChildAt(i), event, update, expectedValue); + enforceDragParity(getChildAt(i), event, update, expectedValue); } } - private void enfoceDragParity(View v, String event, int update, int expectedValue) { + private void enforceDragParity(View v, String event, int update, int expectedValue) { Object tag = v.getTag(R.id.drag_event_parity); int value = tag == null ? 0 : (Integer) tag; value += update; @@ -2966,7 +2966,7 @@ public class Workspace extends PagedView mTempXY[0] = (int) xy[0]; mTempXY[1] = (int) xy[1]; mLauncher.getDragLayer().getDescendantCoordRelativeToSelf(this, mTempXY, true); - mLauncher.getDragLayer().mapCoordInSelfToDescendent(hotseat.getLayout(), mTempXY); + mLauncher.getDragLayer().mapCoordInSelfToDescendant(hotseat.getLayout(), mTempXY); xy[0] = mTempXY[0]; xy[1] = mTempXY[1]; diff --git a/src/com/android/launcher3/accessibility/AccessibileDragListenerAdapter.java b/src/com/android/launcher3/accessibility/AccessibleDragListenerAdapter.java similarity index 93% rename from src/com/android/launcher3/accessibility/AccessibileDragListenerAdapter.java rename to src/com/android/launcher3/accessibility/AccessibleDragListenerAdapter.java index 62a9a6d19a..f8df5d7be7 100644 --- a/src/com/android/launcher3/accessibility/AccessibileDragListenerAdapter.java +++ b/src/com/android/launcher3/accessibility/AccessibleDragListenerAdapter.java @@ -28,7 +28,7 @@ import com.android.launcher3.dragndrop.DragOptions; * Utility listener to enable/disable accessibility drag flags for a ViewGroup * containing CellLayouts */ -public class AccessibileDragListenerAdapter implements DragListener { +public class AccessibleDragListenerAdapter implements DragListener { private final ViewGroup mViewGroup; private final int mDragType; @@ -38,7 +38,7 @@ public class AccessibileDragListenerAdapter implements DragListener { * @param dragType either {@link CellLayout#WORKSPACE_ACCESSIBILITY_DRAG} or * {@link CellLayout#FOLDER_ACCESSIBILITY_DRAG} */ - public AccessibileDragListenerAdapter(ViewGroup parent, int dragType) { + public AccessibleDragListenerAdapter(ViewGroup parent, int dragType) { mViewGroup = parent; mDragType = dragType; } diff --git a/src/com/android/launcher3/accessibility/OverviewAccessibilityDelegate.java b/src/com/android/launcher3/accessibility/OverviewAccessibilityDelegate.java index 64559f2ec1..a6e89d320f 100644 --- a/src/com/android/launcher3/accessibility/OverviewAccessibilityDelegate.java +++ b/src/com/android/launcher3/accessibility/OverviewAccessibilityDelegate.java @@ -44,7 +44,7 @@ public class OverviewAccessibilityDelegate extends AccessibilityDelegate { Context context = host.getContext(); info.addAction(new AccessibilityAction(OVERVIEW, context.getText(OVERVIEW))); - if (Utilities.isWallapaperAllowed(context)) { + if (Utilities.isWallpaperAllowed(context)) { info.addAction(new AccessibilityAction(WALLPAPERS, context.getText(WALLPAPERS))); } info.addAction(new AccessibilityAction(WIDGETS, context.getText(WIDGETS))); diff --git a/src/com/android/launcher3/allapps/AllAppsFastScrollHelper.java b/src/com/android/launcher3/allapps/AllAppsFastScrollHelper.java index 76934af7dd..808de476b4 100644 --- a/src/com/android/launcher3/allapps/AllAppsFastScrollHelper.java +++ b/src/com/android/launcher3/allapps/AllAppsFastScrollHelper.java @@ -34,7 +34,7 @@ public class AllAppsFastScrollHelper implements AllAppsGridAdapter.BindViewCallb private AllAppsRecyclerView mRv; private AlphabeticalAppsList mApps; - // Keeps track of the current and targetted fast scroll section (the section to scroll to after + // Keeps track of the current and targeted fast scroll section (the section to scroll to after // the initial delay) int mTargetFastScrollPosition = -1; @Thunk String mCurrentFastScrollSection; diff --git a/src/com/android/launcher3/allapps/AlphabeticalAppsList.java b/src/com/android/launcher3/allapps/AlphabeticalAppsList.java index 7127ec44b6..0be2b41904 100644 --- a/src/com/android/launcher3/allapps/AlphabeticalAppsList.java +++ b/src/com/android/launcher3/allapps/AlphabeticalAppsList.java @@ -149,7 +149,7 @@ public class AlphabeticalAppsList { return item; } - public static AdapterItem asSearchDivder(int pos) { + public static AdapterItem asSearchDivider(int pos) { AdapterItem item = new AdapterItem(); item.viewType = AllAppsGridAdapter.VIEW_TYPE_SEARCH_DIVIDER; item.position = pos; @@ -429,7 +429,7 @@ public class AlphabeticalAppsList { } // Add the search divider - mAdapterItems.add(AdapterItem.asSearchDivder(position++)); + mAdapterItems.add(AdapterItem.asSearchDivider(position++)); // Process the predicted app components mPredictedApps.clear(); diff --git a/src/com/android/launcher3/allapps/VerticalPullDetector.java b/src/com/android/launcher3/allapps/VerticalPullDetector.java index ab2b6edd5a..96e1299cf0 100644 --- a/src/com/android/launcher3/allapps/VerticalPullDetector.java +++ b/src/com/android/launcher3/allapps/VerticalPullDetector.java @@ -230,7 +230,7 @@ public class VerticalPullDetector { private void reportDragEnd() { if (DBG) { - Log.d(TAG, String.format("onScrolEnd disp=%.1f, velocity=%.1f", + Log.d(TAG, String.format("onScrollEnd disp=%.1f, velocity=%.1f", mDisplacementY, mVelocity)); } mListener.onDragEnd(mVelocity, Math.abs(mVelocity) > RELEASE_VELOCITY_PX_MS); diff --git a/src/com/android/launcher3/compat/PackageInstallerCompatVL.java b/src/com/android/launcher3/compat/PackageInstallerCompatVL.java index 4aa667ed09..948471c5e8 100644 --- a/src/com/android/launcher3/compat/PackageInstallerCompatVL.java +++ b/src/com/android/launcher3/compat/PackageInstallerCompatVL.java @@ -54,7 +54,7 @@ public class PackageInstallerCompatVL extends PackageInstallerCompat { HashMap activePackages = new HashMap<>(); UserHandleCompat user = UserHandleCompat.myUserHandle(); for (SessionInfo info : mInstaller.getAllSessions()) { - addSessionInfoToCahce(info, user); + addSessionInfoToCache(info, user); if (info.getAppPackageName() != null) { activePackages.put(info.getAppPackageName(), (int) (info.getProgress() * 100)); mActiveSessions.put(info.getSessionId(), info.getAppPackageName()); @@ -63,7 +63,7 @@ public class PackageInstallerCompatVL extends PackageInstallerCompat { return activePackages; } - @Thunk void addSessionInfoToCahce(SessionInfo info, UserHandleCompat user) { + @Thunk void addSessionInfoToCache(SessionInfo info, UserHandleCompat user) { String packageName = info.getAppPackageName(); if (packageName != null) { mCache.cachePackageInstallInfo(packageName, user, info.getAppIcon(), @@ -124,7 +124,7 @@ public class PackageInstallerCompatVL extends PackageInstallerCompat { private void pushSessionDisplayToLauncher(int sessionId) { SessionInfo session = mInstaller.getSessionInfo(sessionId); if (session != null && session.getAppPackageName() != null) { - addSessionInfoToCahce(session, UserHandleCompat.myUserHandle()); + addSessionInfoToCache(session, UserHandleCompat.myUserHandle()); LauncherAppState app = LauncherAppState.getInstanceNoCreate(); if (app != null) { diff --git a/src/com/android/launcher3/dragndrop/DragController.java b/src/com/android/launcher3/dragndrop/DragController.java index 19a47e8738..e11bfc682c 100644 --- a/src/com/android/launcher3/dragndrop/DragController.java +++ b/src/com/android/launcher3/dragndrop/DragController.java @@ -775,7 +775,7 @@ public class DragController implements DragDriver.EventListener, TouchController dropCoordinates[0] = x; dropCoordinates[1] = y; - mLauncher.getDragLayer().mapCoordInSelfToDescendent((View) target, dropCoordinates); + mLauncher.getDragLayer().mapCoordInSelfToDescendant((View) target, dropCoordinates); return target; } @@ -783,7 +783,7 @@ public class DragController implements DragDriver.EventListener, TouchController return null; } - public void setDragScoller(DragScroller scroller) { + public void setDragScroller(DragScroller scroller) { mDragScroller = scroller; } @@ -792,7 +792,7 @@ public class DragController implements DragDriver.EventListener, TouchController } /** - * Sets the drag listner which will be notified when a drag starts or ends. + * Sets the drag listener which will be notified when a drag starts or ends. */ public void addDragListener(DragListener l) { mListeners.add(l); diff --git a/src/com/android/launcher3/dragndrop/DragLayer.java b/src/com/android/launcher3/dragndrop/DragLayer.java index 15ee4118d5..ef9c9652d4 100644 --- a/src/com/android/launcher3/dragndrop/DragLayer.java +++ b/src/com/android/launcher3/dragndrop/DragLayer.java @@ -499,7 +499,7 @@ public class DragLayer extends InsettableFrameLayout { /** * Inverse of {@link #getDescendantCoordRelativeToSelf(View, int[])}. */ - public float mapCoordInSelfToDescendent(View descendant, int[] coord) { + public float mapCoordInSelfToDescendant(View descendant, int[] coord) { return Utilities.mapCoordInSelfToDescendent(descendant, this, coord); } diff --git a/src/com/android/launcher3/folder/Folder.java b/src/com/android/launcher3/folder/Folder.java index 4fe351368c..b85d97382a 100644 --- a/src/com/android/launcher3/folder/Folder.java +++ b/src/com/android/launcher3/folder/Folder.java @@ -71,7 +71,7 @@ import com.android.launcher3.ShortcutInfo; import com.android.launcher3.UninstallDropTarget.DropTargetSource; import com.android.launcher3.Utilities; import com.android.launcher3.Workspace.ItemOperator; -import com.android.launcher3.accessibility.AccessibileDragListenerAdapter; +import com.android.launcher3.accessibility.AccessibleDragListenerAdapter; import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.dragndrop.DragController; import com.android.launcher3.dragndrop.DragController.DragListener; @@ -297,7 +297,7 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList mDragController.addDragListener(this); if (options.isAccessibleDrag) { - mDragController.addDragListener(new AccessibileDragListenerAdapter( + mDragController.addDragListener(new AccessibleDragListenerAdapter( mContent, CellLayout.FOLDER_ACCESSIBILITY_DRAG) { @Override diff --git a/src/com/android/launcher3/folder/FolderPagedView.java b/src/com/android/launcher3/folder/FolderPagedView.java index c6b06717f5..170216340a 100644 --- a/src/com/android/launcher3/folder/FolderPagedView.java +++ b/src/com/android/launcher3/folder/FolderPagedView.java @@ -679,7 +679,7 @@ public class FolderPagedView extends PagedView { } @Override - protected void getEdgeVerticalPostion(int[] pos) { + protected void getEdgeVerticalPosition(int[] pos) { pos[0] = 0; pos[1] = getViewportHeight(); } diff --git a/src/com/android/launcher3/graphics/DragPreviewProvider.java b/src/com/android/launcher3/graphics/DragPreviewProvider.java index 7ad1e3a430..a7d4c63a19 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 f90b2d72e3..14109172b2 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; } diff --git a/src/com/android/launcher3/logging/UserEventDispatcher.java b/src/com/android/launcher3/logging/UserEventDispatcher.java index 2ad8847731..8c702bf7c2 100644 --- a/src/com/android/launcher3/logging/UserEventDispatcher.java +++ b/src/com/android/launcher3/logging/UserEventDispatcher.java @@ -37,7 +37,7 @@ import java.util.Locale; /** * Manages the creation of {@link LauncherEvent}. - * To debug this class, execute following command before sideloading a new apk. + * To debug this class, execute following command before side loading a new apk. * * $ adb shell setprop log.tag.UserEvent VERBOSE */ diff --git a/src/com/android/launcher3/provider/LauncherDbUtils.java b/src/com/android/launcher3/provider/LauncherDbUtils.java index faa5fad12b..2f8241907f 100644 --- a/src/com/android/launcher3/provider/LauncherDbUtils.java +++ b/src/com/android/launcher3/provider/LauncherDbUtils.java @@ -56,7 +56,7 @@ public class LauncherDbUtils { if (screenIds.get(0) != 0) { // First screen is not 0, we need to rename screens if (screenIds.indexOf(0L) > -1) { - // There is already a screen 0. First rename it to a differen screen. + // There is already a screen 0. First rename it to a different screen. long newScreenId = 1; while (screenIds.indexOf(newScreenId) > -1) newScreenId++; renameScreen(db, 0, newScreenId); diff --git a/src/com/android/launcher3/widget/WidgetsContainerView.java b/src/com/android/launcher3/widget/WidgetsContainerView.java index 8b72258218..07c8e386ef 100644 --- a/src/com/android/launcher3/widget/WidgetsContainerView.java +++ b/src/com/android/launcher3/widget/WidgetsContainerView.java @@ -139,7 +139,7 @@ public class WidgetsContainerView extends BaseContainerView @Override public boolean onLongClick(View v) { if (LOGD) { - Log.d(TAG, String.format("onLonglick [v=%s]", v)); + Log.d(TAG, String.format("onLongClick [v=%s]", v)); } // Return early if this is not initiated from a touch if (!v.isInTouchMode()) return false;