コード例 #1
0
  private void FullSwipeTrigger() {
    Log.d("FUll Swipe trigger call", "Works**********************" + mDismissAnimationRefCount);
    old_mDownView = mDownView;
    int width;
    if (SwipeType == Single || SwipeType == Dismiss) {
      width = textwidth;
      if (SwipeType == Dismiss) ++mDismissAnimationRefCount;
    } else {
      width = largewidth;
    }
    mDownView
        .animate()
        .translationX(-width)
        .setDuration(300)
        .setListener(
            new AnimatorListenerAdapter() {
              @Override
              public void onAnimationEnd(Animator animation) {
                super.onAnimationEnd(animation);
                moptionsDisplay = true;

                stagged_position = temp_position;
                mDownView_parent_txt1.setOnTouchListener(new touchClass());
                //                        if(SwipeType==Double)
                //                            mDownView_parent_txt2.setOnTouchListener(new
                // touchClass());

              }

              @Override
              public void onAnimationStart(Animator animation) {
                super.onAnimationStart(animation);
              }
            });
  }
コード例 #2
0
ファイル: PhotoTable.java プロジェクト: zst123/p201-packages
 /** Return the other photos to foreground status. */
 public void fadeInBackground(final View photo) {
   if (mBackgroudOptimization) {
     mWaitingToJoinBackground.add(photo);
     mBackground
         .animate()
         .withLayer()
         .setDuration(mPickUpDuration)
         .alpha(1f)
         .withEndAction(
             new Runnable() {
               @Override
               public void run() {
                 resolveBackgroundQueue();
               }
             });
   } else {
     bringChildToFront(mScrim);
     bringChildToFront(photo);
     mScrim
         .animate()
         .withLayer()
         .setDuration(mPickUpDuration)
         .alpha(0f)
         .withEndAction(
             new Runnable() {
               @Override
               public void run() {
                 mScrim.setVisibility(View.GONE);
               }
             });
   }
 }
コード例 #3
0
  @Override
  public void hideOverlay(final boolean closeShortcutWindow) {
    ViewPropertyAnimator animator =
        mOverlay
            .animate()
            .setDuration(AppConstant.Anim.ANIM_DURATION_NORMAL)
            .translationX(mInitialOverlayTranslationX)
            .setInterpolator(new AccelerateInterpolator());
    animator.setListener(
        new Animator.AnimatorListener() {
          @Override
          public void onAnimationStart(Animator animation) {}

          @Override
          public void onAnimationEnd(Animator animation) {
            mGestureOverLay.setVisibility(GONE);
            EventBus.getDefault().post(new EventToKnob(EventToKnob.END_STATE_RIGHT));
            if (closeShortcutWindow) {
              startCloseAnim();
            }
          }

          @Override
          public void onAnimationCancel(Animator animation) {}

          @Override
          public void onAnimationRepeat(Animator animation) {}
        });
    animator.start();
  }
コード例 #4
0
  @Override
  public void showOverlay() {
    if (mCurrentOverlayMode == OverlayMoveMode.BY_GESTURE) {
      mGestureOverLay.setVisibility(VISIBLE);
      ViewPropertyAnimator animator =
          mOverlay
              .animate()
              .setDuration(AppConstant.Anim.ANIM_DURATION_NORMAL)
              .translationX(mTargetOverlayTranslationX)
              .setInterpolator(new DecelerateInterpolator())
              .setListener(
                  new Animator.AnimatorListener() {
                    @Override
                    public void onAnimationStart(Animator animation) {
                      mGestureOverLay.setVisibility(VISIBLE);
                    }

                    @Override
                    public void onAnimationEnd(Animator animation) {
                      EventBus.getDefault().post(new EventToKnob(EventToKnob.END_STATE_LEFT));
                    }

                    @Override
                    public void onAnimationCancel(Animator animation) {}

                    @Override
                    public void onAnimationRepeat(Animator animation) {}
                  });
      animator.start();
    }
  }
コード例 #5
0
  private void updateRenderLocally(boolean renderLocally) {
    if (mRenderLocally == renderLocally) {
      return;
    }

    mRenderLocally = renderLocally;

    final View uiContainer = findViewById(R.id.container);
    final ViewGroup localRenderContainer = (ViewGroup) findViewById(R.id.local_render_container);

    FragmentManager fm = getSupportFragmentManager();
    Fragment localRenderFragment = fm.findFragmentById(R.id.local_render_container);
    if (mRenderLocally) {
      if (localRenderFragment == null) {
        fm.beginTransaction()
            .add(R.id.local_render_container, MuzeiRendererFragment.createInstance(false, false))
            .commit();
      }
      if (localRenderContainer.getAlpha() == 1) {
        localRenderContainer.setAlpha(0);
      }
      localRenderContainer.setVisibility(View.VISIBLE);
      localRenderContainer.animate().alpha(1).setDuration(2000).withEndAction(null);
      uiContainer.setBackgroundColor(0x00000000); // for ripple touch feedback
    } else {
      if (localRenderFragment != null) {
        fm.beginTransaction().remove(localRenderFragment).commit();
      }
      localRenderContainer
          .animate()
          .alpha(0)
          .setDuration(1000)
          .withEndAction(
              new Runnable() {
                @Override
                public void run() {
                  localRenderContainer.setVisibility(View.GONE);
                }
              });
      uiContainer.setBackground(null);
    }
  }
コード例 #6
0
ファイル: PhotoTable.java プロジェクト: zst123/p201-packages
 /** De-emphasize the other photos on the table. */
 public void fadeOutBackground(final View photo) {
   resolveBackgroundQueue();
   if (mBackgroudOptimization) {
     mBackground.animate().withLayer().setDuration(mPickUpDuration).alpha(0f);
   } else {
     mScrim.setAlpha(0f);
     mScrim.setVisibility(View.VISIBLE);
     bringChildToFront(mScrim);
     bringChildToFront(photo);
     mScrim.animate().withLayer().setDuration(mPickUpDuration).alpha(1f);
   }
 }
コード例 #7
0
ファイル: PhotoTable.java プロジェクト: zst123/p201-packages
 /// M: ALPS00439129, after daydream exits, remove delay tasks @{
 public void removeTasks() {
   mFinished = true;
   mStarted = false;
   removeCallbacks(mLauncher);
   removeCallbacks(mFocusReaper);
   removeCallbacks(mSelectionReaper);
   for (int i = 0; i < mLoadOnDeckTasks.length; i++) {
     if (mLoadOnDeckTasks[i] != null
         && mLoadOnDeckTasks[i].getStatus() != AsyncTask.Status.FINISHED) {
       mLoadOnDeckTasks[i].cancel(true);
       mLoadOnDeckTasks[i] = null;
     }
   }
   if (mPhotoLaunchTask != null && mPhotoLaunchTask.getStatus() != AsyncTask.Status.FINISHED) {
     mPhotoLaunchTask.cancel(true);
   }
   for (View view = mOnTable.poll(); view != null; view = mOnTable.poll()) {
     view.setOnTouchListener(null);
     view.animate().cancel();
     recycle(view);
     ((ImageView) view).setImageDrawable(null);
   }
   for (int i = 0; i < mOnDeck.length; i++) {
     if (mOnDeck[i] != null) {
       recycle(mOnDeck[i]);
       ((ImageView) mOnDeck[i]).setImageDrawable(null);
       mOnDeck[i] = null;
     }
   }
   mWaitingToJoinBackground.clear();
   mBackground.animate().cancel();
   mBackground.removeAllViews();
   mStageLeft.animate().cancel();
   mStageLeft.removeAllViews();
   mPhotoSource.clearQueue();
 }