本文整理汇总了Java中android.support.design.widget.FloatingActionButton.startAnimation方法的典型用法代码示例。如果您正苦于以下问题:Java FloatingActionButton.startAnimation方法的具体用法?Java FloatingActionButton.startAnimation怎么用?Java FloatingActionButton.startAnimation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.design.widget.FloatingActionButton
的用法示例。
在下文中一共展示了FloatingActionButton.startAnimation方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: animateIn
import android.support.design.widget.FloatingActionButton; //导入方法依赖的package包/类
private void animateIn(FloatingActionButton button) {
button.setVisibility(View.VISIBLE);
if (Build.VERSION.SDK_INT >= 14) {
ViewCompat.animate(button)
.scaleX(1.0F)
.scaleY(1.0F)
.alpha(1.0F)
.setInterpolator(INTERPOLATOR)
.withLayer()
.setListener(null)
.start();
} else {
Animation anim = AnimationUtils.loadAnimation(button.getContext(),
android.support.design.R.anim.design_fab_in);
anim.setDuration(200L);
anim.setInterpolator(INTERPOLATOR);
button.startAnimation(anim);
}
}
示例2: animateIn
import android.support.design.widget.FloatingActionButton; //导入方法依赖的package包/类
private void animateIn(FloatingActionButton button) {
button.setVisibility(View.VISIBLE);
if (Build.VERSION.SDK_INT >= 14) {
ViewCompat.animate(button)
.scaleX(1.0F)
.scaleY(1.0F)
.alpha(1.0F)
.setInterpolator(INTERPOLATOR)
.withLayer()
.setListener(null)
.start();
} else {
Animation anim = AnimationUtils.loadAnimation(button.getContext(),
android.support.design.R.anim.design_fab_in);
anim.setDuration(200L);
anim.setInterpolator(INTERPOLATOR);
button.startAnimation(anim);
}
}
示例3: animateIn
import android.support.design.widget.FloatingActionButton; //导入方法依赖的package包/类
private void animateIn(FloatingActionButton button) {
button.setVisibility(View.VISIBLE);
if (Build.VERSION.SDK_INT >= 14) {
ViewCompat.animate(button)
.translationY(0)
.setInterpolator(INTERPOLATOR)
.withLayer()
.setListener(null)
.start();
} else {
Animation anim = AnimationUtils.loadAnimation(button.getContext(),
android.support.design.R.anim.design_fab_in);
anim.setDuration(200L);
anim.setInterpolator(INTERPOLATOR);
button.startAnimation(anim);
}
}
示例4: onViewAttachedToWindow
import android.support.design.widget.FloatingActionButton; //导入方法依赖的package包/类
@Override
public void onViewAttachedToWindow(CollectionAdapterViewHolder holder) {
super.onViewAttachedToWindow(holder);
Log.v(LOG_TAG + "debugCollectionView", "start onViewAttachedToWindow , getFabPlayButton().getTag=" + String.valueOf(holder.getFabPlayButton().getTag()));
//restore animation if loading status
FloatingActionButton fabPlayButton = holder.getFabPlayButton();
String tag = fabPlayButton.getTag() == null ? "" : fabPlayButton.getTag().toString();
if (Objects.equals(tag, LOADING_STATUS)) {
Animation rotate_infinite = AnimationUtils.loadAnimation(mActivity, R.anim.rotate_infinite);
rotate_infinite.setFillAfter(true);
fabPlayButton.startAnimation(rotate_infinite);
}
}