summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-04-29 13:41:21 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-04-29 13:41:21 -0700
commitbcefcb5e95810cfdd1495a74ba942af6e57a953c (patch)
tree9031555c51c23930871281dc01bc676cf293cb06 /core
parentbff1389c9ab4442a6e278cf84ce37eadad21a9a1 (diff)
parentc5f1b92d0a480f3119be8ea6eebbada402c17cf3 (diff)
downloadframeworks_base-bcefcb5e95810cfdd1495a74ba942af6e57a953c.zip
frameworks_base-bcefcb5e95810cfdd1495a74ba942af6e57a953c.tar.gz
frameworks_base-bcefcb5e95810cfdd1495a74ba942af6e57a953c.tar.bz2
am c5f1b92: Merge change 691 into donut
Merge commit 'c5f1b92d0a480f3119be8ea6eebbada402c17cf3' * commit 'c5f1b92d0a480f3119be8ea6eebbada402c17cf3': Fixes 1819406. Take a ListView, add headers/footers, set the adapter after at least one layout pass, and the headers/footers don't know they have a parent anymore. Which causes a lot of trouble, like drawing not happening.
Diffstat (limited to 'core')
-rw-r--r--core/java/android/widget/ListView.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/core/java/android/widget/ListView.java b/core/java/android/widget/ListView.java
index 1daee4e..66c162e 100644
--- a/core/java/android/widget/ListView.java
+++ b/core/java/android/widget/ListView.java
@@ -460,10 +460,30 @@ public class ListView extends AbsListView {
*/
@Override
void resetList() {
+ // The parent's resetList() will remove all views from the layout so we need to
+ // cleanup the state of our footers and headers
+ clearRecycledState(mHeaderViewInfos);
+ clearRecycledState(mFooterViewInfos);
+
super.resetList();
+
mLayoutMode = LAYOUT_NORMAL;
}
+ private void clearRecycledState(ArrayList<FixedViewInfo> infos) {
+ if (infos != null) {
+ final int count = infos.size();
+
+ for (int i = 0; i < count; i++) {
+ final View child = infos.get(i).view;
+ final LayoutParams p = (LayoutParams) child.getLayoutParams();
+ if (p != null) {
+ p.recycledHeaderFooter = false;
+ }
+ }
+ }
+ }
+
/**
* @return Whether the list needs to show the top fading edge
*/