}
else
{
- TableViewItemTag topDrawnTag = {-1, -1};
- float shiftingDistance = 0;
+ if (IsEmpty())
+ {
+ __pListModel->RemoveAllItem(false, false);
- ResetSweepItem();
+ PreloadItem();
+ }
+ else
+ {
+ TableViewItemTag topDrawnTag = {-1, -1};
+ float shiftingDistance = 0;
- GetTopDrawnItem(topDrawnTag);
+ ResetSweepItem();
- if (__pListModel->IsValidItem(topDrawnTag.groupIndex, topDrawnTag.itemIndex))
- {
- _TableViewItem* pItem = FindItem(topDrawnTag);
+ GetTopDrawnItem(topDrawnTag);
- if (pItem != null)
+ if (__pListModel->IsValidItem(topDrawnTag.groupIndex, topDrawnTag.itemIndex))
{
- shiftingDistance = GetScrollPosition() - pItem->GetBoundsF().y;
+ _TableViewItem* pItem = FindItem(topDrawnTag);
+
+ if (pItem != null)
+ {
+ shiftingDistance = GetScrollPosition() - pItem->GetBoundsF().y;
+ }
}
- }
- __pListModel->RemoveAllItem(false, true);
+ __pListModel->RemoveAllItem(false, true);
- PreloadItem(topDrawnTag.groupIndex, topDrawnTag.itemIndex, shiftingDistance);
+ PreloadItem(topDrawnTag.groupIndex, topDrawnTag.itemIndex, shiftingDistance);
- __statusChangedFlag = true;
+ __statusChangedFlag = true;
- if (__itemTouchReleasedEventState == TABLE_VIEW_ITEM_TOUCH_RELEASED_EVENT_FIRE)
- {
- __itemTouchReleasedEventState = TABLE_VIEW_ITEM_TOUCH_RELEASED_EVENT_UPDATE_TABLE_VIEW;
+ if (__itemTouchReleasedEventState == TABLE_VIEW_ITEM_TOUCH_RELEASED_EVENT_FIRE)
+ {
+ __itemTouchReleasedEventState = TABLE_VIEW_ITEM_TOUCH_RELEASED_EVENT_UPDATE_TABLE_VIEW;
+ }
}
}