android.view.ViewPropertyAnimator.setStartDelay()方法的使用及代码示例

x33g5p2x  于2022-01-31 转载在 其他  
字(10.7k)|赞(0)|评价(0)|浏览(171)

本文整理了Java中android.view.ViewPropertyAnimator.setStartDelay()方法的一些代码示例,展示了ViewPropertyAnimator.setStartDelay()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ViewPropertyAnimator.setStartDelay()方法的具体详情如下:
包路径:android.view.ViewPropertyAnimator
类名称:ViewPropertyAnimator
方法名:setStartDelay

ViewPropertyAnimator.setStartDelay介绍

暂无

代码示例

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public ViewPropertyAnimator setStartDelay(long startDelay) {
  android.view.ViewPropertyAnimator n = mNative.get();
  if (n != null) {
    n.setStartDelay(startDelay);
  }
  return this;
}

代码示例来源:origin: frogermcs/InstaMaterial

private void animateUserProfileHeader() {
      vUserProfileRoot.setTranslationY(-vUserProfileRoot.getHeight());
      ivUserProfilePhoto.setTranslationY(-ivUserProfilePhoto.getHeight());
      vUserDetails.setTranslationY(-vUserDetails.getHeight());
      vUserStats.setAlpha(0);

      vUserProfileRoot.animate().translationY(0).setDuration(300).setInterpolator(INTERPOLATOR);
      ivUserProfilePhoto.animate().translationY(0).setDuration(300).setStartDelay(100).setInterpolator(INTERPOLATOR);
      vUserDetails.animate().translationY(0).setDuration(300).setStartDelay(200).setInterpolator(INTERPOLATOR);
      vUserStats.animate().alpha(1).setDuration(200).setStartDelay(400).setInterpolator(INTERPOLATOR).start();
  }
}

代码示例来源:origin: frogermcs/InstaMaterial

private void runEnterAnimation(View view, int position) {
  if (animationsLocked) return;
  if (position > lastAnimatedPosition) {
    lastAnimatedPosition = position;
    view.setTranslationY(100);
    view.setAlpha(0.f);
    view.animate()
        .translationY(0).alpha(1.f)
        .setStartDelay(delayEnterAnimation ? 20 * (position) : 0)
        .setInterpolator(new DecelerateInterpolator(2.f))
        .setDuration(300)
        .setListener(new AnimatorListenerAdapter() {
          @Override
          public void onAnimationEnd(Animator animation) {
            animationsLocked = true;
          }
        })
        .start();
  }
}

代码示例来源:origin: TeamNewPipe/NewPipe

private static void animateAlpha(final View view, boolean enterOrExit, long duration, long delay, final Runnable execOnEnd) {
  if (enterOrExit) {
    view.animate().setInterpolator(new FastOutSlowInInterpolator()).alpha(1f)
        .setDuration(duration).setStartDelay(delay).setListener(new AnimatorListenerAdapter() {
      @Override
      public void onAnimationEnd(Animator animation) {
        if (execOnEnd != null) execOnEnd.run();
      }
    }).start();
  } else {
    view.animate().setInterpolator(new FastOutSlowInInterpolator()).alpha(0f)
        .setDuration(duration).setStartDelay(delay).setListener(new AnimatorListenerAdapter() {
      @Override
      public void onAnimationEnd(Animator animation) {
        view.setVisibility(View.GONE);
        if (execOnEnd != null) execOnEnd.run();
      }
    }).start();
  }
}

代码示例来源:origin: frogermcs/InstaMaterial

@Override
  public void onLoadingFinished() {
    vSendingProgress.animate().scaleY(0).scaleX(0).setDuration(200).setStartDelay(100);
    vProgressBg.animate().alpha(0.f).setDuration(200).setStartDelay(100)
        .setListener(new AnimatorListenerAdapter() {
          @Override
          public void onAnimationEnd(Animator animation) {
            vSendingProgress.setScaleX(1);
            vSendingProgress.setScaleY(1);
            vProgressBg.setAlpha(1);
            if (onLoadingFinishedListener != null) {
              onLoadingFinishedListener.onLoadingFinished();
              onLoadingFinishedListener = null;
            }
          }
        }).start();
  }
});

代码示例来源:origin: seven332/EhViewer

private void hideActionFab() {
  if (null != mFabLayout && STATE_NORMAL == mState && mShowActionFab) {
    mShowActionFab = false;
    View fab = mFabLayout.getPrimaryFab();
    fab.animate().scaleX(0.0f).scaleY(0.0f).setListener(mActionFabAnimatorListener)
        .setDuration(ANIMATE_TIME).setStartDelay(0L)
        .setInterpolator(AnimationUtils.SLOW_FAST_INTERPOLATOR).start();
  }
}

代码示例来源:origin: TeamNewPipe/NewPipe

