本文整理汇总了Java中android.view.animation.AnimationSet.setStartOffset方法的典型用法代码示例。如果您正苦于以下问题:Java AnimationSet.setStartOffset方法的具体用法?Java AnimationSet.setStartOffset怎么用?Java AnimationSet.setStartOffset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.animation.AnimationSet
的用法示例。
在下文中一共展示了AnimationSet.setStartOffset方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import android.view.animation.AnimationSet; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.whats_door);
mLeft = (ImageView)findViewById(R.id.imageLeft);
mRight = (ImageView)findViewById(R.id.imageRight);
mText = (TextView)findViewById(R.id.anim_text);
AnimationSet anim = new AnimationSet(true);
TranslateAnimation mytranslateanim = new TranslateAnimation(Animation.RELATIVE_TO_SELF,0f,Animation.RELATIVE_TO_SELF,-1f,Animation.RELATIVE_TO_SELF,0f,Animation.RELATIVE_TO_SELF,0f);
mytranslateanim.setDuration(2000);
anim.setStartOffset(800);
anim.addAnimation(mytranslateanim);
anim.setFillAfter(true);
mLeft.startAnimation(anim);
AnimationSet anim1 = new AnimationSet(true);
TranslateAnimation mytranslateanim1 = new TranslateAnimation(Animation.RELATIVE_TO_SELF,0f,Animation.RELATIVE_TO_SELF,+1f,Animation.RELATIVE_TO_SELF,0f,Animation.RELATIVE_TO_SELF,0f);
mytranslateanim1.setDuration(1500);
anim1.addAnimation(mytranslateanim1);
anim1.setStartOffset(800);
anim1.setFillAfter(true);
mRight.startAnimation(anim1);
AnimationSet anim2 = new AnimationSet(true);
ScaleAnimation myscaleanim = new ScaleAnimation(1f,3f,1f,3f,Animation.RELATIVE_TO_SELF,0.5f,Animation.RELATIVE_TO_SELF,0.5f);
myscaleanim.setDuration(1000);
AlphaAnimation myalphaanim = new AlphaAnimation(1,0.0001f);
myalphaanim.setDuration(1500);
anim2.addAnimation(myscaleanim);
anim2.addAnimation(myalphaanim);
anim2.setFillAfter(true);
mText.startAnimation(anim2);
new Thread(this).start();
}
示例2: createOptionShowAnimation
import android.view.animation.AnimationSet; //导入方法依赖的package包/类
@Override
public Animation createOptionShowAnimation(OptionButton optionButton, int index) {
AnimationSet animationSet = new AnimationSet(true);
TranslateAnimation translateAnimation= new TranslateAnimation(
getYMenuButton().getX() - optionButton.getX()
,0
,getYMenuButton().getY() - optionButton.getY()
,0);
translateAnimation.setDuration(getOptionSD_AnimationDuration());
AlphaAnimation alphaAnimation = new AlphaAnimation(0,1);
alphaAnimation.setDuration(getOptionSD_AnimationDuration());
animationSet.addAnimation(alphaAnimation);
animationSet.addAnimation(translateAnimation);
//为不同的Option设置延时
if (index % 2 == 1) {
animationSet.setStartOffset(getOptionSD_AnimationDuration()/2);
}
return animationSet;
}
示例3: createOptionDisappearAnimation
import android.view.animation.AnimationSet; //导入方法依赖的package包/类
@Override
public Animation createOptionDisappearAnimation(OptionButton optionButton, int index) {
AnimationSet animationSet = new AnimationSet(true);
TranslateAnimation translateAnimation= new TranslateAnimation(
0
,getYMenuButton().getX() - optionButton.getX()
,0
,getYMenuButton().getY() - optionButton.getY()
);
translateAnimation.setDuration(getOptionSD_AnimationDuration());
AlphaAnimation alphaAnimation = new AlphaAnimation(1,0);
alphaAnimation.setDuration(getOptionSD_AnimationDuration());
animationSet.addAnimation(translateAnimation);
animationSet.addAnimation(alphaAnimation);
//为不同的Option设置延时
if (index % 2 == 0) {
animationSet.setStartOffset(getOptionSD_AnimationDuration()/2);
}
return animationSet;
}
示例4: createOptionDisappearAnimation
import android.view.animation.AnimationSet; //导入方法依赖的package包/类
@Override
public Animation createOptionDisappearAnimation(OptionButton optionButton, int index) {
AnimationSet animationSet = new AnimationSet(true);
TranslateAnimation translateAnimation= new TranslateAnimation(
0
,getYMenuButton().getX() - optionButton.getX()
,0
,getYMenuButton().getY() - optionButton.getY()
);
translateAnimation.setDuration(getOptionSD_AnimationDuration());
AlphaAnimation alphaAnimation = new AlphaAnimation(1,0);
alphaAnimation.setDuration(getOptionSD_AnimationDuration());
animationSet.addAnimation(translateAnimation);
animationSet.addAnimation(alphaAnimation);
//设置动画延时
animationSet.setStartOffset(60*(getOptionPositionCount() - index));
return animationSet;
}
示例5: animateButtonIn
import android.view.animation.AnimationSet; //导入方法依赖的package包/类
private void animateButtonIn(View button, int delay) {
AnimationSet animation = new AnimationSet(true);
Animation scale = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f,
Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.0f);
animation.addAnimation(scale);
animation.setInterpolator(new OvershootInterpolator(1));
animation.setDuration(ANIMATION_DURATION);
animation.setStartOffset(delay);
button.startAnimation(animation);
}
示例6: createOptionShowAnimation
import android.view.animation.AnimationSet; //导入方法依赖的package包/类
@Override
public Animation createOptionShowAnimation(OptionButton optionButton, int index) {
float fromX,fromY;
AnimationSet animationSet = new AnimationSet(true);
if (index < 3){
fromX = getYMenuButton().getX() - optionButton.getX();
fromY = getYMenuButton().getY() - optionButton.getY();
}else if (index < 6){
fromX = getOptionButtonList().get(0).getX() - optionButton.getX();
fromY = getOptionButtonList().get(0).getY() - optionButton.getY();
animationSet.setStartOffset(getOptionSD_AnimationDuration() );
}else {
int oldIndex = index % 5;
fromX = getOptionButtonList().get(oldIndex).getX() - optionButton.getX();
fromY = getOptionButtonList().get(oldIndex).getY() - optionButton.getY();
animationSet.setStartOffset(getOptionSD_AnimationDuration() );
}
TranslateAnimation translateAnimation= new TranslateAnimation(
fromX
,0
,fromY
,0);
translateAnimation.setDuration(getOptionSD_AnimationDuration());
AlphaAnimation alphaAnimation = new AlphaAnimation(0,1);
alphaAnimation.setDuration(getOptionSD_AnimationDuration());
animationSet.addAnimation(alphaAnimation);
animationSet.addAnimation(translateAnimation);
animationSet.setInterpolator(new LinearInterpolator());
return animationSet;
}
示例7: createOptionDisappearAnimation
import android.view.animation.AnimationSet; //导入方法依赖的package包/类
@Override
public Animation createOptionDisappearAnimation(OptionButton optionButton, int index) {
float toX,toY;
AnimationSet animationSet = new AnimationSet(true);
if (index < 3){
toX = getYMenuButton().getX() - optionButton.getX();
toY = getYMenuButton().getY() - optionButton.getY();
if (getOptionButtonCount() > 3) {
animationSet.setStartOffset(getOptionSD_AnimationDuration());
}
}else if (index < 6){
toX = getOptionButtonList().get(0).getX() - optionButton.getX();
toY = getOptionButtonList().get(0).getY() - optionButton.getY();
}else {
int oldIndex = index % 5;
toX = getOptionButtonList().get(oldIndex).getX() - optionButton.getX();
toY = getOptionButtonList().get(oldIndex).getY() - optionButton.getY();
}
TranslateAnimation translateAnimation= new TranslateAnimation(
0
,toX
,0
,toY);
translateAnimation.setDuration(getOptionSD_AnimationDuration());
AlphaAnimation alphaAnimation = new AlphaAnimation(1,0);
alphaAnimation.setDuration(getOptionSD_AnimationDuration());
animationSet.addAnimation(alphaAnimation);
animationSet.addAnimation(translateAnimation);
return animationSet;
}
示例8: createOptionShowAnimation
import android.view.animation.AnimationSet; //导入方法依赖的package包/类
@Override
public Animation createOptionShowAnimation(OptionButton optionButton, int index) {
float fromX,fromY;
AnimationSet animationSet = new AnimationSet(true);
if (index < 3){
fromX = getYMenuButton().getX() - optionButton.getX();
fromY = getYMenuButton().getY() - optionButton.getY();
}else {
int oldIndex = (index - 3) / 2;
fromX = getOptionButtonList().get(oldIndex).getX() - optionButton.getX();
fromY = getOptionButtonList().get(oldIndex).getY() - optionButton.getY();
//设置冒出动画延时
animationSet.setStartOffset(getOptionSD_AnimationDuration());
}
TranslateAnimation translateAnimation= new TranslateAnimation(
fromX
,0
,fromY
,0);
translateAnimation.setDuration(getOptionSD_AnimationDuration());
AlphaAnimation alphaAnimation = new AlphaAnimation(0,1);
alphaAnimation.setDuration(getOptionSD_AnimationDuration());
animationSet.addAnimation(alphaAnimation);
animationSet.addAnimation(translateAnimation);
animationSet.setInterpolator(new LinearInterpolator());
return animationSet;
}
示例9: createQuitAnimation
import android.view.animation.AnimationSet; //导入方法依赖的package包/类
private AnimationSet createQuitAnimation(View _view, long _offSet) {
AnimationSet _set = new AnimationSet(true);
_set.addAnimation(new AlphaAnimation(1, 0));
_set.addAnimation(new ScaleAnimation(1, 2, 1, 2));
_set.addAnimation(new TranslateAnimation(0, -_view.getWidth() / 2, 0, -_view.getHeight() / 2));
_set.setDuration(150);
_set.setStartOffset(_offSet);
_set.setFillAfter(true);
return _set;
}
示例10: showHelpOverlay
import android.view.animation.AnimationSet; //导入方法依赖的package包/类
private void showHelpOverlay() {
if (animationsInProgress) return;
animationsInProgress = true;
titleLayout.bringToFront();
helpLayout.setVisibility(View.VISIBLE);
Animator showAnimation;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
showAnimation = ViewAnimationUtils.createCircularReveal(helpLayout, titleBtnHelpCenterX, titleBtnHelpCenterY, 0, screenDiagonalPx);
} else {
showAnimation = ObjectAnimator.ofFloat(helpLayout, "alpha", 0f, 1f);
}
showAnimation.setInterpolator(new AccelerateInterpolator());
showAnimation.setDuration(250);
showAnimation.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
mainLayout.setVisibility(View.GONE);
animationsInProgress = false;
helpLayoutShown = true;
}
});
showAnimation.start();
int textMoveOffset = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 25, getResources().getDisplayMetrics());
AnimationSet helpHeaderAnimationSet = new AnimationSet(true);
helpHeaderAnimationSet.addAnimation(new TranslateAnimation(0, 0, textMoveOffset, 0));
helpHeaderAnimationSet.addAnimation(new AlphaAnimation(0, 1f));
helpHeaderAnimationSet.setInterpolator(new DecelerateInterpolator());
helpHeaderAnimationSet.setStartOffset(200);
helpHeaderAnimationSet.setDuration(450);
helpLayoutTextHeader.startAnimation(helpHeaderAnimationSet);
AnimationSet helpContentAnimationSet = new AnimationSet(true);
helpContentAnimationSet.addAnimation(new TranslateAnimation(0, 0, textMoveOffset, 0));
helpContentAnimationSet.addAnimation(new AlphaAnimation(0, 1f));
helpContentAnimationSet.setInterpolator(new DecelerateInterpolator());
helpContentAnimationSet.setStartOffset(300);
helpContentAnimationSet.setDuration(450);
helpLayoutTextContent.startAnimation(helpContentAnimationSet);
int height = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 65, getResources().getDisplayMetrics());
TranslateAnimation helpLayoutBottomPanelSlideUp = new TranslateAnimation(0, 0, height, 0);
helpLayoutBottomPanelSlideUp.setDuration(550);
helpLayoutBottomPanelSlideUp.setStartOffset(500);
helpLayoutBottomPanelSlideUp.setInterpolator(new DecelerateInterpolator());
helpLayoutBottomPanel.startAnimation(helpLayoutBottomPanelSlideUp);
}
示例11: onCreate
import android.view.animation.AnimationSet; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
trackEvent(R.string.category_read, R.string.action_login);
mLoginTextContainer = (RelativeLayout) findViewById(R.id.login_text_container);
mWebViewProgress = (ProgressView) findViewById(R.id.SetupProgress);
mWebViewContainer = (FrameLayout) findViewById(R.id.webview_container);
mContinueFABContainer = (FrameLayout) findViewById(R.id.login_continue_circle_container);
mGearIcon = (ImageView) findViewById(R.id.login_icon);
mSuccessIcon = (ImageView) findViewById(R.id.login_icon_done);
mContinueIcon = (ImageView) findViewById(R.id.forward_arrow);
mLoginTextLineOne = (TextView) findViewById(R.id.login_text_line_one);
mLoginTextLineTwo = (TextView) findViewById(R.id.login_text_line_two);
mSuccessMessage = (TextView) findViewById(R.id.login_success_message);
mSkipText = (TextView) findViewById(R.id.skip_text);
loginWebView = (WebView) findViewById(R.id.login_webview);
mContinueFAB = findViewById(R.id.login_continue_circle);
mContinueFABShadow = findViewById(R.id.login_continue_circle_shadow);
mSuccessCircle = findViewById(R.id.login_success_circle);
mSuccessCircleShadow = findViewById(R.id.login_success_shadow);
mTransitionViewWhite = findViewById(R.id.transition_view);
mTransitionViewBlue = findViewById(R.id.transition_view_blue);
mSuccessMessage .setVisibility(View.INVISIBLE);
mContinueIcon .setVisibility(View.INVISIBLE);
mSuccessCircleShadow.setVisibility(View.INVISIBLE);
mSuccessIcon .setVisibility(View.INVISIBLE);
mSuccessCircle .setVisibility(View.INVISIBLE);
mLoginTextLineOne .setVisibility(View.INVISIBLE);
mLoginTextLineTwo .setVisibility(View.INVISIBLE);
loginWebView .setVisibility(View.INVISIBLE);
mGearIcon .setVisibility(View.INVISIBLE);
mTransitionViewBlue .setVisibility(View.INVISIBLE);
mTransitionViewWhite.setVisibility(View.INVISIBLE);
mSkipText .setVisibility(View.INVISIBLE);
checkSetupType();
float textPosition = (int) (2.5 * (getScreenHeight() / 5));
mLoginTextContainer .setY(textPosition);
mSuccessMessage .setY(textPosition);
mContinueFABContainer.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showLoginView();
if (PocketPlaysApplication.isCrawlerUpdate)
showSkippingAnimation();
}
});
Service.bringToBack(mTransitionViewWhite);
Service.bringToBack(mTransitionViewBlue);
mLoginTextLineOne .bringToFront();
mLoginTextLineTwo .bringToFront();
initSkipView();
initSnackbar();
initLoginView();
showLogoAnimations();
showTextLineAnimations(mLoginTextLineOne, 1);
showTextLineAnimations(mLoginTextLineTwo, 2);
showTextLineAnimations(mSkipText, 2);
AnimationSet animationSet = getContinueIconAnimations(270);
animationSet.setStartOffset(SHOW_CONTINUE_ICON_DELAY);
animationSet.start();
}