, __pEmptyBitmap(null)
, __pEmptyText(null)
, __redrawListView(true)
+ , __isBoundsChanged(false)
, __pItemNeedsLazyDeletion(null)
, __pTouchEventHandler(null)
, __pLongPressedGesture(null)
}
result
-_GroupedListViewImpl::RefreshList(int groupIndex, int itemIndex, ListRefreshType type)
+_GroupedListViewImpl::RefreshList(int groupIndex, int itemIndex, ListRefreshType type, bool needFlush)
{
result r = E_SUCCESS;
CheckEmptyListShowState();
- Draw();
- Show();
+ if (needFlush)
+ {
+ Draw();
+ Show();
+ }
SetLastResultReturn(r);
}
}
}
+result
+_GroupedListViewImpl::OnBoundsChanging(const Tizen::Graphics::FloatRectangle& bounds)
+{
+ if (GetCore().GetBoundsF().width != bounds.width)
+ {
+ __isBoundsChanged = true;
+ }
+
+ return _ControlImpl::OnBoundsChanging(bounds);
+}
+
void
_GroupedListViewImpl::OnBoundsChanged(void)
{
SetTextOfEmptyList(__pEmptyText->GetText());
}
- _GroupedListViewItemProviderAdaptor* pProviderAdaptor =
- static_cast <_GroupedListViewItemProviderAdaptor*>(GetCore().GetItemProviderAdaptor());
-
- if (pProviderAdaptor != null)
+ if (__isBoundsChanged)
{
- float itemWidth = GetCore().GetBoundsF().width;
+ int firstGroup = -1;
+ int firstItem = -1;
+ int lastGroup = -1;
+ int lastItem = -1;
+ int currentItem = -1;
+ int lastItemInGroup = -1;
+
+ GetCore().GetFirstLoadedItemIndex(firstGroup, firstItem);
+ GetCore().GetLastLoadedItemIndex(lastGroup, lastItem);
- if (GetCore().GetTableViewStyle() == TABLE_VIEW_STYLE_SECTION)
+ for (int i = firstGroup; i <= lastGroup; i++)
{
- float margin = 0;
- GET_SHAPE_CONFIG(TABLEVIEW::GROUPITEM_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, margin);
+ currentItem = ((i == firstGroup) ? firstItem : -1);
+ lastItemInGroup = ((i == lastGroup) ? lastItem : GetCore().GetItemCountAt(i));
- itemWidth -= (margin * 2.0f);
+ for (; currentItem <= lastItemInGroup; currentItem++)
+ {
+ _ListViewItem* pListViewItem = static_cast<_ListViewItem*>(GetCore().FindItem(i, currentItem));
+
+ if (pListViewItem != null)
+ {
+ RefreshList(i, currentItem, LIST_REFRESH_TYPE_ITEM_MODIFY, false);
+ }
+ }
}
- pProviderAdaptor->SetListWidth(itemWidth);
+ __isBoundsChanged = false;
}
}
, __pEmptyBitmap(null)
, __pEmptyText(null)
, __redrawListView(true)
+ , __isBoundsChanged(false)
, __pItemNeedsLazyDeletion(null)
, __pTouchEventHandler(null)
, __pLongPressedGesture(null)
}
result
-_ListViewImpl::RefreshList(int index, ListRefreshType type)
+_ListViewImpl::RefreshList(int index, ListRefreshType type, bool needFlush)
{
result r = E_SUCCESS;
CheckEmptyListShowState();
- Draw();
- Show();
+ if (needFlush)
+ {
+ Draw();
+ Show();
+ }
SetLastResultReturn(r);
}
}
}
+result
+_ListViewImpl::OnBoundsChanging(const FloatRectangle& bounds)
+{
+ if (GetCore().GetBoundsF().width != bounds.width)
+ {
+ __isBoundsChanged = true;
+ }
+
+ return _ControlImpl::OnBoundsChanging(bounds);
+}
+
void
_ListViewImpl::OnBoundsChanged(void)
{
SetTextOfEmptyList(__pEmptyText->GetText());
}
- _ListViewItemProviderAdaptor* pProviderAdaptor = static_cast <_ListViewItemProviderAdaptor*>(GetCore().GetItemProviderAdaptor());
-
- if (pProviderAdaptor != null)
+ if (__isBoundsChanged)
{
- pProviderAdaptor->SetListWidth(GetCore().GetBoundsF().width);
+ int firstGroup = -1;
+ int firstItem = -1;
+ int lastGroup = -1;
+ int lastItem = -1;
+ int currentItem = -1;
+ int lastItemInGroup = -1;
+
+ GetCore().GetFirstLoadedItemIndex(firstGroup, firstItem);
+ GetCore().GetLastLoadedItemIndex(lastGroup, lastItem);
+
+ for (int i = firstGroup; i <= lastGroup; i++)
+ {
+ currentItem = ((i == firstGroup) ? firstItem : -1);
+ lastItemInGroup = ((i == lastGroup) ? lastItem : GetCore().GetItemCountAt(i));
+
+ for (; currentItem <= lastItemInGroup; currentItem++)
+ {
+ _ListViewItem* pListViewItem = static_cast<_ListViewItem*>(GetCore().FindItem(i, currentItem));
+
+ if (pListViewItem != null)
+ {
+ RefreshList(currentItem, LIST_REFRESH_TYPE_ITEM_MODIFY, false);
+ }
+ }
+ }
+
+ __isBoundsChanged = false;
}
}
result HideItemDescriptionText(int groupIndex, int itemIndex);
- result RefreshList(int groupIndex, int itemIndex, ListRefreshType type);
+ result RefreshList(int groupIndex, int itemIndex, ListRefreshType type, bool needFlush = true);
result RefreshList(int groupIndex, int itemIndex, int elementId);
virtual void OnDraw(void);
+ virtual result OnBoundsChanging(const Tizen::Graphics::FloatRectangle& bounds);
+
virtual void OnBoundsChanged(void);
virtual void OnFontChanged(Tizen::Graphics::Font* pFont);
Tizen::Graphics::Color __emptyTextColor;
bool __redrawListView;
+ bool __isBoundsChanged;
_ListViewItem* __pItemNeedsLazyDeletion;
_ListViewTouchEventHandler* __pTouchEventHandler;
result HideItemDescriptionText(int index);
- result RefreshList(int index, ListRefreshType type);
+ result RefreshList(int index, ListRefreshType type, bool needFlush = true);
result RefreshList(int index, int elementId);
virtual void OnDraw(void);
+ virtual result OnBoundsChanging(const Tizen::Graphics::FloatRectangle& bounds);
+
virtual void OnBoundsChanged(void);
virtual void OnFontChanged(Tizen::Graphics::Font* pFont);
Tizen::Graphics::Color __emptyTextColor;
bool __redrawListView;
+ bool __isBoundsChanged;
_ListViewItem* __pItemNeedsLazyDeletion;
_ListViewTouchEventHandler* __pTouchEventHandler;