use of com.facebook.stetho.inspector.elements.Descriptor 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);
}
}
use of com.facebook.stetho.inspector.elements.Descriptor in project stetho by facebook.
the class DialogDescriptor method getViewAndBoundsForHighlighting.
@Nullable
@Override
public View getViewAndBoundsForHighlighting(Dialog element, Rect bounds) {
final Descriptor.Host host = getHost();
Window window = null;
HighlightableDescriptor descriptor = null;
if (host instanceof AndroidDescriptorHost) {
window = element.getWindow();
descriptor = ((AndroidDescriptorHost) host).getHighlightableDescriptor(window);
}
return descriptor == null ? null : descriptor.getViewAndBoundsForHighlighting(window, bounds);
}
use of com.facebook.stetho.inspector.elements.Descriptor in project stetho by facebook.
the class DialogDescriptor method getElementToHighlightAtPosition.
@Nullable
@Override
public Object getElementToHighlightAtPosition(Dialog element, int x, int y, Rect bounds) {
final Descriptor.Host host = getHost();
Window window = null;
HighlightableDescriptor descriptor = null;
if (host instanceof AndroidDescriptorHost) {
window = element.getWindow();
descriptor = ((AndroidDescriptorHost) host).getHighlightableDescriptor(window);
}
return descriptor == null ? null : descriptor.getElementToHighlightAtPosition(window, x, y, bounds);
}
use of com.facebook.stetho.inspector.elements.Descriptor in project stetho by facebook.
the class DialogFragmentDescriptor method getViewAndBoundsForHighlighting.
@Nullable
@Override
public View getViewAndBoundsForHighlighting(Object element, Rect bounds) {
final Descriptor.Host host = getHost();
Dialog dialog = null;
HighlightableDescriptor descriptor = null;
if (host instanceof AndroidDescriptorHost) {
dialog = mAccessor.getDialog(element);
descriptor = ((AndroidDescriptorHost) host).getHighlightableDescriptor(dialog);
}
return descriptor == null ? null : descriptor.getViewAndBoundsForHighlighting(dialog, bounds);
}
use of com.facebook.stetho.inspector.elements.Descriptor in project stetho by facebook.
the class FragmentDescriptor method getElementToHighlightAtPosition.
@Nullable
@Override
public Object getElementToHighlightAtPosition(Object element, int x, int y, Rect bounds) {
final Descriptor.Host host = getHost();
View view = null;
HighlightableDescriptor descriptor = null;
if (host instanceof AndroidDescriptorHost) {
view = mAccessor.getView(element);
descriptor = ((AndroidDescriptorHost) host).getHighlightableDescriptor(view);
}
return descriptor == null ? null : descriptor.getElementToHighlightAtPosition(view, x, y, bounds);
}
Aggregations