private boolean createCircularReveal() { if (mColorBg == null) { return false; } int w = mColorBg.getWidth(); int h = mColorBg.getHeight(); if (ViewCompat.isAttachedToWindow(mColorBg) && w != 0 && h != 0) { ViewAnimationUtils.createCircularReveal(mColorBg, w / 2, h / 2, 0, (float) Math.hypot(w / 2, h / 2)).setDuration(300).start(); return true; } else { return false; } }
@Override protected void onVisibilityChanged(@NonNull View changedView, int visibility) { super.onVisibilityChanged(changedView, visibility); if (mIndeterminate && ViewCompat.isAttachedToWindow(this)) { if (visibility == GONE || visibility == INVISIBLE) { stopAnimation(); } else if (ViewCompat.isAttachedToWindow(this)) { startAnimation(); } } }
@Override public void setVisibility(int v) { if (getVisibility() != v) { super.setVisibility(v); if (mIndeterminate) { if (v == GONE || v == INVISIBLE) { stopAnimation(); } else if (ViewCompat.isAttachedToWindow(this)) { startAnimation(); } } } }
public void setIndeterminate(boolean indeterminate) { if (mIndeterminate != indeterminate) { mIndeterminate = indeterminate; if (indeterminate) { if (isShown() && ViewCompat.isAttachedToWindow(this)) { startAnimation(); } } else { stopAnimation(); } } }
/** * Check if it is attached to the Window and call WindowManager.updateLayout() */ private void updateViewLayout() { if (!ViewCompat.isAttachedToWindow(this)) { return; } mWindowManager.updateViewLayout(this, mParams); }
attributes.add(new ViewAttribute<>("AttachedToWindow", ViewCompat.isAttachedToWindow(view))); attributes.add(new ViewAttribute<>("Dirty", view.isDirty()));
protected boolean isShowing() { return ViewCompat.isAttachedToWindow(mView); }
protected boolean isShowing() { return ViewCompat.isAttachedToWindow(mView); }
public void show() { if (!ViewCompat.isAttachedToWindow(this)) return; fab.show(); }
@RequiresApi(23) private void setAnchorMarshmallow(final @NonNull View anchor) { final View anchorRoot = anchor.getRootView(); final boolean isAnchorRootAttached = ViewCompat.isAttachedToWindow(anchorRoot); try { final View.OnAttachStateChangeListener listener = (View.OnAttachStateChangeListener) sOnAnchorRootDetachedListenerField.get(this); anchorRoot.addOnAttachStateChangeListener(listener); sAnchorField.set(this, new WeakReference<>(anchor)); sAnchorRootField.set(this, new WeakReference<>(anchorRoot)); sIsAnchorRootAttachedField.set(this, isAnchorRootAttached); } catch (Exception e) { Log.i(TAG, "Could not set anchor on PopupWindow. Oh well."); } }
public void show() { if (!ViewCompat.isAttachedToWindow(this)) return; setVisibility(View.VISIBLE); fab.show(); }
public void show() { if (!ViewCompat.isAttachedToWindow(this)) return; setVisibility(View.VISIBLE); fab.show(); }
public void hide() { if (!ViewCompat.isAttachedToWindow(this)) return; if (isMenuOpen()) { closeMenu(); } fab.hide(); }
public void hide() { if (!ViewCompat.isAttachedToWindow(this)) return; if (isMenuOpen()) { closeMenu(); } fab.hide(); }
public void hide() { if (!ViewCompat.isAttachedToWindow(this)) return; if (isMenuOpen()) { closeMenu(); } fab.hide(); }
public void closeMenu() { if (!ViewCompat.isAttachedToWindow(this)) return; if (isMenuOpen()) { fab.setSelected(false); removeFabMenuItems(); if (menuListener != null) { menuListener.onMenuClosed(); } } }
public void closeMenu() { if (!ViewCompat.isAttachedToWindow(this)) return; if (isMenuOpen()) { fab.setSelected(false); removeFabMenuItems(); if (menuListener != null) { menuListener.onMenuClosed(); } } }
public void closeMenu() { if (!ViewCompat.isAttachedToWindow(this)) return; if (isMenuOpen()) { fab.setSelected(false); removeFabMenuItems(); if (menuListener != null) { menuListener.onMenuClosed(); } } }
@Override public void run() { if (mDropDownList != null && ViewCompat.isAttachedToWindow(mDropDownList) && mDropDownList.getCount() > mDropDownList.getChildCount() && mDropDownList.getChildCount() <= mListItemExpandMaximum) { mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NOT_NEEDED); mListMeasureDirty = true; // TODO Verify we need this. show(); } } }
public void openMenu() { if (!ViewCompat.isAttachedToWindow(this)) return; requestFocus(); boolean showMenu = true; if (menuListener != null) { newNavigationMenu(); showMenu = menuListener.onPrepareMenu(navigationMenu); } if (showMenu) { addMenuItems(); fab.setSelected(true); } else { fab.setSelected(false); } }