private boolean isSmallWindowNeedPlay(View view) { // adapter.getPlayer().OnShowPre();
Rect rect = new Rect();
boolean visibleRect = view.getGlobalVisibleRect(rect);
if (visibleRect) {
Point point = new Point();
if (getContext() != null) {
((Activity) getContext()).getWindowManager().getDefaultDisplay().getSize(point);
}
//曝光精确度计算 在整个view 计算view中心是否在屏幕里面
int top = (int) (rect.height() * 0.5 + rect.top);
int left = (int) (rect.width() * 0.5 + rect.left);
if (top >= 0 && top <= point.y && left >= 0 && left <= point.x) {
return true;
}
}
return false;
}
}