當前位置: 首頁>>代碼示例>>Java>>正文


Java AnimationSet.setStartOffset方法代碼示例

本文整理匯總了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();
  }
 
開發者ID:qizhenghao,項目名稱:HiBangClient,代碼行數:37,代碼來源:WhatsnewDoor.java

示例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;
}
 
開發者ID:totond,項目名稱:YMenuView,代碼行數:20,代碼來源:Circle8YMenu.java

示例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;
}
 
開發者ID:totond,項目名稱:YMenuView,代碼行數:21,代碼來源:Circle8YMenu.java

示例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;
}
 
開發者ID:totond,項目名稱:YMenuView,代碼行數:21,代碼來源:TreeYMenu.java

示例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);
}
 
開發者ID:XecureIT,項目名稱:PeSanKita-android,代碼行數:12,代碼來源:AttachmentTypeSelector.java

示例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;

}
 
開發者ID:totond,項目名稱:YMenuView,代碼行數:33,代碼來源:SquareYMenu.java

示例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;
}
 
開發者ID:totond,項目名稱:YMenuView,代碼行數:33,代碼來源:SquareYMenu.java

示例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;
}
 
開發者ID:totond,項目名稱:YMenuView,代碼行數:31,代碼來源:TreeYMenu.java

示例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;
}
 
開發者ID:bonepeople,項目名稱:SDCardCleaner,代碼行數:13,代碼來源:MainActivity.java

示例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);
}
 
開發者ID:Ramotion,項目名稱:showroom-android,代碼行數:51,代碼來源:ShowroomActivity.java

示例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();
}
 
開發者ID:SebastianRask,項目名稱:Pocket-Plays-for-Twitch,代碼行數:71,代碼來源:LoginActivity.java


注:本文中的android.view.animation.AnimationSet.setStartOffset方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。