Languages

Menu
Sites
Language
How to invalidate a CustomItem in a ListView

Hello everyone,

Here's my problem. I have implemented a ListView of CustomItem. Each custom item embed  images that load from remote URIs, loaded asynchronously.

When the image's Bitmap is available, I call " this->AddElement(Rectangle(10, 20, 80, 80), ID_FORMAT_CHANLOGO, *mChanLogo, null, null); " in the CustomItem, but there is no way to tell the CustomItem to Invalidate its content.

When I click on the item, this cause its state to change and then I can see my image. I tried manually refreshing the item by calling ListView.RefreshList(index, LIST_REFRESH_TYPE_ITEM_MODIFY); but this rebuilds the whole CustomItem, and that's not the behavior i'm looking for.

 

Edited by: Brock Boland on 17 Mar, 2014 Reason: Paragraph tags added automatically from tizen_format_fix module.

Responses

4 Replies
kimi

Hi,

whenever you are adding new image(Custom Item), refresh the list manually by using  ListView.RefreshList(index, LIST_REFRESH_TYPE_ITEM_ADD); or try to Invalidate the ListView.

 

Kimi.

Yuri Ageev

Hello Pierre!


Did you find solution or workaround for this problem? I'm struggling with it right now.

Alex Dem

Hi,
As I know after new List is created or after call of ListView::UpdateList(); reimplemented method IListViewItemProvider::CreateItem is called for every item in List (number of times==GetItemCount() ). Every time  IListViewItemProvider::CreateItem is called with next index (0,1,2,3...).

But after call of __pListView->RefreshList(index,LIST_REFRESH_TYPE_ITEM_MODIFY); method IListViewItemProvider::CreateItem () is called only one time with desired item's index. Whole List is not rebuilded (I watched log)

I think you should use ListView::RefreshList()

But maybe I have missed something in your problem description.
Alexey.

Yuri Ageev

Thanks for response.

__pListView->RefreshList(index,LIST_REFRESH_TYPE_ITEM_MODIFY);

Doesnt fit, becouse of rebuilding item, i want to avoid that becouse it not cheap, and creating a little mess with async loading images.

I`m find that method

__pListView->RefreshList(index, elementId);

redraw not whole item, but that CustomItem element that was pointed in param "elementId". 

I am still in testing of that method, but for now it seems working fine.