Code example for ViewFlipper

Methods: getChildAtgetDisplayedChildsetInAnimationsetOutAnimationshowNext

0
    /** 
     * 次月を表示する 
     * @param direction モーションの方向をセット(DIRECTION_VERTICAL|DIRECTION_HORIZONTAL) 
     */ 
    private void showNextMonth(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(inFromBottom);
                this.viewFlipper.setOutAnimation(outToTop);
            } else { 
                this.viewFlipper.setInAnimation(inFromRight);
                this.viewFlipper.setOutAnimation(outToLeft);
            } 
            this.viewFlipper.showNext();
        } 
    } 
    /** 
     * 対象の年月を表示します 
     * @param year 年をセット 
Connect your IDE to all the code out there  Get Codota for Java