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


Java ViewAnimator.setOutAnimation方法代碼示例

本文整理匯總了Java中android.widget.ViewAnimator.setOutAnimation方法的典型用法代碼示例。如果您正苦於以下問題:Java ViewAnimator.setOutAnimation方法的具體用法?Java ViewAnimator.setOutAnimation怎麽用?Java ViewAnimator.setOutAnimation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.widget.ViewAnimator的用法示例。


在下文中一共展示了ViewAnimator.setOutAnimation方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: flipTransition

import android.widget.ViewAnimator; //導入方法依賴的package包/類
/**
 * Flip to the next view of the {@code ViewAnimator}'s subviews. A call to this method will
 * initiate a {@link FlipAnimation} to show the next View.
 * If the currently visible view is the last view, flip direction will be reversed for this
 * transition.
 *
 * @param viewAnimator the {@code ViewAnimator}
 * @param dir the direction of flip
 * @param duration the transition duration in milliseconds
 */
public static void flipTransition(final ViewAnimator viewAnimator, FlipDirection dir,
                                  long duration) {

    final View fromView = viewAnimator.getCurrentView();
    final int currentIndex = viewAnimator.getDisplayedChild();
    final int nextIndex = (currentIndex + 1) % viewAnimator.getChildCount();

    final View toView = viewAnimator.getChildAt(nextIndex);

    Animation[] animc = AnimationFactory.flipAnimation(fromView, toView,
            (nextIndex < currentIndex ? dir.theOtherDirection() : dir), duration, null);

    viewAnimator.setOutAnimation(animc[0]);
    viewAnimator.setInAnimation(animc[1]);

    viewAnimator.showNext();
}
 
開發者ID:whereuat,項目名稱:whereuat-android,代碼行數:28,代碼來源:AnimationFactory.java

示例2: flipTransition

import android.widget.ViewAnimator; //導入方法依賴的package包/類
/**
 * Flip to the next view of the {@code ViewAnimator}'s subviews. A call 
 * to this method will initiate a {@link FlipAnimation} to show the next 
 * View. If the currently visible view is the last view, flip direction 
 * will be reversed for this transition.
 *  
 * @param viewAnimator the {@code ViewAnimator}
 * @param dir the direction of flip
 * @param duration the transition duration in milliseconds
 */
public static void flipTransition(final ViewAnimator viewAnimator, FlipDirection dir, long duration) {   
	
	final View fromView = viewAnimator.getCurrentView();
	final int currentIndex = viewAnimator.getDisplayedChild();
	final int nextIndex = (currentIndex + 1)%viewAnimator.getChildCount();
	
	final View toView = viewAnimator.getChildAt(nextIndex);		
			
	if(android.os.Build.VERSION.SDK_INT>=12) {
		//New way of flipping.
		flipTransition(fromView, toView);
	}else{
		//Traditional flip.
		Animation[] animc = AnimationFactory.flipAnimation(fromView, toView, 
				(nextIndex < currentIndex?dir.theOtherDirection():dir), duration, null);
		viewAnimator.setOutAnimation(animc[0]);
		viewAnimator.setInAnimation(animc[1]);
		viewAnimator.showNext();
	}	   
}
 
開發者ID:javocsoft,項目名稱:javocsoft-toolbox,代碼行數:31,代碼來源:AnimationFactory.java

示例3: onCreate

import android.widget.ViewAnimator; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_account);

    mTxtWhether = (TextView) findViewById(R.id.account_txt_whether);
    mTxtTitle = (TextView) findViewById(R.id.account_txt_title);
    mViewAnimator = (ViewAnimator) findViewById(R.id.account_output);
    mEditLoginEmail = (EditText) findViewById(R.id.account_edit_login_email);
    mEditLoginPassword = (EditText) findViewById(R.id.account_edit_login_password);
    mEditRegisterPasswordConfirm = (EditText) findViewById(R.id.account_edit_register_password_confirm);
    mEditRegisterPassword = (EditText) findViewById(R.id.account_edit_register_password);
    mEditRegisterEmail = (EditText) findViewById(R.id.account_edit_register_email);
    mBtnSubmit = (Button) findViewById(R.id.account_btn_submit);
    mBtnChange = (Button) findViewById(R.id.account_btn_change);
    mLoading = (Loading) findViewById(R.id.loading);

    mViewAnimator.setInAnimation(AnimationUtils.loadAnimation(getApplicationContext(),
            R.anim.anim_in_slide_right));
    mViewAnimator.setOutAnimation(AnimationUtils.loadAnimation(getApplicationContext(),
            R.anim.anim_out_slide_left));

    mBtnSubmit.setOnClickListener(this);
    mBtnChange.setOnClickListener(this);

    mRegisterPresenter = new AccountRegisterPresenterAccount(this);
    mAccountLoginPresenter = mRegisterPresenter;
}
 
