Search in sources :

Example 21 with DragView

use of com.android.launcher3.dragndrop.DragView in project android_packages_apps_Launcher3 by crdroidandroid.

the class FlingAnimation method onAnimationUpdate.

@Override
public void onAnimationUpdate(ValueAnimator animation) {
    float t = animation.getAnimatedFraction();
    if (t > mAnimationTimeFraction) {
        t = 1;
    } else {
        t = t / mAnimationTimeFraction;
    }
    final DragView dragView = (DragView) mDragLayer.getAnimatedView();
    final float time = t * mDuration;
    dragView.setTranslationX(time * mUX + mFrom.left + mAX * time * time / 2);
    dragView.setTranslationY(time * mUY + mFrom.top + mAY * time * time / 2);
    dragView.setAlpha(1f - mAlphaInterpolator.getInterpolation(t));
}
Also used : DragView(com.android.launcher3.dragndrop.DragView)

Aggregations

Point (android.graphics.Point)14 LauncherAppWidgetHostView (com.android.launcher3.widget.LauncherAppWidgetHostView)13 SuppressLint (android.annotation.SuppressLint)12 Rect (android.graphics.Rect)11 View (android.view.View)11 DragView (com.android.launcher3.dragndrop.DragView)8 Paint (android.graphics.Paint)7 CellAndSpan (com.android.launcher3.util.CellAndSpan)5 AppWidgetHostView (android.appwidget.AppWidgetHostView)4 WorkspaceItemInfo (com.android.launcher3.model.data.WorkspaceItemInfo)4 PendingAppWidgetHostView (com.android.launcher3.widget.PendingAppWidgetHostView)4 Drawable (android.graphics.drawable.Drawable)3 PreloadIconDrawable (com.android.launcher3.graphics.PreloadIconDrawable)3 FastBitmapDrawable (com.android.launcher3.icons.FastBitmapDrawable)3 AppWidgetProviderInfo (android.appwidget.AppWidgetProviderInfo)2 Resources (android.content.res.Resources)2 BubbleTextView (com.android.launcher3.BubbleTextView)2 CellLayout (com.android.launcher3.CellLayout)2 Launcher (com.android.launcher3.Launcher)2 Workspace (com.android.launcher3.Workspace)2