ListView.findViewById(): iterate header and footer views even if invisible

This commit is contained in:
Julian Winkler 2025-04-21 10:14:06 +02:00
parent 68b8af1e1c
commit f2065e31a4

View file

@ -3626,4 +3626,22 @@ public class ListView extends AbsListView {
return false;
}
@Override
public View findViewById(int id) {
View view = super.findViewById(id);
if (view != null)
return view;
for (FixedViewInfo info: mHeaderViewInfos) {
view = info.view.findViewById(id);
if (view != null)
return view;
}
for (FixedViewInfo info: mFooterViewInfos) {
view = info.view.findViewById(id);
if (view != null)
return view;
}
return null;
}
}