diff options
| author | Michael Jurka <mikejurka@google.com> | 2012-05-29 08:44:31 -0700 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2012-05-29 08:44:31 -0700 |
| commit | fc9c4434da6f20c104964d7d20f3571e07abbf9a (patch) | |
| tree | 2a92d4aa6be72c5d412e8a248bab481871831c34 /packages/SystemUI | |
| parent | d965019105a4a6bb4c924fe063b4c69c4b8020a6 (diff) | |
| parent | 48c22c84c089213dda6495fbdeb384e400c7c5c5 (diff) | |
| download | frameworks_base-fc9c4434da6f20c104964d7d20f3571e07abbf9a.zip frameworks_base-fc9c4434da6f20c104964d7d20f3571e07abbf9a.tar.gz frameworks_base-fc9c4434da6f20c104964d7d20f3571e07abbf9a.tar.bz2 | |
am 48c22c84: Merge "Adding debugging code for bug where recycled views still had parent" into jb-dev
* commit '48c22c84c089213dda6495fbdeb384e400c7c5c5':
Adding debugging code for bug where recycled views still had parent
Diffstat (limited to 'packages/SystemUI')
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java | 15 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java | 15 |
2 files changed, 30 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java b/packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java index 9f801b0..1302c1f 100644 --- a/packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java +++ b/packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java @@ -83,6 +83,12 @@ public class RecentsHorizontalScrollView extends HorizontalScrollView setLayoutTransition(null); mLinearLayout.removeAllViews(); + for (int i = 0; i < mRecycledViews.size(); i++) { + View child = mRecycledViews.get(i); + if (child.getParent() != null) { + throw new RuntimeException("Recycled child has a parent"); + } + } for (int i = 0; i < mAdapter.getCount(); i++) { View old = null; if (mRecycledViews.size() != 0) { @@ -183,6 +189,9 @@ public class RecentsHorizontalScrollView extends HorizontalScrollView public void onChildDismissed(View v) { mRecycledViews.add(v); mLinearLayout.removeView(v); + if (v.getParent() != null) { + throw new RuntimeException("Recycled child has parent"); + } mCallback.handleSwipe(v); // Restore the alpha/translation parameters to what they were before swiping // (for when these items are recycled) @@ -354,9 +363,15 @@ public class RecentsHorizontalScrollView extends HorizontalScrollView mNumItemsInOneScreenful = (int) FloatMath.ceil(dm.widthPixels / (float) child.getMeasuredWidth()); mRecycledViews.add(child); + if (child.getParent() != null) { + throw new RuntimeException("First recycled child has parent"); + } for (int i = 0; i < mNumItemsInOneScreenful - 1; i++) { mRecycledViews.add(mAdapter.createView(mLinearLayout)); + if (mRecycledViews.get(mRecycledViews.size() - 1).getParent() != null) { + throw new RuntimeException("Recycled child has parent"); + } } } diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java b/packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java index c1597e0..3c71784 100644 --- a/packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java +++ b/packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java @@ -84,6 +84,12 @@ public class RecentsVerticalScrollView extends ScrollView setLayoutTransition(null); mLinearLayout.removeAllViews(); + for (int i = 0; i < mRecycledViews.size(); i++) { + View child = mRecycledViews.get(i); + if (child.getParent() != null) { + throw new RuntimeException("Recycled child has parent"); + } + } // Once we can clear the data associated with individual item views, // we can get rid of the removeAllViews() and the code below will // recycle them. @@ -190,6 +196,9 @@ public class RecentsVerticalScrollView extends ScrollView public void onChildDismissed(View v) { mRecycledViews.add(v); mLinearLayout.removeView(v); + if (v.getParent() != null) { + throw new RuntimeException("Recycled child has parent"); + } mCallback.handleSwipe(v); // Restore the alpha/translation parameters to what they were before swiping // (for when these items are recycled) @@ -363,9 +372,15 @@ public class RecentsVerticalScrollView extends ScrollView mNumItemsInOneScreenful = (int) FloatMath.ceil(dm.heightPixels / (float) child.getMeasuredHeight()); mRecycledViews.add(child); + if (child.getParent() != null) { + throw new RuntimeException("First recycled child has parent"); + } for (int i = 0; i < mNumItemsInOneScreenful - 1; i++) { mRecycledViews.add(mAdapter.createView(mLinearLayout)); + if (mRecycledViews.get(mRecycledViews.size() - 1).getParent() != null) { + throw new RuntimeException("Recycled child has parent"); + } } } |