開發者ID:qiujuer,項目名稱:UPMiss,代碼行數:29,代碼來源:AccountActivity.java

示例4: onCreate

import android.widget.ViewAnimator; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    appContext = this.getApplicationContext();

    loginButton = (Button) findViewById(R.id.loginButton);
    registerButton = (Button) findViewById(R.id.registerButton);
    usernameEt = (EditText) findViewById(R.id.usernameEt);
    passwordEt = (EditText) findViewById(R.id.passwordEt);
    regusernameEt = (EditText) findViewById(R.id.regusernameEt);
    regpasswordEt = (EditText) findViewById(R.id.regpasswordEt);
    passwordCheckEt = (EditText) findViewById(R.id.passwordCheckEt);
    emailEt = (EditText) findViewById(R.id.emailEt);

    loginProgressWheel = (LinearLayout) findViewById(R.id.mainloginprogresswheel);
    registerProgressWheel = (LinearLayout) findViewById(R.id.mainregisterprogresswheel);

    loginProgressWheel.setVisibility(View.GONE);
    registerProgressWheel.setVisibility(View.GONE);


    tologinnavigator = (LinearLayout) findViewById(R.id.tologintext);
    toregisternavigator = (LinearLayout) findViewById(R.id.toregistertext);

    viewAnimator = (ViewAnimator) findViewById(R.id.loginviewanimator);
    credentialsanimator = (ViewAnimator) findViewById(R.id.credentialsanimator);

    fade_in = AnimationUtils.loadAnimation(this, android.R.anim.fade_in);
    fade_out = AnimationUtils.loadAnimation(this, android.R.anim.fade_out);

    slide_left = AnimationUtils.loadAnimation(this, android.R.anim.slide_in_left);
    slide_right = AnimationUtils.loadAnimation(this, android.R.anim.slide_out_right);

    viewAnimator.setInAnimation(fade_in);
    viewAnimator.setOutAnimation(fade_out);

    credentialsanimator.setInAnimation(fade_in);
    credentialsanimator.setOutAnimation(fade_out);



}
 
開發者ID:mstfnacar,項目名稱:foodfeed,代碼行數:45,代碼來源:MainActivity.java

示例5: flipTransition

import android.widget.ViewAnimator; //導入方法依賴的package包/類
/**
 * Flip to the next view of the {@code ViewAnimator}'s subviews. A call to this method will initiate a {@link FlipAnimation} to show the next View.  
 * If the currently visible view is the last view, flip direction will be reversed for this transition.
 *  
 * @param viewAnimator the {@code ViewAnimator}
 * @param dir the direction of flip
 */
public static void flipTransition(final ViewAnimator viewAnimator, FlipDirection dir) {   
	
	final View fromView = viewAnimator.getCurrentView();
	final int currentIndex = viewAnimator.getDisplayedChild();
	final int nextIndex = (currentIndex + 1)%viewAnimator.getChildCount();
	
	final View toView = viewAnimator.getChildAt(nextIndex);

	Animation[] animc = AnimationFactory.flipAnimation(fromView, toView, (nextIndex < currentIndex?dir.theOtherDirection():dir), 500, null);
 
	viewAnimator.setOutAnimation(animc[0]);
	viewAnimator.setInAnimation(animc[1]);
	
	viewAnimator.showNext();   
}
 
開發者ID:adiguzel,項目名稱:wordwise,代碼行數:23,代碼來源:AnimationFactory.java

示例6: createView

import android.widget.ViewAnimator; //導入方法依賴的package包/類
/**
 * Creates the base view of this object.
 */
