当前位置: 首页>>代码示例>>Java>>正文


Java ViewAnimator.setInAnimation方法代码示例

本文整理汇总了Java中android.widget.ViewAnimator.setInAnimation方法的典型用法代码示例。如果您正苦于以下问题:Java ViewAnimator.setInAnimation方法的具体用法?Java ViewAnimator.setInAnimation怎么用?Java ViewAnimator.setInAnimation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.widget.ViewAnimator的用法示例。


在下文中一共展示了ViewAnimator.setInAnimation方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: switchView

import android.widget.ViewAnimator; //导入方法依赖的package包/类
@UiThread
void switchView(View parentView, int showView) {
    if (parentView == null)
        return;
    FilesListAdapter.ViewHolder holder = (FilesListAdapter.ViewHolder) parentView.getTag();

    ViewAnimator viewAnimator = holder.animator;
    viewAnimator.setInAnimation(context, R.anim.slide_down);
    int viewIndex = 0;
    switch (showView) {
        case R.id.dataLayout:
            viewIndex = 0;
            break;
        case R.id.DecryptLayout:
            viewIndex = 1;
            break;
    }
    viewAnimator.setDisplayedChild(viewIndex);
    holder.page = viewIndex;
}
 
开发者ID:SecrecySupportTeam,项目名称:Secrecy_fDroid_DEPRECIATED,代码行数:21,代码来源:FilesListFragment.java

示例3: 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

示例4: useCodeAnimation

import android.widget.ViewAnimator; //导入方法依赖的package包/类
private void useCodeAnimation(ViewAnimator pages) {
	// 用代码定义一个动画
	AnimationSet slideAnimationSet = new AnimationSet(true);

	// 平移动画
	TranslateAnimation slide = new TranslateAnimation(
			Animation.RELATIVE_TO_PARENT, 1f, Animation.RELATIVE_TO_PARENT,
			0, Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 0);

	// 缩放动画
	ScaleAnimation scale = new ScaleAnimation(10, 1, 10, 1);
	// 把平移和缩放动画加入动画集合
	slideAnimationSet.addAnimation(slide);
	slideAnimationSet.addAnimation(scale);

	// 持续时间设置为1000ms
	slideAnimationSet.setDuration(1000);

	// 设置动画
	pages.setInAnimation(slideAnimationSet);
}
 
开发者ID:mengdd,项目名称:AnimationApiDemos,代码行数:22,代码来源:BookActivity.java

示例5: 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

示例6: switchView

import android.widget.ViewAnimator; //导入方法依赖的package包/类
@UiThread
void switchView(final View parentView, int showView) {
    EditText passwordView = (EditText) parentView.findViewById(R.id.open_password);
    View renameView = parentView.findViewById(R.id.rename_name);
    ViewAnimator viewAnimator = (ViewAnimator) parentView.findViewById(R.id.viewAnimator);
    viewAnimator.setInAnimation(context, R.anim.slide_down);
    int viewIndex = 0;
    switch (showView) {
        case R.id.vault_name_layout:
            viewIndex = 0;
            break;
        case R.id.vault_decrypt_layout:
            viewIndex = 1;
            if (passwordView != null) {
                passwordView.requestFocus();
                passwordView.setText("");                               //Reset password field everytime
            }
            break;
        case R.id.vault_delete_layout:
            viewIndex = 2;
            break;
        case R.id.vault_rename_layout:
            viewIndex = 3;
            if (renameView != null)
                renameView.requestFocus();
            break;
    }
    viewAnimator.setDisplayedChild(viewIndex);
}
 
开发者ID:SecrecySupportTeam,项目名称:Secrecy_fDroid_DEPRECIATED,代码行数:30,代码来源:VaultsListFragment.java

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

示例8: 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

示例9: 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

示例10: 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

示例11: 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

示例12: 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

示例13: 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

示例14: 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.setInAnimation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。