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

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

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

Button.animate介绍

暂无

代码示例

代码示例来源:origin: li2/learning-android-open-source

@Override
  public void onClick(View v) {
    animatingButton.animate().alpha(1);
  }
});

代码示例来源:origin: li2/learning-android-open-source

@Override
  public void onClick(View v) {
    animatingButton.animate().alpha(0);
  }
});

代码示例来源:origin: AntonioRedondo/AnotherMonitor

@Override
  public void onClick(View v) {
    mListSelected.clear(); // This also updates the List on ServiceReader because it is poiting to the same object
    mLProcessContainer.removeAllViews();
    mHandlerVG.post(drawRunnableGraphic);
    mBRemoveAll.animate().setDuration(300).alpha(0).setListener(new AnimatorListenerAdapter() {
      @Override
      public void onAnimationEnd(Animator animation) {
        mBRemoveAll.setVisibility(View.GONE);
      }
    });
  }
});

代码示例来源:origin: li2/learning-android-open-source

@Override
  public void onClick(View v) {
    animatingButton.animate().rotationYBy(720);
  }
});

代码示例来源:origin: Michenux/YourAppIdea

@TargetApi(16)
  public void setupLiveAnimOnButtonL16(final Button button, final Runnable onEndRunnable) {
    button.animate().setDuration(400);
    button.setOnTouchListener(new View.OnTouchListener() {
      @Override
      public boolean onTouch(View arg0, MotionEvent arg1) {
        if (arg1.getAction() == MotionEvent.ACTION_DOWN) {
          button.animate().setInterpolator(decelerator).
              scaleX(.7f).scaleY(.7f);
        } else if (arg1.getAction() == MotionEvent.ACTION_UP) {
          button.animate().setInterpolator(overshooter).
              scaleX(1.6f).scaleY(1.6f).withEndAction(onEndRunnable);
        }
        return false;
      }
    });
  }
}

代码示例来源:origin: Michenux/YourAppIdea

@Override
  public boolean onTouch(View arg0, MotionEvent arg1) {
    if (arg1.getAction() == MotionEvent.ACTION_DOWN) {
      button.animate().setInterpolator(decelerator).
          scaleX(.7f).scaleY(.7f);
    } else if (arg1.getAction() == MotionEvent.ACTION_UP) {
      button.animate().setInterpolator(overshooter).
          scaleX(1.6f).scaleY(1.6f).withEndAction(onEndRunnable);
    }
    return false;
  }
});

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

@Override
public void onClick(View view) {
  b.animate().rotationYBy(180).setDuration(500).setListener(new Animator.AnimatorListener() {
    @Override
    public void onAnimationStart(Animator animator) {

代码示例来源:origin: li2/learning-android-open-source

@Override
  public void onClick(View v) {
    animatingButton.animate().x(0).y(0);
  }
});

代码示例来源:origin: the-pig-of-jungle/smart-show

@Override
public void animateContentIn(int delay, int duration) {
  mMessageView.setAlpha(0f);
  mMessageView.animate().alpha(1f).setDuration(duration)
      .setStartDelay(delay).start();
  if (mActionView.getVisibility() == VISIBLE) {
    mActionView.setAlpha(0f);
    mActionView.animate().alpha(1f).setDuration(duration)
        .setStartDelay(delay).start();
  }
}

代码示例来源:origin: the-pig-of-jungle/SmartShow

@Override
public void animateContentIn(int delay, int duration) {
  mMessageView.setAlpha(0f);
  mMessageView.animate().alpha(1f).setDuration(duration)
      .setStartDelay(delay).start();
  if (mActionView.getVisibility() == VISIBLE) {
    mActionView.setAlpha(0f);
    mActionView.animate().alpha(1f).setDuration(duration)
        .setStartDelay(delay).start();
  }
}

代码示例来源:origin: the-pig-of-jungle/smart-show

@Override
  public void animateContentOut(int delay, int duration) {
    mMessageView.setAlpha(1f);
    mMessageView.animate().alpha(0f).setDuration(duration)
        .setStartDelay(delay).start();

    if (mActionView.getVisibility() == VISIBLE) {
      mActionView.setAlpha(1f);
      mActionView.animate().alpha(0f).setDuration(duration)
          .setStartDelay(delay).start();
    }
  }
}

代码示例来源:origin: the-pig-of-jungle/SmartShow

@Override
  public void animateContentOut(int delay, int duration) {
    mMessageView.setAlpha(1f);
    mMessageView.animate().alpha(0f).setDuration(duration)
        .setStartDelay(delay).start();

    if (mActionView.getVisibility() == VISIBLE) {
      mActionView.setAlpha(1f);
      mActionView.animate().alpha(0f).setDuration(duration)
          .setStartDelay(delay).start();
    }
  }
}

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

.animate()
.alpha(0F)
.setDuration(500L)
.animate()
.alpha(0F)
.translationYBy(-sandImage.getHeight())

代码示例来源:origin: li2/learning-android-open-source

animatingButton.animate().setDuration(2000);

代码示例来源:origin: sebaslogen/CleanGUITestArchitecture

emailSignInButton.animate()
    .setStartDelay(1000)
    .setInterpolator(new AccelerateDecelerateInterpolator())

代码示例来源:origin: li2/learning-android-open-source

@Override
  public void onClick(View v) {
    int xValue = container.getWidth() - animatingButton.getWidth();
    int yValue = container.getHeight() - animatingButton.getHeight();
    animatingButton.animate().x(xValue).y(yValue);
  }
});

相关文章

Button类方法