Hi
i'am working on an autogrowing listview. Everytime before i call
mAdapter.notifyDataSetChanged();
i toggle the latest item on the list with a progress circle.
/**
* displays a progress banner instead of the last item.
* @param reload boolean
*/
protected void showReloadView(boolean reload){
View item = mListView.getChildAt(onLastItem);
//View item = mListView.getAdapter().getView(onLastItem, null, null);
content = item.findViewById(id.itemContent);
loading = item.findViewById(id.itemLoading);
if(reload){
content.setVisibility(View.GONE);
loading.setVisibility(View.VISIBLE);
}else{
content.setVisibility(View.VISIBLE);
loading.setVisibility(View.GONE);
}
My Problem here is that i'am recycling my views as mentioned in the SDK as EfficientAdapter. Therefore my ListView object currently holds no more than 8 items (cause there are no more visible)
The first run is ok, because "onLastItem" is 7 (visible items - 1), but the second run
ListView.getChildCount()
returns just 6 items. So why is my ListView getting smaller? Because of Visibility.GONE? Am i doing smth wrong?
I've tried to use the uncommented line as well. My Adapter knows the real size of the list and i can even get the view. But setting the visibility on these views has no effect.
Thx in advance