Loading core/java/android/view/View.java +7 −1 Original line number Diff line number Diff line Loading @@ -22369,7 +22369,13 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * Used to track views that need (at least) a partial relayout at their current size * during the next traversal. */ final List<View> mPartialLayoutViews = new ArrayList<View>(); List<View> mPartialLayoutViews = new ArrayList<>(); /** * Swapped with mPartialLayoutViews during layout to avoid concurrent * modification. Lazily assigned during ViewRootImpl layout. */ List<View> mEmptyPartialLayoutViews; /** * Used to track the identity of the current drag operation. core/java/android/view/ViewRootImpl.java +13 −1 Original line number Diff line number Diff line Loading @@ -1974,6 +1974,15 @@ public final class ViewRootImpl implements ViewParent, final List<View> partialLayoutViews = mAttachInfo.mPartialLayoutViews; final boolean didPartialLayout; if (!partialLayoutViews.isEmpty()) { // Measurement or layout of views may result in changes to the list // of partial-layout views. Swap in an "empty" list to prevent // concurrent modification of the list being traversed. if (mAttachInfo.mEmptyPartialLayoutViews == null) { mAttachInfo.mPartialLayoutViews = new ArrayList<>(); } else { mAttachInfo.mPartialLayoutViews = mAttachInfo.mEmptyPartialLayoutViews; } final int count = partialLayoutViews.size(); mInLayout = true; for (int i = 0; i < count; i++) { Loading @@ -1992,9 +2001,12 @@ public final class ViewRootImpl implements ViewParent, } } mInLayout = false; partialLayoutViews.clear(); didPartialLayout = true; triggerGlobalLayoutListener = true; // The traversal list becomes the new empty list. partialLayoutViews.clear(); mAttachInfo.mEmptyPartialLayoutViews = partialLayoutViews; } else { didPartialLayout = false; } Loading Loading
core/java/android/view/View.java +7 −1 Original line number Diff line number Diff line Loading @@ -22369,7 +22369,13 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * Used to track views that need (at least) a partial relayout at their current size * during the next traversal. */ final List<View> mPartialLayoutViews = new ArrayList<View>(); List<View> mPartialLayoutViews = new ArrayList<>(); /** * Swapped with mPartialLayoutViews during layout to avoid concurrent * modification. Lazily assigned during ViewRootImpl layout. */ List<View> mEmptyPartialLayoutViews; /** * Used to track the identity of the current drag operation.
core/java/android/view/ViewRootImpl.java +13 −1 Original line number Diff line number Diff line Loading @@ -1974,6 +1974,15 @@ public final class ViewRootImpl implements ViewParent, final List<View> partialLayoutViews = mAttachInfo.mPartialLayoutViews; final boolean didPartialLayout; if (!partialLayoutViews.isEmpty()) { // Measurement or layout of views may result in changes to the list // of partial-layout views. Swap in an "empty" list to prevent // concurrent modification of the list being traversed. if (mAttachInfo.mEmptyPartialLayoutViews == null) { mAttachInfo.mPartialLayoutViews = new ArrayList<>(); } else { mAttachInfo.mPartialLayoutViews = mAttachInfo.mEmptyPartialLayoutViews; } final int count = partialLayoutViews.size(); mInLayout = true; for (int i = 0; i < count; i++) { Loading @@ -1992,9 +2001,12 @@ public final class ViewRootImpl implements ViewParent, } } mInLayout = false; partialLayoutViews.clear(); didPartialLayout = true; triggerGlobalLayoutListener = true; // The traversal list becomes the new empty list. partialLayoutViews.clear(); mAttachInfo.mEmptyPartialLayoutViews = partialLayoutViews; } else { didPartialLayout = false; } Loading