private static void animateLightSlideAndAlpha(final View view, boolean enterOrExit, long duration, long delay, final Runnable execOnEnd) {
    if (enterOrExit) {
      view.setTranslationY(-view.getHeight() / 2);
      view.setAlpha(0f);
      view.animate().setInterpolator(new FastOutSlowInInterpolator()).alpha(1f).translationY(0)
          .setDuration(duration).setStartDelay(delay).setListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
          if (execOnEnd != null) execOnEnd.run();
        }
      }).start();
    } else {
      view.animate().setInterpolator(new FastOutSlowInInterpolator()).alpha(0f).translationY(-view.getHeight() / 2)
          .setDuration(duration).setStartDelay(delay).setListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
          view.setVisibility(View.GONE);
          if (execOnEnd != null) execOnEnd.run();
        }
      }).start();
    }
  }
}

代码示例来源:origin: TeamNewPipe/NewPipe

private static void animateSlideAndAlpha(final View view, boolean enterOrExit, long duration, long delay, final Runnable execOnEnd) {
  if (enterOrExit) {
    view.setTranslationY(-view.getHeight());
    view.setAlpha(0f);
    view.animate().setInterpolator(new FastOutSlowInInterpolator()).alpha(1f).translationY(0)
        .setDuration(duration).setStartDelay(delay).setListener(new AnimatorListenerAdapter() {
      @Override
      public void onAnimationEnd(Animator animation) {
        if (execOnEnd != null) execOnEnd.run();
      }
    }).start();
  } else {
    view.animate().setInterpolator(new FastOutSlowInInterpolator()).alpha(0f).translationY(-view.getHeight())
        .setDuration(duration).setStartDelay(delay).setListener(new AnimatorListenerAdapter() {
      @Override
      public void onAnimationEnd(Animator animation) {
        view.setVisibility(View.GONE);
        if (execOnEnd != null) execOnEnd.run();
      }
    }).start();
  }
}

代码示例来源:origin: xinghongfei/LookLook

private void popAnim(View v, int startDelay, int duration) {
  if (v != null) {
    v.setAlpha(0f);
    v.setScaleX(0f);
    v.setScaleY(0f);
    v.animate()
        .alpha(1f)
        .scaleX(1f)
        .scaleY(1f)
        .setStartDelay(startDelay)
        .setDuration(duration)
        .setInterpolator(AnimationUtils.loadInterpolator(this,
            android.R.interpolator.overshoot)).start();
  }
}

代码示例来源:origin: frogermcs/InstaMaterial

private void startContentAnimation() {
  fabCreate.animate()
      .translationY(0)
      .setInterpolator(new OvershootInterpolator(1.f))
      .setStartDelay(300)
      .setDuration(ANIM_DURATION_FAB)
      .start();
  feedAdapter.updateItems(true);
}

代码示例来源:origin: TeamNewPipe/NewPipe

private static void animateLightScaleAndAlpha(final View view, boolean enterOrExit, long duration, long delay, final Runnable execOnEnd) {
  if (enterOrExit) {
    view.setAlpha(.5f);
    view.setScaleX(.95f);
    view.setScaleY(.95f);
    view.animate().setInterpolator(new FastOutSlowInInterpolator()).alpha(1f).scaleX(1f).scaleY(1f)
        .setDuration(duration).setStartDelay(delay).setListener(new AnimatorListenerAdapter() {
      @Override
      public void onAnimationEnd(Animator animation) {
        if (execOnEnd != null) execOnEnd.run();
      }
    }).start();
  } else {
    view.setAlpha(1f);
    view.setScaleX(1f);
    view.setScaleY(1f);
    view.animate().setInterpolator(new FastOutSlowInInterpolator()).alpha(0f).scaleX(.95f).scaleY(.95f)
        .setDuration(duration).setStartDelay(delay).setListener(new AnimatorListenerAdapter() {
      @Override
      public void onAnimationEnd(Animator animation) {
        view.setVisibility(View.GONE);
        if (execOnEnd != null) execOnEnd.run();
      }
    }).start();
  }
}

代码示例来源:origin: frogermcs/InstaMaterial

@Override
public void onSuccess() {
  ivPhoto.animate()
      .scaleX(1.f).scaleY(1.f)
      .setInterpolator(new OvershootInterpolator())
      .setDuration(400)
      .setStartDelay(200)
      .start();
}

代码示例来源:origin: TeamNewPipe/NewPipe

private static void animateScaleAndAlpha(final View view, boolean enterOrExit, long duration, long delay, final Runnable execOnEnd) {
  if (enterOrExit) {
    view.setScaleX(.8f);
    view.setScaleY(.8f);
    view.animate().setInterpolator(new FastOutSlowInInterpolator()).alpha(1f).scaleX(1f).scaleY(1f)
        .setDuration(duration).setStartDelay(delay).setListener(new AnimatorListenerAdapter() {
      @Override
      public void onAnimationEnd(Animator animation) {
        if (execOnEnd != null) execOnEnd.run();
      }
    }).start();
  } else {
    view.setScaleX(1f);
    view.setScaleY(1f);
    view.animate().setInterpolator(new FastOutSlowInInterpolator()).alpha(0f).scaleX(.8f).scaleY(.8f)
        .setDuration(duration).setStartDelay(delay).setListener(new AnimatorListenerAdapter() {
      @Override
      public void onAnimationEnd(Animator animation) {
        view.setVisibility(View.GONE);
        if (execOnEnd != null) execOnEnd.run();
      }
    }).start();
  }
}

代码示例来源:origin: seven332/EhViewer

private void showActionFab() {
  if (null != mFabLayout && STATE_NORMAL == mState && !mShowActionFab) {
    mShowActionFab = true;
    View fab = mFabLayout.getPrimaryFab();
    fab.setVisibility(View.VISIBLE);
    fab.setRotation(-45.0f);
    fab.animate().scaleX(1.0f).scaleY(1.0f).rotation(0.0f).setListener(null)
        .setDuration(ANIMATE_TIME).setStartDelay(0L)
        .setInterpolator(AnimationUtils.FAST_SLOW_INTERPOLATOR).start();
  }
}

代码示例来源:origin: frogermcs/InstaMaterial

private void animateUserProfileOptions() {
  tlUserProfileTabs.setTranslationY(-tlUserProfileTabs.getHeight());
  tlUserProfileTabs.animate().translationY(0).setDuration(300).setStartDelay(USER_OPTIONS_ANIMATION_DELAY).setInterpolator(INTERPOLATOR);
}

代码示例来源:origin: nickbutcher/plaid

private void animateToolbar() {
  // this is gross but toolbar doesn't expose it's children to animate them :(
  View t = toolbar.getChildAt(0);
  if (t != null && t instanceof TextView) {
    TextView title = (TextView) t;
    // fade in and space out the title.  Animating the letterSpacing performs horribly so
    // fake it by setting the desired letterSpacing then animating the scaleX ¯\_(ツ)_/¯
    title.setAlpha(0f);
    title.setScaleX(0.8f);
    title.animate()
        .alpha(1f)
        .scaleX(1f)
        .setStartDelay(300)
        .setDuration(900)
        .setInterpolator(AnimUtils.getFastOutSlowInInterpolator(this));
  }
}

代码示例来源:origin: nickbutcher/plaid

.translationY(0f)
    .setDuration(duration)
    .setStartDelay(duration)
    .setInterpolator(interpolator);
offset *= 1.8f;

代码示例来源:origin: frogermcs/InstaMaterial

private void performDismissAnimation() {
  contextMenuView.setPivotX(contextMenuView.getWidth() / 2);
  contextMenuView.setPivotY(contextMenuView.getHeight());
  contextMenuView.animate()
      .scaleX(0.1f).scaleY(0.1f)
      .setDuration(150)
      .setInterpolator(new AccelerateInterpolator())
      .setStartDelay(100)
      .setListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
          if (contextMenuView != null) {
            contextMenuView.dismiss();
          }
          isContextMenuDismissing = false;
        }
      });
}

代码示例来源:origin: frogermcs/InstaMaterial

private void animatePhoto(PhotoViewHolder viewHolder) {
  if (!lockedAnimations) {
    if (lastAnimatedItem == viewHolder.getPosition()) {
      setLockedAnimations(true);
    }
    long animationDelay = PHOTO_ANIMATION_DELAY + viewHolder.getPosition() * 30;
    viewHolder.flRoot.setScaleY(0);
    viewHolder.flRoot.setScaleX(0);
    viewHolder.flRoot.animate()
        .scaleY(1)
        .scaleX(1)
        .setDuration(200)
        .setInterpolator(INTERPOLATOR)
        .setStartDelay(animationDelay)
        .start();
  }
}

代码示例来源:origin: frogermcs/InstaMaterial

private void startIntroAnimation() {
  fabCreate.setTranslationY(2 * getResources().getDimensionPixelOffset(R.dimen.btn_fab_size));
  int actionbarSize = Utils.dpToPx(56);
  getToolbar().setTranslationY(-actionbarSize);
  getIvLogo().setTranslationY(-actionbarSize);
  getInboxMenuItem().getActionView().setTranslationY(-actionbarSize);
  getToolbar().animate()
      .translationY(0)
      .setDuration(ANIM_DURATION_TOOLBAR)
      .setStartDelay(300);
  getIvLogo().animate()
      .translationY(0)
      .setDuration(ANIM_DURATION_TOOLBAR)
      .setStartDelay(400);
  getInboxMenuItem().getActionView().animate()
      .translationY(0)
      .setDuration(ANIM_DURATION_TOOLBAR)
      .setStartDelay(500)
      .setListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
          startContentAnimation();
        }
      })
      .start();
}

相关文章