本文整理汇总了Java中android.animation.ObjectAnimator.start方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectAnimator.start方法的具体用法?Java ObjectAnimator.start怎么用?Java ObjectAnimator.start使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.animation.ObjectAnimator
的用法示例。
在下文中一共展示了ObjectAnimator.start方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showStartView
import android.animation.ObjectAnimator; //导入方法依赖的package包/类
/**
* 显示最后一页的状态
* @param position
*/
private void showStartView(int position) {
// 最后一页
if (position == mCount - 1) {
if (mOpenView != null) {
mOpenView.setVisibility(VISIBLE);
ObjectAnimator animator = ObjectAnimator.ofFloat(mOpenView,
"alpha", 0, 1);
animator.setDuration(500);
animator.setInterpolator(new AccelerateDecelerateInterpolator());
animator.start();
if (mDismissOpen){
setVisibility(View.GONE);
}
}
} else {
if (mOpenView != null) {
mOpenView.setVisibility(GONE);
if (mDismissOpen){
setVisibility(VISIBLE);
}
}
}
}
示例2: animateLayoutChange
import android.animation.ObjectAnimator; //导入方法依赖的package包/类
private void animateLayoutChange(@Nullable final View previousView) {
if (previousView == null) {
getView(mViewState).setVisibility(View.VISIBLE);
return;
}
previousView.setVisibility(View.VISIBLE);
ObjectAnimator anim = ObjectAnimator.ofFloat(previousView, "alpha", 1.0f, 0.0f).setDuration(250L);
anim.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
previousView.setVisibility(View.GONE);
getView(mViewState).setVisibility(View.VISIBLE);
ObjectAnimator.ofFloat(getView(mViewState), "alpha", 0.0f, 1.0f).setDuration(250L).start();
}
});
anim.start();
}
示例3: addRow
import android.animation.ObjectAnimator; //导入方法依赖的package包/类
public void addRow(View view) {
mButton.setEnabled(false);
mItemNum++;
ListItemObject obj = mValues[mItemNum % mValues.length];
final ListItemObject newObj = new ListItemObject(obj.getTitle(), obj.getImgResource(),
mCellHeight);
boolean shouldAnimateInNewImage = mListView.shouldAnimateInNewImage();
if (!shouldAnimateInNewImage) {
mListView.addRow(newObj);
return;
}
mListView.setEnabled(false);
ObjectAnimator animator = mRoundView.getScalingAnimator();
animator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationRepeat(Animator animation) {
mListView.addRow(newObj);
}
});
animator.start();
}
示例4: animate
import android.animation.ObjectAnimator; //导入方法依赖的package包/类
void animate(float state, int duration) {
ObjectAnimator anim;
if (state == STATE_ARROW) {
anim = ObjectAnimator.ofFloat(this, PROGRESS, state, STATE_HAMBURGER);
} else {
anim = ObjectAnimator.ofFloat(this, PROGRESS, state, STATE_ARROW);
}
anim.setInterpolator(new AccelerateDecelerateInterpolator());
anim.setDuration(duration);
anim.start();
}
示例5: fadeAndRemoveEmptyScreen
import android.animation.ObjectAnimator; //导入方法依赖的package包/类
private void fadeAndRemoveEmptyScreen(int delay, int duration, final Runnable onComplete,
final boolean stripEmptyScreens) {
// XXX: Do we need to update LM workspace screens below?
PropertyValuesHolder alpha = PropertyValuesHolder.ofFloat("alpha", 0f);
PropertyValuesHolder bgAlpha = PropertyValuesHolder.ofFloat("backgroundAlpha", 0f);
final CellLayout cl = mWorkspaceScreens.get(EXTRA_EMPTY_SCREEN_ID);
mRemoveEmptyScreenRunnable = new Runnable() {
@Override
public void run() {
if (hasExtraEmptyScreen()) {
mWorkspaceScreens.remove(EXTRA_EMPTY_SCREEN_ID);
mScreenOrder.remove(EXTRA_EMPTY_SCREEN_ID);
removeView(cl);
if (stripEmptyScreens) {
stripEmptyScreens();
}
// Update the page indicator to reflect the removed page.
showPageIndicatorAtCurrentScroll();
}
}
};
ObjectAnimator oa = ObjectAnimator.ofPropertyValuesHolder(cl, alpha, bgAlpha);
oa.setDuration(duration);
oa.setStartDelay(delay);
oa.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
if (mRemoveEmptyScreenRunnable != null) {
mRemoveEmptyScreenRunnable.run();
}
if (onComplete != null) {
onComplete.run();
}
}
});
oa.start();
}
示例6: show
import android.animation.ObjectAnimator; //导入方法依赖的package包/类
public void show(){
ObjectAnimator animator = ObjectAnimator.ofFloat(loadingView, "rotation", 0, 360);
animator.setInterpolator(new LinearInterpolator());
animator.setDuration(800);
animator.setRepeatCount(-1);
animator.start();
dialog.show();
}
示例7: showBottomBar
import android.animation.ObjectAnimator; //导入方法依赖的package包/类
@Override
public void showBottomBar() {
mRlBottomBar.setVisibility(View.VISIBLE);
// bottombar进行一个上移的动画
ObjectAnimator animator = ObjectAnimator.ofFloat(mRlBottomBar, "translationY", SizeUtils.dp2px(56), 0);
animator.setDuration(300);
animator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
}
});
animator.start();
}
示例8: anim
import android.animation.ObjectAnimator; //导入方法依赖的package包/类
private void anim(final View v) {
ObjectAnimator animator = ObjectAnimator.ofFloat(v, "rotationX", 0.0F, 360.0F)
.setDuration(200);
animator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
HomeCampaign campaign = mDatas.get(getLayoutPosition());
switch (v.getId()) {
case R.id.imgview_big:
mListener.onClick(v, campaign.getCpOne());
break;
case R.id.imgview_small_top:
mListener.onClick(v, campaign.getCpTwo());
break;
case R.id.imgview_small_bottom:
mListener.onClick(v, campaign.getCpThree());
break;
}
}
});
animator.start();
}
示例9: create
import android.animation.ObjectAnimator; //导入方法依赖的package包/类
public void create(float winX, float winY,FrameLayout field, ArrayList<CharaView> charaViews,CharaView chara, int walkSec) {
try {
if (charaViews.size() >= MAX_CHARA) {
//Toast.makeText(field.getContext(), "同時に呼び出せるのは"+ MAX_CHARA +"人までです",Toast.LENGTH_SHORT).show();
field.removeView(charaViews.get(0));
charaViews.remove(0);
return;
}
mWindowSizeX = winX;
mWindowSizeY = winY;
charaViews.add(chara);
CharaView c = charaViews.get(charaViews.size() - 1);
field.addView(c);
int r = (int) (Math.random() * 3);
switch (r) {
case 0:
case 1:
case 2:
c.randomAnimation(MainActivity.walkSec);
break;
}
PropertyValuesHolder holderX = PropertyValuesHolder.ofFloat("translationX", 0, 0);
PropertyValuesHolder holderY = PropertyValuesHolder.ofFloat("translationY", 0, winY * 0.7f);
PropertyValuesHolder holderRotaion = PropertyValuesHolder.ofFloat("rotation", 0, 0);
c.setXY(0, winY * 0.7f);
// targetに対してholderX, holderY, holderRotationを同時に実行させます
ObjectAnimator objectAnimator = ObjectAnimator.ofPropertyValuesHolder(c, holderX, holderY, holderRotaion);
objectAnimator.setDuration(MainActivity.walkSec);
objectAnimator.start();
//button.setText("納沙幸子 * " + charaViews.size());
} catch (OutOfMemoryError e){
Toast.makeText(field.getContext(), "メモリがいっぱいです : " + charaViews.size() + "人",Toast.LENGTH_SHORT).show();
}
}
示例10: onBind
import android.animation.ObjectAnimator; //导入方法依赖的package包/类
@Override
public void onBind(Target view, Value value, final OnBindListener onBindListener) {
ObjectAnimator animatorX = ObjectAnimator.ofFloat(view, View.TRANSLATION_X, view.getWidth());
animatorX.setDuration(300);
animatorX.setStartDelay(count*80);
animatorX.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
onBindListener.onBindDone();
}
});
animatorX.start();
count ++;
}
示例11: reset
import android.animation.ObjectAnimator; //导入方法依赖的package包/类
public void reset() {
final ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(this, "percent", 1f, 0f);
objectAnimator.setDuration(duration);
if (interpolator != null) {
objectAnimator.setInterpolator(interpolator);
}
objectAnimator.start();
}
示例12: animateWobbleInverse
import android.animation.ObjectAnimator; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
private void animateWobbleInverse(View v) {
ObjectAnimator animator = createBaseWobble(v);
animator.setFloatValues(2, -2);
animator.start();
mWobbleAnimators.add(animator);
}
示例13: exitAnimate
import android.animation.ObjectAnimator; //导入方法依赖的package包/类
static ValueAnimator exitAnimate(final DepthRelativeLayout target, final float moveY, final float customElevation, long delay, int subtractDelay, boolean continueOffscreen) {
target.setPivotY(getDistanceToCenter(target));
target.setPivotX(getDistanceToCenterX(target));
target.setCameraDistance(10000 * target.getResources().getDisplayMetrics().density);
ObjectAnimator rotationX = ObjectAnimator.ofFloat(target, View.ROTATION_X, TARGET_ROTATION_X).setDuration(DURATION);
rotationX.setInterpolator(VALUEinterpolator);
rotationX.setStartDelay(delay);
rotationX.start();
ObjectAnimator elevation = ObjectAnimator.ofFloat(target, "CustomShadowElevation", target.getCustomShadowElevation(), customElevation * target.getResources().getDisplayMetrics().density).setDuration(DURATION);
elevation.setInterpolator(VALUEinterpolator);
elevation.setStartDelay(delay);
elevation.start();
ObjectAnimator scaleX = ObjectAnimator.ofFloat(target, View.SCALE_X, TARGET_SCALE).setDuration(DURATION);
scaleX.setInterpolator(new QuintOut());
scaleX.setStartDelay(delay);
scaleX.start();
ObjectAnimator scaleY = ObjectAnimator.ofFloat(target, View.SCALE_Y, TARGET_SCALE).setDuration(DURATION);
scaleY.setInterpolator(new QuintOut());
scaleY.setStartDelay(delay);
scaleY.start();
ObjectAnimator rotation = ObjectAnimator.ofFloat(target, View.ROTATION, TARGET_ROTATION).setDuration(1600);
rotation.setInterpolator(VALUEinterpolator);
rotation.setStartDelay(delay);
rotation.start();
ObjectAnimator translationY = ObjectAnimator.ofFloat(target, View.TRANSLATION_Y, -moveY * target.getResources().getDisplayMetrics().density).setDuration(subtractDelay);
translationY.setInterpolator(VALUEinterpolator);
translationY.setStartDelay(delay);
translationY.start();
if (continueOffscreen) {
continueOutToRight(target, moveY, subtractDelay);
}
return scaleY;
}
示例14: onError
import android.animation.ObjectAnimator; //导入方法依赖的package包/类
@Override
public void onError() {
mTvTip.setText("请重试");
ObjectAnimator animator = ObjectAnimator.ofFloat(mTvTip, "translationX", -SizeUtils.dp2px(8), SizeUtils.dp2px(8), 0);
animator.setDuration(200);
animator.start();
}
示例15: onUpdateProgressViews
import android.animation.ObjectAnimator; //导入方法依赖的package包/类
@Override
public void onUpdateProgressViews(int progress, int total) {
progressSlider.setMax(total);
ObjectAnimator animator = ObjectAnimator.ofInt(progressSlider, "progress", progress);
animator.setDuration(1500);
animator.setInterpolator(new LinearInterpolator());
animator.start();
mPlayerSongCurrentProgress.setText(MusicUtil.getReadableDurationString(progress));
mSongTotalTime.setText(MusicUtil.getReadableDurationString(total));
}