// Path: app/src/main/java/com/phonemetra/turbo/launcher/DropTarget.java
// class DragObject {
// 	public int x = -1;
// 	public int y = -1;
// 
// 	/** X offset from the upper-left corner of the cell to where we touched. */
// 	public int xOffset = -1;
// 
// 	/** Y offset from the upper-left corner of the cell to where we touched. */
// 	public int yOffset = -1;
// 
// 	/**
// 	 * This indicates whether a drag is in final stages, either drop or
// 	 * cancel. It differentiates onDragExit, since this is called when the
// 	 * drag is ending, above the current drag target, or when the drag moves
// 	 * off the current drag object.
// 	 */
// 	public boolean dragComplete = false;
// 
// 	/** The view that moves around while you drag. */
// 	public DragView dragView = null;
// 
// 	/** The data associated with the object being dragged */
// 	public Object dragInfo = null;
// 
// 	/** Where the drag originated */
// 	public DragSource dragSource = null;
// 
// 	/** Post drag animation runnable */
// 	public Runnable postAnimationRunnable = null;
// 
// 	/** Indicates that the drag operation was cancelled */
// 	public boolean cancelled = false;
// 
// 	/**
// 	 * Defers removing the DragView from the DragLayer until after the drop
// 	 * animation.
// 	 */
// 	public boolean deferDragViewCleanupPostAnimation = true;
// 
// 	public DragObject() {
// 	}
// }
// 
// Path: app/src/main/java/com/phonemetra/turbo/launcher/FolderInfo.java
// interface FolderListener {
//     public void onAdd(ShortcutInfo item);
//     public void onRemove(ShortcutInfo item);
//     public void onTitleChanged(CharSequence title);
//     public void onItemsChanged();
// }


import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ValueAnimator;
import android.animation.ValueAnimator.AnimatorUpdateListener;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.os.Looper;
import android.os.Parcelable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.DecelerateInterpolator;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;
import com.phonemetra.turbo.launcher.DropTarget.DragObject;
import com.phonemetra.turbo.launcher.FolderInfo.FolderListener;
import com.phonemetra.turbo.launcher.R;
import java.util.ArrayList;
        // position as the first item in the preview
        animateFirstItem(animateDrawable, INITIAL_ITEM_ANIMATION_DURATION, false, null);
        addItem(destInfo);

        // This will animate the dragView (srcView) into the new folder
        onDrop(srcInfo, srcView, dstRect, scaleRelativeToDragLayer, 1, postAnimationRunnable, null);
    }

    public void performDestroyAnimation(final View finalView, Runnable onCompleteRunnable) {
        Drawable animateDrawable = ((TextView) finalView).getCompoundDrawables()[1];
        computePreviewDrawingParams(animateDrawable.getIntrinsicWidth(), 
                finalView.getMeasuredWidth());

        // This will animate the first item from it's position as an icon into its
        // position as the first item in the preview
        animateFirstItem(animateDrawable, FINAL_ITEM_ANIMATION_DURATION, true,
                onCompleteRunnable);
    }

    public void onDragExit(Object dragInfo) {
        onDragExit();
    }

    public void onDragExit() {
        mFolderRingAnimator.animateToNaturalState();
        mOpenAlarm.cancelAlarm();
    }

    private void onDrop(final ShortcutInfo item, DragView animateView, Rect finalRect,
            float scaleRelativeToDragLayer, int index, Runnable postAnimationRunnable,
// Path: app/src/main/java/com/phonemetra/turbo/launcher/DropTarget.java
// class DragObject {
// 	public int x = -1;
// 	public int y = -1;
// 
// 	/** X offset from the upper-left corner of the cell to where we touched. */
// 	public int xOffset = -1;
// 
// 	/** Y offset from the upper-left corner of the cell to where we touched. */
// 	public int yOffset = -1;
// 
// 	/**
// 	 * This indicates whether a drag is in final stages, either drop or
// 	 * cancel. It differentiates onDragExit, since this is called when the
// 	 * drag is ending, above the current drag target, or when the drag moves
// 	 * off the current drag object.
// 	 */
// 	public boolean dragComplete = false;
// 
// 	/** The view that moves around while you drag. */
// 	public DragView dragView = null;
// 
// 	/** The data associated with the object being dragged */
// 	public Object dragInfo = null;
// 
// 	/** Where the drag originated */
// 	public DragSource dragSource = null;
// 
// 	/** Post drag animation runnable */
// 	public Runnable postAnimationRunnable = null;
// 
// 	/** Indicates that the drag operation was cancelled */
// 	public boolean cancelled = false;
// 
// 	/**
// 	 * Defers removing the DragView from the DragLayer until after the drop
// 	 * animation.
// 	 */
// 	public boolean deferDragViewCleanupPostAnimation = true;
// 
// 	public DragObject() {
// 	}
// }
// 
// Path: app/src/main/java/com/phonemetra/turbo/launcher/FolderInfo.java
// interface FolderListener {
//     public void onAdd(ShortcutInfo item);
//     public void onRemove(ShortcutInfo item);
//     public void onTitleChanged(CharSequence title);
//     public void onItemsChanged();
// }


// Path: app/src/main/java/com/phonemetra/turbo/launcher/FolderIcon.java
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ValueAnimator;
import android.animation.ValueAnimator.AnimatorUpdateListener;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.os.Looper;
import android.os.Parcelable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.DecelerateInterpolator;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;
import com.phonemetra.turbo.launcher.DropTarget.DragObject;
import com.phonemetra.turbo.launcher.FolderInfo.FolderListener;
import com.phonemetra.turbo.launcher.R;
import java.util.ArrayList;

        // position as the first item in the preview
        animateFirstItem(animateDrawable, INITIAL_ITEM_ANIMATION_DURATION, false, null);
        addItem(destInfo);

        // This will animate the dragView (srcView) into the new folder
        onDrop(srcInfo, srcView, dstRect, scaleRelativeToDragLayer, 1, postAnimationRunnable, null);
    }

    public void performDestroyAnimation(final View finalView, Runnable onCompleteRunnable) {
        Drawable animateDrawable = ((TextView) finalView).getCompoundDrawables()[1];
        computePreviewDrawingParams(animateDrawable.getIntrinsicWidth(), 
                finalView.getMeasuredWidth());

        // This will animate the first item from it's position as an icon into its
        // position as the first item in the preview
        animateFirstItem(animateDrawable, FINAL_ITEM_ANIMATION_DURATION, true,
                onCompleteRunnable);
    }

    public void onDragExit(Object dragInfo) {
        onDragExit();
    }

    public void onDragExit() {
        mFolderRingAnimator.animateToNaturalState();
        mOpenAlarm.cancelAlarm();
    }

    private void onDrop(final ShortcutInfo item, DragView animateView, Rect finalRect,
            float scaleRelativeToDragLayer, int index, Runnable postAnimationRunnable,
            DragObject d) {