[old map downloader][android] fix: Incorrect index while updating download progress at root level.

This commit is contained in:
Alexander Marchuk 2016-01-23 12:36:31 +03:00 committed by Sergey Yershov
parent 87c2259d9c
commit 7362a04e8d

View file

@ -701,8 +701,14 @@ abstract class BaseDownloadAdapter extends BaseAdapter
if (mListView == null || !mFragment.isAdded())
return;
// do update only one item's view; don't call notifyDataSetChanged
final View v = mListView.getChildAt(position - mListView.getFirstVisiblePosition());
// Do update only one item's view; don't call notifyDataSetChanged
int index = (position - mListView.getFirstVisiblePosition());
// Skip first two items if at the root level
if (!(this instanceof DownloadedAdapter) && !CountryTree.hasParent())
index += 2;
final View v = mListView.getChildAt(index);
if (v != null)
{
final ViewHolder holder = (ViewHolder) v.getTag();