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


Java ViewAnimator.showNext方法代码示例

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


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

import android.widget.ViewAnimator; //导入方法依赖的package包/类
@Override
	public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
//        tryFlipToPreviousView(viewAnimator);

		if (view instanceof ViewAnimator) {
			final ViewAnimator viewAnimator = (ViewAnimator)view;
			viewAnimator.showNext();

			return true;
		}
		return false;
	}
 
开发者ID:danrien,项目名称:projectBlue,代码行数:13,代码来源:LongClickViewAnimatorListener.java

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

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

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

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

示例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:RandoApp,项目名称:Rando-android,代码行数:23,代码来源:AnimationFactory.java

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

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