Fix jumps in the beginning of animations

If the first draw frame of an animation is
expensive, which it often is, it causes a big
jump. Added a helper class which automatically
adjusts the animation start time if the first
frame is more than 16ms.

Change-Id: I100edbc41c2abe930a32d6bcf0a782ea9735f7f9
diff --git a/src/com/android/launcher2/Folder.java b/src/com/android/launcher2/Folder.java
index 5feac2f..5520e23 100644
--- a/src/com/android/launcher2/Folder.java
+++ b/src/com/android/launcher2/Folder.java
@@ -444,15 +444,7 @@
         });
         oa.setDuration(mExpandDuration);
         setLayerType(LAYER_TYPE_HARDWARE, null);
-        buildLayer();
-        post(new Runnable() {
-            public void run() {
-                // Check if the animator changed in the meantime
-                if (oa != mOpenCloseAnimator)
-                    return;
-                oa.start();
-            }
-        });
+        oa.start();
     }
 
     private void sendCustomAccessibilityEvent(int type, String text) {
@@ -497,15 +489,7 @@
         });
         oa.setDuration(mExpandDuration);
         setLayerType(LAYER_TYPE_HARDWARE, null);
-        buildLayer();
-        post(new Runnable() {
-            public void run() {
-                // Check if the animator changed in the meantime
-                if (oa != mOpenCloseAnimator)
-                    return;
-                oa.start();
-            }
-        });
+        oa.start();
     }
 
     void notifyDataSetChanged() {