public S isNotInFocusedWindow() { isNotNull(); assertThat(actual.hasWindowFocus()) // .overridingErrorMessage("Expected to not be in a focused window but was") // .isFalse(); return myself; }
public S isInFocusedWindow() { isNotNull(); assertThat(actual.hasWindowFocus()) // .overridingErrorMessage("Expected to be in a focused window but was not") // .isTrue(); return myself; }
/** * Returns the most recent view container * * @param views the views to check * @return the most recent view container */ private final View getRecentContainer(View[] views) { View container = null; long drawingTime = 0; View view; for(int i = 0; i < views.length; i++){ view = views[i]; if (view != null && view.isShown() && view.hasWindowFocus() && view.getDrawingTime() > drawingTime) { container = view; drawingTime = view.getDrawingTime(); } } return container; }
public S isNotInFocusedWindow() { isNotNull(); assertThat(actual.hasWindowFocus()) // .overridingErrorMessage("Expected to not be in a focused window but was") // .isFalse(); return myself; }
public S isInFocusedWindow() { isNotNull(); assertThat(actual.hasWindowFocus()) // .overridingErrorMessage("Expected to be in a focused window but was not") // .isTrue(); return myself; }
public void setSubView(View subView) { removeAllViews(); this.subView = subView; if (this.subView != null && this.subView.getParent() != this) { if (this.subView.getParent() instanceof ViewGroup) { ((ViewGroup) this.subView.getParent()).removeView(this.subView); } addView(this.subView); if (this.subView.hasFocus() || this.subView.hasWindowFocus()) { this.subView.requestFocus(); } } }
public void run() { if ((mView.getParent() != null) && mView.hasWindowFocus() && !mHasPerformedLongPress) { if (mView.performLongClick()) { mView.setPressed(false); mHasPerformedLongPress = true; } } } }
public static boolean isActiveDialog(Dialog dialog) { if (!dialog.isShowing()) return false; Window dialogWindow = dialog.getWindow(); if (dialogWindow != null) { View decorView = dialogWindow.getDecorView(); if (decorView != null) return decorView.hasWindowFocus(); } return false; }
private void wrapExposureCurrentView(View view, Map<String, ExposureModel> lastVisibleViewMap, Map<String, ExposureModel> currentVisibleViewMap) { String viewTag = (String) view.getTag(TrackerConstants.VIEW_TAG_UNIQUE_NAME); HashMap<String, Object> params = (HashMap<String, Object>) view.getTag(TrackerConstants.VIEW_TAG_PARAM); boolean isWindowChange = view.hasWindowFocus(); boolean exposureValid = checkExposureViewDimension(view); boolean needExposureProcess = isWindowChange && exposureValid; if (!needExposureProcess) { return; } // only add the visible view in screen if (lastVisibleViewMap.containsKey(viewTag)) { ExposureModel model = lastVisibleViewMap.get(viewTag); model.params = params; currentVisibleViewMap.put(viewTag, model); } else if (!currentVisibleViewMap.containsKey(viewTag)) { ExposureModel model = new ExposureModel(); model.beginTime = System.currentTimeMillis(); model.tag = viewTag; model.params = params; currentVisibleViewMap.put(viewTag, model); } }
private View getRecentContainer(List<View> views) { View container = null; long drawingTime = 0; View view; for (int i = 0; i < views.size(); i++) { view = views.get(i); if (view != null && view.isShown() && view.hasWindowFocus() && view.getDrawingTime() > drawingTime) { container = view; drawingTime = view.getDrawingTime(); } } return container; }
protected void setHasFocus(boolean hasFocus) { if (this.mEnabled && this.mTargetView.getVisibility() == 0 && this.mTargetView.isAttachedToWindow() && this.mTargetView.hasWindowFocus()) { animateFocus(hasFocus); } else { setFocusImmediate(hasFocus); } }
protected void setHasFocus(boolean hasFocus) { if (this.mEnabled && this.mTargetView.getVisibility() == 0 && this.mTargetView.isAttachedToWindow() && this.mTargetView.hasWindowFocus()) { animateFocus(hasFocus); } else { setFocusImmediate(hasFocus); } }
public void run() { if ((mView.getParent() != null) && mView.hasWindowFocus() && !mHasPerformedLongPress) { boolean handled; if (mListener != null) { handled = mListener.onLongClick(mView); } else { handled = mView.performLongClick(); } if (handled) { mView.setPressed(false); mHasPerformedLongPress = true; } } } }
public void run() { if ((mView.getParent() != null) && mView.hasWindowFocus() && !mHasPerformedLongPress) { boolean handled; if (mListener != null) { handled = mListener.onLongClick(mView); } else { handled = mView.performLongClick(); } if (handled) { mView.setPressed(false); mHasPerformedLongPress = true; } } } }
public void run() { if ((mView.getParent() != null) && mView.hasWindowFocus() && !mHasPerformedLongPress) { boolean handled; if (mListener != null) { handled = mListener.onLongClick(mView); } else { handled = mView.performLongClick(); } if (handled) { mView.setPressed(false); mHasPerformedLongPress = true; } } } }
private static View getRecentContainer(View[] views) { View container = null; long drawingTime = 0; for (View view : views) { if (view != null && view.isShown() && view.hasWindowFocus() && view.getDrawingTime() > drawingTime) { container = view; drawingTime = view.getDrawingTime(); } } return container; }
public void run() { if ((mView.getParent() != null) && mView.hasWindowFocus() && !mHasPerformedLongPress) { boolean handled; if (mListener != null) { handled = mListener.onLongClick(mView); } else { handled = mView.performLongClick(); } if (handled) { mView.setPressed(false); mHasPerformedLongPress = true; } } } }
/** * Returns the most recent view container * * @param views the views to check * @return the most recent view container */ private final View getRecentContainer(View[] views) { View container = null; long drawingTime = 0; View view; for(int i = 0; i < views.length; i++){ view = views[i]; if (view != null && view.isShown() && view.hasWindowFocus() && view.getDrawingTime() > drawingTime) { container = view; drawingTime = view.getDrawingTime(); } } return container; }
for (int i = 0; i < topContainer.getChildCount(); i++) { View child = topContainer.getChildAt(i); if (child.hasWindowFocus() || child.hasFocus()) { topFocus = true; break;
data.put("HasWindowFocus", v.hasWindowFocus()); data.put("IsDrawingCacheEnabled", v.isDrawingCacheEnabled()); data.put("IsFocused", v.isFocused());