ViewAnimator setOutAnimation - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for ViewAnimator setOutAnimation method.

This code example shows how to use the following methods:setInAnimation, setOutAnimation
	public void goNext(String url) {
		Animation out = AnimationUtils.loadAnimation(context,
				android.R.anim.slide_out_right);
		Animation in = AnimationUtils.loadAnimation(context,
				android.R.anim.slide_in_left);
		viewAnimator.setInAnimation(in);
		viewAnimator.setOutAnimation(out);
		this.url = url;
		setWebView(); 
	} 
 
	public void goPrevious(String url) {
		Animation out = AnimationUtils.loadAnimation(context, R.anim.fade_in);
		Animation in = AnimationUtils.loadAnimation(context, R.anim.fade_out);
		viewAnimator.setInAnimation(in);
		viewAnimator.setOutAnimation(out);
		this.url = url;
		setWebView(); 
	} 
 
7
CodeRank
This code example shows how to use the following methods:getChildAt, getChildCount, getCurrentView, getDisplayedChild, setDisplayedChild
	 * @param viewAnimator the {@code ViewAnimator} 
	 * @param dir the direction of flip 
	 */ 
	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, dir, duration);
   
		viewAnimator.setOutAnimation(animc[0]);
		viewAnimator.setInAnimation(animc[1]);
		 
		viewAnimator.setDisplayedChild(nextIndex); 
	} 
	 

6
CodeRank
This code example shows how to use the following methods:setInAnimation, setOutAnimation, showPrevious
This code example shows how to use the following methods:getContext, setText, setInAnimation, setOutAnimation, setFactory
 
    /** 
     * Initializes the score TextSwitcher for the specified {@code textSwitcher}. 
     */ 
    private void initializeTextSwitcher(final TextSwitcher textSwitcher) {
        textSwitcher.setFactory(new ViewSwitcher.ViewFactory() {
            @Override 
            public View makeView() {
                TextView textView = new TextView(textSwitcher.getContext());
                textView.setTextSize(26);
                return textView;
            } 
        }); 
 
        textSwitcher.setInAnimation(AnimationUtils.loadAnimation(textSwitcher.getContext(), android.R.anim.fade_in));
        textSwitcher.setOutAnimation(AnimationUtils.loadAnimation(textSwitcher.getContext(), android.R.anim.fade_out));
        textSwitcher.setText("1");
    } 
 
} 

6
CodeRank
This code example shows how to use the following methods:addView, setDisplayedChild, setInAnimation, setOutAnimation
        mIntents.put(id, intent);
        System.out.println("adding " + intent);
 
        View view = mActivityManager.startActivity(id, intent).getDecorView();
        int size = mIdList.size();
        mAnimator.setInAnimation(size > 1? getAnimation(intent, true, true) : null);
        mAnimator.setOutAnimation(size > 1? getAnimation(intent, true, false) : null);
        mAnimator.addView(view);
        mAnimator.setDisplayedChild(mIdList.size() - 1);
    } 
     
    public void startChildActivity(String id1,Intent intent)
    { 
    	System.out.println("starting " + intent);
    	String id = "id" + mSerial++;
        mIdList.push(id);
        mIntents.put(id, intent);
        System.out.println("adding " + intent);
 
        View view = mActivityManager.startActivity(id, intent).getDecorView();
6
CodeRank
This code example shows how to use the following methods:addView, getChildAt, getChildCount, removeViewAt, setInAnimation
	 * TODO remove 
	 * May return null 
	 */ 
	@Deprecated 
	public static View swap(ViewAnimator flipper, View view, Animation in, Animation out) {
		flipper.setInAnimation(in);
		flipper.setOutAnimation(out);
		 
		View returned = null;
		 
		if (flipper.getChildCount() == 2) {
			returned = flipper.getChildAt(0);
			flipper.removeViewAt(0);
		} 
		 
		flipper.addView(view);
		flipper.showNext();
		 
		return returned;
	} 

6
CodeRank
This code example shows how to use the following methods:addView, setInAnimation, setOutAnimation
	GestureDetector gd;
 
	@Override 
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		va = new ViewAnimator(this);
		va.setInAnimation(inFromLeftAnimation());
		va.setOutAnimation(outToRightAnimation());
		TextView tv1 = new TextView(this);
		tv1.setText("TESTAAAAAA");
		tv1.setBackgroundColor(Color.DKGRAY);
		TextView tv2 = new TextView(this);
		tv2.setText("TESTBBBBBB");
		tv2.setBackgroundColor(Color.GRAY);
		va.addView(tv1, 0);
		va.addView(tv2, 1);
		gd = new GestureDetector(this, this);
		setContentView(va);
	} 
 
	@Override 
6
CodeRank
This code example shows how to use the following methods:setText, getInAnimation, getOutAnimation, setInAnimation, setOutAnimation
This code example shows how to use the following methods:addView, setInAnimation, setOutAnimation, showNext
						//could also be the action listener which is invalid 
						//ongoingAnimation=false; 
					}else { 
						 
						viewAnimator = (ViewAnimator)currentView;
						viewAnimator.addView(unboundNewView);
						//setup animation 
						 
						viewAnimator.setInAnimation(inAnimation);
						viewAnimator.setOutAnimation(outAnimation);
						//trigger the animation and the event listener when finished 
						ongoingAnimation=true;
						viewAnimator.showNext();
						 
					} 
				} 
				return true; 
			} 
 
			return super.onKeyDown(keyCode, event);
6
CodeRank
This code example shows how to use the following methods:getDisplayedChild, setInAnimation, setOutAnimation, showNext
				} 
			} 
        }); 
        rightBtn.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				if (animator.getDisplayedChild() == 0) {
			        title.setText("step #2");
			        leftBtn.setText("back");
					rightBtn.setText("ok");
					animator.setInAnimation(slideInLeft);
					animator.setOutAnimation(slideOutLeft);
					animator.showNext();
				} else { 
					String msg = "don't be suprized, but your first name is [" +
						firstName.getText() + "] and your last name is [" +
						lastName.getText() + "]";
					new AlertDialog.Builder(TestCustomTitle.this).setMessage(msg)
						.setTitle("hmmm...")
						.setIcon(android.R.drawable.ic_dialog_info)
						.setPositiveButton("ok", null)
6
CodeRank

Related ViewAnimator setOutAnimation Questions & Answers:

setOutAnimation Method Overview
Specifies the animation used to animate a View that exit the screen.
See Code Examples for other Android ViewAnimator Methods: