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

* commit 'b2b53fb941b269019cf82289eb63b44336bc47b8':
  Handle negative view types properly in getScrapView
This commit is contained in:
Yigit Boyar
2015-06-17 18:20:48 +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;
}