public void createView() {
	if (p == null)
		return;	
	setTitle(p.getTitle());
	View procedureView = wrapViewWithInterface(p.toView(this));

	// Now that the view is active, go to the correct page.
	if(p.getCurrentIndex() != startPage) {
		p.jumpToPage(startPage);
		updateNextPrev();            
	}

	baseViews = new ViewAnimator(this);
	baseViews.setBackgroundResource(android.R.drawable.alert_dark_frame);
	baseViews.setInAnimation(AnimationUtils.loadAnimation(this,
			R.anim.slide_from_right));
	baseViews.setOutAnimation(AnimationUtils.loadAnimation(this,
			R.anim.slide_to_left));
	baseViews.addView(procedureView);

	// This should add it to baseViews, so don't add it manually.
	View procedureDonePage = getLayoutInflater().inflate(
			R.layout.procedure_runner_done, baseViews);
	((TextView)procedureDonePage.findViewById(R.id.procedure_done_text))
		.setTextAppearance(this, android.R.style.TextAppearance_Large);
	procedureDonePage.findViewById(R.id.procedure_done_back)
		.setOnClickListener(this);
	procedureDonePage.findViewById(R.id.procedure_done_upload)
		.setOnClickListener(this);

	if(onDonePage) {
		baseViews.setInAnimation(null);
		baseViews.setOutAnimation(null);
		baseViews.showNext();
		baseViews.setInAnimation(AnimationUtils.loadAnimation(this,
				R.anim.slide_from_right));
		baseViews.setOutAnimation(AnimationUtils.loadAnimation(this,
				R.anim.slide_to_left));
	}

	setContentView(baseViews);
	setProgressBarVisibility(true);
	setProgress(0);
}
 
開發者ID:SahilArora92,項目名稱:vit-04,代碼行數:48,代碼來源:ProcedureRunner.java

示例7: flipTransition

import android.widget.ViewAnimator; //導入方法依賴的package包/類
/**
 * Flip to the next view of the {@code ViewAnimator}'s subviews. A call to this method will initiate a {@link FlipAnimation} to show the next View.  
 * If the currently visible view is the last view, flip direction will be reversed for this transition.
 *  
 * @param viewAnimator the {@code ViewAnimator}
 * @param dir the direction of flip
 * @param duration the transition duration in milliseconds
 */
public static void flipTransition(final ViewAnimator viewAnimator, FlipDirection dir, long duration) {   
	
	final View fromView = viewAnimator.getCurrentView();
	final int currentIndex = viewAnimator.getDisplayedChild();
	final int nextIndex = (currentIndex + 1)%viewAnimator.getChildCount();
	
	final View toView = viewAnimator.getChildAt(nextIndex);

	Animation[] animc = AnimationFactory.flipAnimation(fromView, toView, (nextIndex < currentIndex?dir.theOtherDirection():dir), duration, null);
 
	viewAnimator.setOutAnimation(animc[0]);
	viewAnimator.setInAnimation(animc[1]);
	
	viewAnimator.showNext();   
}
 
開發者ID:Vosie,項目名稱:WikiCards,代碼行數:24,代碼來源:AnimationFactory.java

示例8: createView

import android.widget.ViewAnimator; //導入方法依賴的package包/類
/** Creates the base view of this object. */
public void createView() {
    Log.i(TAG, "createView()");
    if (mProcedure == null)
        return;
    getActivity().setTitle(mProcedure.getTitle());
    View procedureView = wrapViewWithInterface(mProcedure.toView(getActivity()));

    // Now that the view is active, go to the correct page.
    if (mProcedure.getCurrentIndex() != startPage) {
        mProcedure.jumpToPage(startPage);
        updateNextPrev();
    }

    baseViews = new ViewAnimator(getActivity());
    baseViews.setBackgroundResource(android.R.drawable.alert_dark_frame);
    baseViews.setInAnimation(AnimationUtils.loadAnimation(getActivity(),
            R.anim.slide_from_right));
    baseViews
            .setOutAnimation(AnimationUtils.loadAnimation(getActivity(), R.anim.slide_to_left));
    baseViews.addView(procedureView);

    // This should add it to baseViews, so don't add it manually.
    if(isShowCompleteConfirmation()) {
        View procedureDonePage = getActivity().getLayoutInflater().inflate(
                R.layout.procedure_runner_done, baseViews);
        ((TextView) procedureDonePage.findViewById(R.id.procedure_done_text)).setTextAppearance(
                getActivity(), android.R.style.TextAppearance_Large);
        procedureDonePage.findViewById(R.id.procedure_done_back).setOnClickListener(this);
        procedureDonePage.findViewById(R.id.procedure_done_upload).setOnClickListener(this);
    }
    if (onDonePage) {
        baseViews.setInAnimation(null);
        baseViews.setOutAnimation(null);
        baseViews.showNext();
        baseViews.setInAnimation(AnimationUtils.loadAnimation(getActivity(),
                R.anim.slide_from_right));
        baseViews.setOutAnimation(AnimationUtils.loadAnimation(getActivity(),
                R.anim.slide_to_left));
    }

    setContentView(baseViews);
    getActivity().setProgressBarVisibility(true);
    getActivity().setProgress(0);
}
 
