Пример #1
0
        public virtual void SetAdapter(IAdapter adapter)
        {
            _adapter = adapter;

            TotalItemCount = _adapter.GetCount();
            ItemPrefab     = _adapter.GetItemPrototype();
            ItemSize       = _adapter.GetItemSize();

            CalculateContentSize();
            CalculateVisibleItemCount();

            ClearAllItems();
            RepositionItems();
        }
Пример #2
0
        public void SetAdapter(IAdapter adapter)
        {
            _adapter = adapter;

            TotalPageCount = adapter.GetCount();
            ItemPrefab     = adapter.GetItemPrototype();

            _curPageIndex      = 0;
            NormalizedPosition = PageIndexToNormalizedPosition(_curPageIndex);

            CalculateContentSize();
            CalculateVisibleItemCount();

            StopScroll();

            ClearAllItems();
            RepositionItems();
        }