Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7b09a4e5 authored by Alan Viverette's avatar Alan Viverette Committed by Android Git Automerger
Browse files

am e910a7ce: Merge "DO NOT MERGE Check item type before re-binding transient...

am e910a7ce: Merge "DO NOT MERGE Check item type before re-binding transient state views" into klp-dev

* commit 'e910a7ce':
  DO NOT MERGE Check item type before re-binding transient state views
parents 3c3377a2 e910a7ce
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -2233,11 +2233,17 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
        // data and discard the view if we fail.
        final View transientView = mRecycler.getTransientStateView(position);
        if (transientView != null) {
            final LayoutParams params = (LayoutParams) transientView.getLayoutParams();

            // If the view type hasn't changed, attempt to re-bind the data.
            if (params.viewType == mAdapter.getItemViewType(position)) {
                final View updatedView = mAdapter.getView(position, transientView, this);

                // If we failed to re-bind the data, scrap the obtained view.
                if (updatedView != transientView) {
                // Failed to re-bind the data, scrap the obtained view.
                    mRecycler.addScrapView(updatedView, position);
                }
            }

            // Scrap view implies temporary detachment.
            isScrap[0] = true;