android.widget.ImageButton.animate()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(2.9k)|赞(0)|评价(0)|浏览(148)

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

ImageButton.animate介绍

暂无

代码示例

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

private void showFab() {
  fab.setAlpha(0f);
  fab.setScaleX(0f);
  fab.setScaleY(0f);
  fab.setTranslationY(fab.getHeight() / 2);
  fab.animate()
      .alpha(1f)
      .scaleX(1f)
      .scaleY(1f)
      .translationY(0f)
      .setDuration(300L)
      .setInterpolator(AnimUtils.getLinearOutSlowInInterpolator(this))
      .start();
}

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

fabPosting.animate()
    .alpha(0f)
    .rotation(90f)

代码示例来源:origin: michael-rapp/ChromeLikeTabSwitcher

/**
 * Animates the visibility of a tab's close button.
 *
 * @param viewHolder
 *         The view holder, which holds a reference to the close button, whose visibility should
 *         be animated, as an instance of the class {@link AbstractTabViewHolder}. The view
 *         holder may not be null
 * @param show
 *         True, if the close button should be shown, false otherwise
 */
private void animateCloseButtonVisibility(@NonNull final AbstractTabViewHolder viewHolder,
                     final boolean show) {
  ImageButton closeButton = viewHolder.closeButton;
  Boolean visible = (Boolean) closeButton.getTag(R.id.tag_visibility);
  if (visible == null || visible != show) {
    closeButton.setTag(R.id.tag_visibility, show);
    if (closeButton.getAnimation() != null) {
      closeButton.getAnimation().cancel();
    }
    ViewPropertyAnimator animation = closeButton.animate();
    animation.setListener(createCloseButtonVisibilityAnimationListener(viewHolder, show));
    animation.alpha(show ? 1 : 0);
    animation.setStartDelay(0);
    animation.setDuration(closeButtonVisibilityAnimationDuration);
    animation.start();
  }
}

代码示例来源:origin: adrianchifor/Swiftnotes

/**
 * Method to show and hide the newNote button
 * @param isVisible true to show button, false to hide
 */
protected void newNoteButtonVisibility(boolean isVisible) {
  if (isVisible) {
    newNote.animate().cancel();
    newNote.animate().translationY(newNoteButtonBaseYCoordinate);
  } else {
    newNote.animate().cancel();
    newNote.animate().translationY(newNoteButtonBaseYCoordinate + 500);
  }
}

代码示例来源:origin: GitLqr/MaterialDesignDemo

@Override
  public void show() {
    mToolbar.animate().translationY(0).setInterpolator(new AccelerateInterpolator(3));
    mFab.animate().translationY(0).setInterpolator(new AccelerateInterpolator(3));
  }
}

代码示例来源:origin: GitLqr/MaterialDesignDemo

@Override
public void hide() {
  mToolbar.animate().translationY(-(mToolbar.getHeight() + mToolbarBottomMargin)).setInterpolator(new AccelerateInterpolator(3));
  mFab.animate().translationY(mFab.getHeight() + mFabBottomMargin).setInterpolator(new AccelerateInterpolator(3));
}

代码示例来源:origin: whyalwaysmea/AndroidDemos

revealView.setLayoutParams(parameters);
imageButton.animate()
    .translationX(-x)
    .translationY(-y)

代码示例来源:origin: stackoverflow.com

public void onClick(View v) {
    imageButton.animate().cancel();
    imageButton.setImageResource(android.R.drawable.ic_delete);
imageButton.animate()
  .x(random.nextInt(maxX))
  .y(random.nextInt(maxY))

相关文章

ImageButton类方法