diff --git a/src/com/android/launcher3/allapps/AllAppsTransitionController.java b/src/com/android/launcher3/allapps/AllAppsTransitionController.java
index e7108a1..41e8518 100644
--- a/src/com/android/launcher3/allapps/AllAppsTransitionController.java
+++ b/src/com/android/launcher3/allapps/AllAppsTransitionController.java
@@ -25,11 +25,11 @@
  * Handles AllApps view transition.
  * 1) Slides all apps view using direct manipulation
  * 2) When finger is released, animate to either top or bottom accordingly.
- *
+ * <p/>
  * Algorithm:
  * If release velocity > THRES1, snap according to the direction of movement.
  * If release velocity < THRES1, snap according to either top or bottom depending on whether it's
- *     closer to top or closer to the page indicator.
+ * closer to top or closer to the page indicator.
  */
 public class AllAppsTransitionController implements TouchController, VerticalPullDetector.Listener,
         View.OnLayoutChangeListener {
@@ -229,6 +229,7 @@
             }
         }
     }
+
     /**
      * @param start {@code true} if start of new drag.
      */
@@ -309,7 +310,7 @@
     }
 
     private float calcAlphaAllApps(float progress) {
-        return ((mShiftRange - progress)/ mShiftRange);
+        return ((mShiftRange - progress) / mShiftRange);
     }
 
     private void calculateDuration(float velocity, float disp) {
@@ -323,7 +324,7 @@
     }
 
     public void animateToAllApps(AnimatorSet animationOut, long duration, boolean start) {
-        if (animationOut == null){
+        if (animationOut == null) {
             return;
         }
         if (mDetector.isIdleState()) {
@@ -342,10 +343,12 @@
 
         animationOut.addListener(new AnimatorListenerAdapter() {
             boolean canceled = false;
+
             @Override
             public void onAnimationCancel(Animator animation) {
                 canceled = true;
             }
+
             @Override
             public void onAnimationEnd(Animator animation) {
                 if (canceled) {
@@ -355,7 +358,8 @@
                     cleanUpAnimation();
                     mDetector.finishedScrolling();
                 }
-            }});
+            }
+        });
         mCurrentAnimation = animationOut;
         if (start) {
             mCurrentAnimation.start();
@@ -363,10 +367,10 @@
     }
 
     public void animateToWorkspace(AnimatorSet animationOut, long duration, boolean start) {
-        if (animationOut == null){
+        if (animationOut == null) {
             return;
         }
-        if(mDetector.isIdleState()) {
+        if (mDetector.isIdleState()) {
             preparePull(true);
             mAnimationDuration = duration;
             mShiftStart = mAppsView.getTranslationY();
@@ -381,23 +385,25 @@
         animationOut.play(driftAndAlpha);
 
         animationOut.addListener(new AnimatorListenerAdapter() {
-             boolean canceled = false;
-             @Override
-             public void onAnimationCancel(Animator animation) {
-                 canceled = true;
-                 setProgress(mShiftCurrent);
-             }
+            boolean canceled = false;
 
-             @Override
-             public void onAnimationEnd(Animator animation) {
-                 if (canceled) {
-                     return;
-                 } else {
-                     finishPullDown();
-                     cleanUpAnimation();
-                     mDetector.finishedScrolling();
-                 }
-             }});
+            @Override
+            public void onAnimationCancel(Animator animation) {
+                canceled = true;
+                setProgress(mShiftCurrent);
+            }
+
+            @Override
+            public void onAnimationEnd(Animator animation) {
+                if (canceled) {
+                    return;
+                } else {
+                    finishPullDown();
+                    cleanUpAnimation();
+                    mDetector.finishedScrolling();
+                }
+            }
+        });
         mCurrentAnimation = animationOut;
         if (start) {
             mCurrentAnimation.start();
@@ -438,7 +444,7 @@
 
     @Override
     public void onLayoutChange(View v, int left, int top, int right, int bottom,
-            int oldLeft, int oldTop, int oldRight, int oldBottom) {
+                               int oldLeft, int oldTop, int oldRight, int oldBottom) {
         float prevShiftRatio = mShiftCurrent / mShiftRange;
         if (!mLauncher.getDeviceProfile().isVerticalBarLayout()) {
             mShiftRange = top;
diff --git a/src/com/android/launcher3/allapps/VerticalPullDetector.java b/src/com/android/launcher3/allapps/VerticalPullDetector.java
index b058ad2..0e8ba7f 100644
--- a/src/com/android/launcher3/allapps/VerticalPullDetector.java
+++ b/src/com/android/launcher3/allapps/VerticalPullDetector.java
@@ -8,7 +8,7 @@
 /**
  * One dimensional scroll gesture detector for all apps container pull up interaction.
  * Client (e.g., AllAppsTransitionController) of this class can register a listener.
- *
+ * <p/>
  * Features that this gesture detector can support.
  */
 public class VerticalPullDetector {
@@ -23,7 +23,6 @@
     public static final int DIRECTION_DOWN = 1 << 1;
     public static final int DIRECTION_BOTH = DIRECTION_DOWN | DIRECTION_UP;
 
-
     /**
      * The minimum release velocity in pixels per millisecond that triggers fling..
      */
@@ -42,7 +41,9 @@
         IDLE,
         DRAGGING,      // onDragStart, onDrag
         SETTLING       // onDragEnd
-    };
+    }
+
+    ;
 
     //------------------- ScrollState transition diagram -----------------------------------
     //
@@ -108,9 +109,11 @@
         mListener = l;
     }
 
-    interface Listener{
+    interface Listener {
         void onDragStart(boolean start);
+
         boolean onDrag(float displacement, float velocity);
+
         void onDragEnd(float velocity, boolean fling);
     }
 
@@ -137,7 +140,7 @@
         }
         // Check if the client is interested in scroll in current direction.
         if (((mScrollConditions & DIRECTION_DOWN) > 0 && mDisplacementY > 0) ||
-            ((mScrollConditions & DIRECTION_UP) > 0 && mDisplacementY < 0)) {
+                ((mScrollConditions & DIRECTION_UP) > 0 && mDisplacementY < 0)) {
             return true;
         }
         return false;
@@ -234,6 +237,7 @@
         mListener.onDragEnd(mVelocity, Math.abs(mVelocity) > RELEASE_VELOCITY_PX_MS);
 
     }
+
     /**
      * Computes the damped velocity using the two motion events and the previous velocity.
      */
