Java Code Examples for android.view.Window#peekDecorView()

The following examples show how to use android.view.Window#peekDecorView() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WindowDescriptor.java    From stetho with MIT License 6 votes vote down vote up
@Nullable
@Override
public Object getElementToHighlightAtPosition(Window element, int x, int y, Rect bounds) {
  final Descriptor.Host host = getHost();
  View view = null;
  HighlightableDescriptor descriptor = null;

  if (host instanceof AndroidDescriptorHost) {
    view = element.peekDecorView();
    descriptor = ((AndroidDescriptorHost) host).getHighlightableDescriptor(view);
  }

  return descriptor == null
      ? null
      : descriptor.getElementToHighlightAtPosition(view, x, y, bounds);
}
 
Example 2
Source File: WindowDescriptor.java    From weex with Apache License 2.0 5 votes vote down vote up
@Override
protected void onGetChildren(Window element, Accumulator<Object> children) {
  View decorView = element.peekDecorView();
  if (decorView != null) {
    children.store(decorView);
  }
}
 
Example 3
Source File: WindowDescriptor.java    From stetho with MIT License 5 votes vote down vote up
@Override
protected void onGetChildren(Window element, Accumulator<Object> children) {
  View decorView = element.peekDecorView();
  if (decorView != null) {
    children.store(decorView);
  }
}
 
Example 4
Source File: WindowAndroid.java    From 365browser with Apache License 2.0 5 votes vote down vote up
/**
 * Return the current window token, or null.
 */
@CalledByNative
private IBinder getWindowToken() {
    Activity activity = activityFromContext(mContextRef.get());
    if (activity == null) return null;
    Window window = activity.getWindow();
    if (window == null) return null;
    View decorView = window.peekDecorView();
    if (decorView == null) return null;
    return decorView.getWindowToken();
}
 
Example 5
Source File: FragmentActivity.java    From letv with Apache License 2.0 4 votes vote down vote up
public boolean onHasView() {
    Window w = FragmentActivity.this.getWindow();
    return (w == null || w.peekDecorView() == null) ? false : true;
}
 
Example 6
Source File: WindowDescriptor.java    From weex with Apache License 2.0 4 votes vote down vote up
@Override
@Nullable
public View getViewForHighlighting(Object element) {
  Window window = (Window) element;
  return window.peekDecorView();
}
 
Example 7
Source File: WindowDescriptor.java    From stetho with MIT License 4 votes vote down vote up
@Override
@Nullable
public View getViewAndBoundsForHighlighting(Window element, Rect bounds) {
  return element.peekDecorView();
}
 
Example 8
Source File: FragmentActivity.java    From adt-leanback-support with Apache License 2.0 4 votes vote down vote up
@Override
public boolean hasView() {
    Window window = FragmentActivity.this.getWindow();
    return (window != null && window.peekDecorView() != null);
}