android.view.Window#peekDecorView ( )源码实例Demo

下面列出了android.view.Window#peekDecorView ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: stetho   文件: WindowDescriptor.java
@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);
}
 
源代码2 项目: weex   文件: WindowDescriptor.java
@Override
protected void onGetChildren(Window element, Accumulator<Object> children) {
  View decorView = element.peekDecorView();
  if (decorView != null) {
    children.store(decorView);
  }
}
 
源代码3 项目: stetho   文件: WindowDescriptor.java
@Override
protected void onGetChildren(Window element, Accumulator<Object> children) {
  View decorView = element.peekDecorView();
  if (decorView != null) {
    children.store(decorView);
  }
}
 
源代码4 项目: 365browser   文件: WindowAndroid.java
/**
 * 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();
}
 
源代码5 项目: letv   文件: FragmentActivity.java
public boolean onHasView() {
    Window w = FragmentActivity.this.getWindow();
    return (w == null || w.peekDecorView() == null) ? false : true;
}
 
源代码6 项目: weex   文件: WindowDescriptor.java
@Override
@Nullable
public View getViewForHighlighting(Object element) {
  Window window = (Window) element;
  return window.peekDecorView();
}
 
源代码7 项目: stetho   文件: WindowDescriptor.java
@Override
@Nullable
public View getViewAndBoundsForHighlighting(Window element, Rect bounds) {
  return element.peekDecorView();
}
 
源代码8 项目: adt-leanback-support   文件: FragmentActivity.java
@Override
public boolean hasView() {
    Window window = FragmentActivity.this.getWindow();
    return (window != null && window.peekDecorView() != null);
}