Beispiel #1
0
        void OnRecycledItemGeometryChanged(ReusableCollectionItem item)
        {
            var rItem = item;

            if (rItem.index == ReusableCollectionItem.UndefinedIndex || float.IsNaN(rItem.rootElement.layout.height) || rItem.rootElement.layout.height == 0)
            {
                return;
            }

            if (rItem.animator != null && rItem.animator.isRunning)
            {
                return;
            }

            var previousHeight = GetItemHeight(rItem.index);

            if (!m_ItemHeightCache.TryGetValue(rItem.index, out var height) || !rItem.rootElement.layout.height.Equals(height))
            {
                RegisterItemHeight(rItem.index, rItem.rootElement.layout.height);
                UpdateScrollViewContainer(rItem.index, previousHeight, rItem.rootElement.layout.height);

                if (m_WaitingCache.Count == 0)
                {
                    ApplyScrollViewUpdate();
                }
            }

            if (m_WaitingCache.Remove(rItem.index) && m_WaitingCache.Count == 0)
            {
                ApplyScrollViewUpdate();
            }
        }
 internal override void InvokeMakeItem(ReusableCollectionItem reusableItem)
 {
     if (reusableItem is ReusableListViewItem listItem)
     {
         listItem.Init(MakeItem(), baseListView.reorderable && baseListView.reorderMode == ListViewReorderMode.Animated);
         PostInitRegistration(listItem);
     }
 }
        internal override void InvokeBindItem(ReusableCollectionItem reusableItem, int index)
        {
            if (reusableItem is ReusableListViewItem listItem)
            {
                var usesAnimatedDragger = baseListView.reorderable && baseListView.reorderMode == ListViewReorderMode.Animated;
                listItem.UpdateDragHandle(usesAnimatedDragger && NeedsDragHandle(index));
            }

            base.InvokeBindItem(reusableItem, index);
        }
Beispiel #4
0
 internal override void InvokeMakeItem(ReusableCollectionItem reusableItem)
 {
     if (reusableItem is ReusableMultiColumnTreeViewItem treeItem)
     {
         treeItem.Init(MakeItem(), m_ColumnController.header.columns);
         PostInitRegistration(treeItem);
     }
     else
     {
         base.InvokeMakeItem(reusableItem);
     }
 }
 internal override void InvokeMakeItem(ReusableCollectionItem reusableItem)
 {
     if (reusableItem is ReusableMultiColumnListViewItem listItem)
     {
         listItem.Init(MakeItem(), m_ColumnController.header.columns, baseListView.reorderMode == ListViewReorderMode.Animated);
         PostInitRegistration(listItem);
     }
     else
     {
         base.InvokeMakeItem(reusableItem);
     }
 }
Beispiel #6
0
        void HandleFocus(ReusableCollectionItem recycledItem, int previousIndex)
        {
            if (m_LastFocusedElementIndex == -1)
            {
                return;
            }

            if (m_LastFocusedElementIndex == recycledItem.index)
            {
                recycledItem.rootElement.ElementAtTreePath(m_LastFocusedElementTreeChildIndexes)?.Focus();
            }
            else if (m_LastFocusedElementIndex != previousIndex)
            {
                recycledItem.rootElement.ElementAtTreePath(m_LastFocusedElementTreeChildIndexes)?.Blur();
            }
            else
            {
                m_ScrollView.contentContainer.Focus();
            }
        }