Example #1
0
void UIListView::updateChild()
{
    switch (_direction)
    {
        case LISTVIEW_DIR_VERTICAL: // vertical
            switch (_moveDirection)
            {
                case LISTVIEW_MOVE_DIR_UP: // up
                    {
                        int count = _overTopArray->count();
                        for (int i = 0; i < count; ++i)
                        {
                            pushChildToPool();
                            getAndCallback();
                        }
                    }
                    break;
                    
                case LISTVIEW_MOVE_DIR_DOWN: // down
                    {
                        int count = _overBottomArray->count();
                        for (int i = 0; i < count; ++i)
                        {
                            pushChildToPool();
                            getAndCallback();
                        }
                    }
                    break;
                    
                default:
                    break;
            }
            break;
            
        case LISTVIEW_DIR_HORIZONTAL: // horizontal
            switch (_moveDirection)
            {
                case LISTVIEW_MOVE_DIR_LEFT: // left
                    {
                        int count = _overLeftArray->count();
                        for (int i = 0; i < count; ++i)
                        {
                            pushChildToPool();
                            getAndCallback();
                        }
                    }
                    break;
                    
                case LISTVIEW_MOVE_DIR_RIGHT: // right
                    {
                        int count = _overRightArray->count();
                        for (int i = 0; i < count; ++i)
                        {
                            pushChildToPool();
                            getAndCallback();
                        }
                    }
                    break;
                    
                default:
                    break;
            }
            break;
            
        default:
            break;
    }
}
void UIListView::updateChild()
{
    switch (m_eDirection)
    {
        case SCROLLVIEW_DIR_VERTICAL: // vertical
            switch (m_eMoveDirection)
            {
                case SCROLLVIEW_MOVE_DIR_UP: // up
                    {
                        int count = m_overTopArray->count();
                        for (int i = 0; i < count; ++i)
                        {
                            if (m_nEnd < m_nDataLength - 1)
                            {
                                pushChildToPool();
                                getAndCallback();
                            }
                        }                            
                    }
                    break;
                    
                case SCROLLVIEW_MOVE_DIR_DOWN: // down
                    {
                        int count = m_overBottomArray->count();
                        for (int i = 0; i < count; ++i)
                        {
                            if (m_nBegin > 0)
                            {
                                pushChildToPool();
                                getAndCallback();                                        
                            }
                        }
                    }
                    break;
                    
                default:
                    break;
            }
            break;
            
        case SCROLLVIEW_DIR_HORIZONTAL: // horizontal
            switch (m_eMoveDirection)
            {
                case SCROLLVIEW_MOVE_DIR_LEFT: // left
                    {
                        int count = m_overLeftArray->count();
                        for (int i = 0; i < count; ++i)
                        {
                            if (m_nEnd < m_nDataLength - 1)
                            {
                                pushChildToPool();
                                getAndCallback();
                            }
                        }
                    }
                    break;
                    
                case SCROLLVIEW_MOVE_DIR_RIGHT: // right
                    {
                        int count = m_overBottomArray->count();
                        for (int i = 0; i < count; ++i)
                        {
                            if (m_nBegin > 0)
                            {
                                pushChildToPool();
                                getAndCallback();
                            }
                        }
                    }
                    break;
                    
                default:
                    break;
            }
            break;
            
        default:
            break;
    }
}