code: public void setMode(int mode, boolean animation){
          if(mMode != mode){
              mMode = mode;
  
              if(mOnTimeChangedListener != null)
                  mOnTimeChangedListener.onModeChanged(mMode);
  
              if(animation)
                  startAnimation();
              else
                  invalidate();
          }
      }
docs: Set the select mode of this TimePicker.
  @param mode The select mode. Can be {@link #MODE_HOUR} or {@link #MODE_MINUTE}.
  @param animation Indicate that should show animation when switch select mode or not.