use of com.facebook.stetho.common.Accumulator in project stetho by facebook.
the class AndroidDocumentProvider method getWindows.
private void getWindows(final Accumulator<Window> accumulator) {
Descriptor appDescriptor = getDescriptor(mApplication);
if (appDescriptor != null) {
Accumulator<Object> elementAccumulator = new Accumulator<Object>() {
@Override
public void store(Object element) {
if (element instanceof Window) {
// Store the Window and do not recurse into its children.
accumulator.store((Window) element);
} else {
// Recursively scan this element's children in search of more Windows.
Descriptor elementDescriptor = getDescriptor(element);
if (elementDescriptor != null) {
elementDescriptor.getChildren(element, this);
}
}
}
};
appDescriptor.getChildren(mApplication, elementAccumulator);
}
}
Aggregations