Android ViewFlipper - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android ViewFlipper class.

This code example shows how to use the following methods:setInAnimation, setOutAnimation, showPrevious
This code example shows how to use the following methods:showNext
     
    flipper=(ViewFlipper)findViewById(R.id.details);
  } 
   
  public void flip(View v) {
    flipper.showNext();
  } 
} 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setLayoutParams, addView, setDisplayedChild
		// Flipper layout 
		LayoutParams flipperParams = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
		flipperParams.gravity = Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL;
		 
		iconFlipper = new SafeViewFlipper(getContext());
		iconFlipper.setLayoutParams(flipperParams);
		iconFlipper.addView(imageLayout, 0);
		iconFlipper.addView(progressLayout, 1);
		iconFlipper.setDisplayedChild(0);	
 
		 
/****************************************** 
 * Assembly 
 ******************************************/		 
		addView(iconFlipper);
		addView(textLayout);
	} 
 
	public void setDisplayUtils(DisplayUtils deviceUtils) {
		this.displayUtils = deviceUtils;
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getChildCount, getDisplayedChild
	protected boolean isFirstDisplayed() { 
		return (flipper.getDisplayedChild() == 0);
	} 
 
	protected boolean isLastDisplayed() { 
		return (flipper.getDisplayedChild() == flipper.getChildCount() - 1);
	} 
 
	protected void updateButtons() { 
		boolean eula = (flipper.getDisplayedChild() == 0);
 
		next.setText(eula ? getString(R.string.wizard_agree) : getString(R.string.wizard_next));
		prev.setText(eula ? getString(R.string.delete_neg) : getString(R.string.wizard_back));
	} 
} 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getChildAt, getDisplayedChild, setInAnimation, setOutAnimation, showPrevious
    /** 
     * 前月を表示する 
     * @param direction モーションの方向をセット(DIRECTION_VERTICAL|DIRECTION_HORIZONTAL) 
     */ 
    private void showPreviousMonth(int direction) {
        int index = this.viewFlipper.getDisplayedChild() == 0 ? 1 : 0;
        MonthlyCalendarView calendarView = 
            (MonthlyCalendarView)this.viewFlipper.getChildAt(index);
        if ( calendarView != null ) {
            calendarView.setCalendar(this.calendar);
            this.setHeader(this.calendar.get(java.util.Calendar.YEAR)
                    , calendar.get(java.util.Calendar.MONTH));
            if ( direction == DIRECTION_VERTICAL ) {
                this.viewFlipper.setInAnimation(inFromTop);
                this.viewFlipper.setOutAnimation(outToBottom);
            } else { 
                this.viewFlipper.setInAnimation(inFromLeft);
                this.viewFlipper.setOutAnimation(outToRight);
            } 
            this.viewFlipper.showPrevious();

6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setInAnimation, setOutAnimation, showNext, showPrevious
	case MotionEvent.ACTION_UP:
		 
		float currentX=event.getX();
		 
		if(currentX>oldTouchValue){
			page.setInAnimation(AnimationHelper.inFromLeftAnimation());
			page.setOutAnimation(AnimationHelper.outToRightAnimation());
			page.showNext();
			 
		} 
		 
		if(currentX<oldTouchValue){
			page.setInAnimation(AnimationHelper.inFromRightAnimation());
			page.setOutAnimation(AnimationHelper.outToLeftAnimation());
			page.showPrevious();}
		 
		break; 
	} 
	return false; 
} 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setInAnimation, setOutAnimation, showPrevious
This code example shows how to use the following methods:addView, getChildAt, removeViewAt, setInAnimation, setOutAnimation
		player.getActivity().setContentView(scrollView);	
	} 
	 
	public void refresh() { 
		if(flipper==null) return;
		View currentView = flipper.getChildAt(pageDepth);
		if(currentView==null) return;
		CommandPage page = (CommandPage) currentView.getTag();
		if(page==null) return;
		flipper.setInAnimation(null);
		flipper.setOutAnimation(null);
		flipper.removeViewAt(pageDepth);
		flipper.addView(page.getPage());
		flipper.showNext();	
	} 
 
	public void next(View view) {
		player.setMainTitle();
		flipper.addView(view);
		flipper.setInAnimation(inFromRightAnimation());
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getInAnimation, getOutAnimation, setDisplayedChild, setInAnimation, setOutAnimation
     * Set the displayed child. 
     *  
     * @param whichChild 
     */ 
    private void setDisplayedChild(int whichChild) {
        Animation lastOutAnim = mViewFlipper.getOutAnimation();
        Animation lastInAnim = mViewFlipper.getInAnimation();
        mViewFlipper.setOutAnimation(null);
        mViewFlipper.setInAnimation(null);
        mViewFlipper.setDisplayedChild(whichChild);
        mViewFlipper.setOutAnimation(lastOutAnim);
        mViewFlipper.setInAnimation(lastInAnim);
    } 
 
    /** 
     * Find the view flipper in the content view. 
     */ 
    private void findViewFlipper() { 
        mViewFlipper = (ViewFlipper) findViewById(R.id.viewflipper);
        if (mViewFlipper == null) {
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setInAnimation, setOutAnimation, showPrevious
            float dx = Math.abs(velocityX); 
            float dy = Math.abs(velocityY); 
 
            if (dx > dy && dx > 150) { 
                if (e1.getX() < e2.getX()) { 
                    viewFlipper.setInAnimation(inFromLeft); 
                    viewFlipper.setOutAnimation(outToRight); 
                    viewFlipper.showPrevious(); 
                    setDataLogic.leftToRightLogic(); 
                } else { 
                    viewFlipper.setInAnimation(inFromRight); 
                    viewFlipper.setOutAnimation(outToLeft); 
                    viewFlipper.showNext(); 
                    setDataLogic.rightToLeftLogic(); 
                } 
                setDataLogic.setDataLogic(); 
                Log.d("BBT", "OnGestureListener.onFling"); 
                return true; 
            } 
 
6
CodeRank
Experience pair programming with AI  Get Codota for Java

Related Android ViewFlipper Questions & Answers:

See Code Examples for Android ViewFlipper Methods: