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

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

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

ViewPropertyAnimator.withStartAction介绍

暂无

代码示例

代码示例来源:origin: kingargyle/adt-leanback-support

public static void withStartAction(View view, Runnable runnable) {
  view.animate().withStartAction(runnable);
}

代码示例来源:origin: blundell/QuickSand

@Override
  public void addListener(final StartListener listener) {
    animator.withStartAction(
        new Runnable() {
          @Override
          public void run() {
            listener.onStart(AnimationAct.this);
          }
        })
        .withEndAction(
            new Runnable() {
              @Override
              public void run() {
                listener.onFinish(AnimationAct.this);
              }
            });
  }
}

代码示例来源:origin: rallat/smokeAndMirrors

private void transitionFromMediumToSmall() {
  Log.d("Scale", "transitionFromMediumToSmall: ");
  smallRecyclerView.animate().scaleX(1f).scaleY(1f).alpha(1f).withStartAction(new Runnable() {
    @Override
    public void run() {
      mediumRecyclerView.animate().scaleX(0.8f).scaleY(0.8f).alpha(0).start();
    }
  }).withEndAction(new Runnable() {
    @Override
    public void run() {
      mediumRecyclerView.setVisibility(View.INVISIBLE);
    }
  }).start();
}

代码示例来源:origin: rallat/smokeAndMirrors

private void transitionFromSmallToMedium() {
  Log.d("Scale", "transitionFromSmallToMedium: ");
  mediumRecyclerView.animate().scaleX(1f).scaleY(1f).alpha(1f).withStartAction(new Runnable() {
    @Override
    public void run() {
      smallRecyclerView.animate().scaleY(SMALL_MAX_SCALE_FACTOR).scaleX(SMALL_MAX_SCALE_FACTOR).alpha(0f)
          .start();
    }
  }).withEndAction(new Runnable() {
    @Override
    public void run() {
      smallRecyclerView.setVisibility(View.INVISIBLE);
    }
  }).start();
}

代码示例来源:origin: quaap/LaunchTime

private void initializeMenuline(final ViewGroup item) {
  item.setBackgroundColor(mItemBGColor);
  if (mStyle.isRoundedTabs()) {
    item.setBackground(mStyle.getBgDrawableFor(item, mItemBGColor));
  }
  LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams((int)mMain.getResources().getDimension(R.dimen.action_menu_width), ViewGroup.LayoutParams.WRAP_CONTENT);
  lp.setMargins(12,13,12,13);
  item.setLayoutParams(lp);
  mShortcutActionsList.addView(item);
  if (mAnimationDuration>0) {
    if (mShortcutActionsList.getChildCount() > mOldNum) {
      item.setVisibility(View.GONE);
    }
    item.setScaleY(.1f);
    item.animate()
        .scaleY(1f)
        .setDuration(mAnimationDuration)
        .setStartDelay(mShortcutActionsList.getChildCount() * 10 + 10)
        .withStartAction(new Runnable() {
          @Override
          public void run() {
            item.setVisibility(View.VISIBLE);
          }
        });
  }
}

代码示例来源:origin: sangxiaonian/AliBehaver

@Override
public boolean onSingleTapConfirmed(MotionEvent e) {
  if (!isCanDrag) {
    if (listener != null) {
      listener.onClick(this);
    } else if (clickListener != null) {
      clickListener.onClick(this);
    }
    if (isSacel) {
      animate().scaleY(1).scaleX(1).translationX(0).translationY(0).withStartAction(new Runnable() {
        @Override
        public void run() {
          moveToPoint();
        }
      });
    } else {
      moveToPoint();
    }
  }
  return false;
}

代码示例来源:origin: woxingxiao/GracefulMovies

.withStartAction(() -> displayBgImage(0, mBinding.bgIv1));
mBinding.bgIv2.animate().alpha(0).setDuration(1000)
    .withEndAction(() -> displayBgImage(1, mBinding.bgIv2));

相关文章