開發者ID:SanaMobile,項目名稱:sana.mobile,代碼行數:46,代碼來源:BaseRunnerFragment.java

示例9: flipTransition

import android.widget.ViewAnimator; //導入方法依賴的package包/類
/**
 * Flip to the next view of the {@code ViewAnimator}'s subviews. A call to this method will initiate a {@link FlipAnimation} to show the next View.
 * If the currently visible view is the last view, flip direction will be reversed for this transition.
 *
 * @param viewAnimator the {@code ViewAnimator}
 * @param dir          the direction of flip
 */
public static void flipTransition(final ViewAnimator viewAnimator, FlipDirection dir) {

    final View fromView = viewAnimator.getCurrentView();
    final int currentIndex = viewAnimator.getDisplayedChild();
    final int nextIndex = (currentIndex + 1) % viewAnimator.getChildCount();

    final View toView = viewAnimator.getChildAt(nextIndex);

    Animation[] animc = AnimationFactory.flipAnimation(fromView, toView, (nextIndex < currentIndex ? dir.theOtherDirection() : dir), 500, null);

    viewAnimator.setOutAnimation(animc[0]);
    viewAnimator.setInAnimation(animc[1]);

    viewAnimator.showNext();
}
 
開發者ID:RandoApp,項目名稱:Rando-android,代碼行數:23,代碼來源:AnimationFactory.java

示例10: fadeTransition

import android.widget.ViewAnimator; //導入方法依賴的package包/類
/**
 * Fades out the current view to the next view of the {@code ViewAnimator}'s subviews with a fade in
 * effect. If the currently visible view is the last view, fade will restore the front view.
 * 
 * @param viewAnimator
 * @param fadeOutDuration
 * @param fadeInDuration
 */
public static void fadeTransition(final ViewAnimator viewAnimator, long fadeOutDuration, long fadeInDuration) {

	final View fromView = viewAnimator.getCurrentView();
	final int currentIndex = viewAnimator.getDisplayedChild();
	final int nextIndex = (currentIndex + 1) % viewAnimator.getChildCount();

	final View toView = viewAnimator.getChildAt(nextIndex);
	
	Animation[] animc = fadeTransition(fromView, toView, fadeOutDuration, fadeInDuration);
	
	viewAnimator.setOutAnimation(animc[0]);
	viewAnimator.setInAnimation(animc[1]);
	viewAnimator.showNext();
	
}
 
開發者ID:javocsoft,項目名稱:javocsoft-toolbox,代碼行數:24,代碼來源:AnimationFactory.java

示例11: flipTransition

import android.widget.ViewAnimator; //導入方法依賴的package包/類
private static Animation[] flipTransition(final ViewAnimator viewAnimator, FlipDirection dir, long duration, Interpolator interpolator, @FloatRange(from = 0.0, to = 1.0) float scale) {


        Animation[] animations = flipAnim(viewAnimator, dir, duration, interpolator, scale);

        viewAnimator.setOutAnimation(animations[0]);
        viewAnimator.setInAnimation(animations[1]);
        viewAnimator.showNext();
        return animations;
    }
 
開發者ID:canyinghao,項目名稱:CanAnimation,代碼行數:11,代碼來源:CanFlipAnimation.java


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