示例#1
0
 @Override
 public void onDragEnd() {
   if (mTrashMode) {
     mTrashMode = false;
     mDragController.setDeleteRegion(null);
     mOutAnimation.setAnimationListener(mAnimationListener);
     startAnimation(mOutAnimation);
     // mHandle.startAnimation(mHandleInAnimation);
     setVisibility(GONE);
   }
 }
示例#2
0
  @Override
  public void onDragStart(DragSource source, Object info, int dragAction) {
    final ItemInfo item = (ItemInfo) info;
    if (item != null) {
      mLauncher.switchScreenMode(true);
      mTrashMode = true;
      createAnimations();

      final int paddingTop =
          ((ViewGroup) mLauncher.getWindow().getDecorView()).getChildAt(0).getPaddingTop();
      final int[] location = mLocation;
      getLocationOnScreen(location);
      mRegion.set(
          location[0],
          location[1] - paddingTop,
          location[0] + mRight - mLeft,
          location[1] + mBottom - mTop - paddingTop);
      mDragController.setDeleteRegion(mRegion);
      mTransition.resetTransition();
      startAnimation(mInAnimation);
      // mHandle.startAnimation(mHandleOutAnimation);
      setVisibility(VISIBLE);
    }
  }