am 5ddaa72b: Merge "Handle negative view types properly in getScrapView" into mnc-dev

* commit '5ddaa72b9a60dda43c9e199f85990c01b0bf702c':
  Handle negative view types properly in getScrapView
This commit is contained in:
Yigit Boyar
2015-06-17 18:05:08 +00:00
committed by Android Git Automerger

View File

@@ -6575,13 +6575,14 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
* @return A view from the ScrapViews collection. These are unordered.
*/
View getScrapView(int position) {
final int whichScrap = mAdapter.getItemViewType(position);
if (whichScrap < 0) {
return null;
}
if (mViewTypeCount == 1) {
return retrieveFromScrap(mCurrentScrap, position);
} else {
final int whichScrap = mAdapter.getItemViewType(position);
if (whichScrap >= 0 && whichScrap < mScrapViews.length) {
return retrieveFromScrap(mScrapViews[whichScrap], position);
}
} else if (whichScrap < mScrapViews.length) {
return retrieveFromScrap(mScrapViews[whichScrap], position);
}
return null;
}