本文整理汇总了Java中android.view.ViewPropertyAnimator.cancel方法的典型用法代码示例。如果您正苦于以下问题:Java ViewPropertyAnimator.cancel方法的具体用法?Java ViewPropertyAnimator.cancel怎么用?Java ViewPropertyAnimator.cancel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.ViewPropertyAnimator
的用法示例。
在下文中一共展示了ViewPropertyAnimator.cancel方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: hideProgressBar
import android.view.ViewPropertyAnimator; //导入方法依赖的package包/类
/**
*/
@Override
void hideProgressBar(SearchView searchView) {
final CircularProgressBar progressBar = searchView.mProgressBar;
final ViewPropertyAnimator progressBarAnimator = progressBar.animate();
progressBarAnimator.setListener(null);
progressBarAnimator.cancel();
progressBarAnimator
.alpha(0.0f)
.setDuration(UiConfig.ANIMATION_DURATION_SHORT)
.setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
progressBar.setVisibility(View.INVISIBLE);
}
})
.start();
final View icon = searchView.mButtonIcon;
final ViewPropertyAnimator iconAnimator = icon.animate();
iconAnimator.setListener(null);
iconAnimator.cancel();
icon.setVisibility(View.VISIBLE);
icon.setScaleX(0.5f);
icon.setScaleY(0.5f);
icon.setAlpha(0.0f);
iconAnimator
.scaleX(1.0f)
.scaleY(1.0f)
.alpha(1.0f)
.setDuration(UiConfig.ANIMATION_DURATION_SHORT)
.setInterpolator(iconInterpolator)
.setListener(null)
.start();
}
示例2: showProgressBar
import android.view.ViewPropertyAnimator; //导入方法依赖的package包/类
/**
*/
@Override
void showProgressBar(SearchView searchView) {
final View icon = searchView.mButtonIcon;
final ViewPropertyAnimator iconAnimator = icon.animate();
iconAnimator.setListener(null);
iconAnimator.cancel();
iconAnimator
.scaleX(0.5f)
.scaleY(0.5f)
.alpha(0.0f)
.setDuration(UiConfig.ANIMATION_DURATION_MEDIUM)
.setInterpolator(iconInterpolator)
.setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
icon.setVisibility(View.INVISIBLE);
}
})
.start();
final CircularProgressBar progressBar = searchView.mProgressBar;
final ViewPropertyAnimator progressBarAnimator = progressBar.animate();
progressBarAnimator.setListener(null);
progressBarAnimator.cancel();
progressBar.setAlpha(0.0f);
progressBar.setVisibility(View.VISIBLE);
progressBarAnimator
.alpha(1.0f)
.setDuration(UiConfig.ANIMATION_DURATION_MEDIUM)
.setListener(null)
.start();
}
示例3: cancel
import android.view.ViewPropertyAnimator; //导入方法依赖的package包/类
public void cancel() {
ViewPropertyAnimator n = (ViewPropertyAnimator) this.mNative.get();
if (n != null) {
n.cancel();
}
}