本文整理匯總了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);
}
}