/** * Setup all animations to provided drawable and view */ public void setFor(@NonNull View view, @NonNull IconicsAnimatedDrawable drawable) { unset(); if (view == null || drawable == null) return; mView = view; mDrawable = drawable; if (ViewCompat.isAttachedToWindow(view)) { mListener.onViewAttachedToWindow(view); } view.addOnAttachStateChangeListener(mListener); }
shouldAnimate = ViewCompat.isAttachedToWindow(containerView) && (containerView.getVisibility() == View.VISIBLE);
shouldAnimate = ViewCompat.isAttachedToWindow(containerView) && (containerView.getVisibility() == View.VISIBLE);
/** * The scrollBar should attempt to use dev provided scrolling logic and not default logic. * * The adapter must implement {@link ICustomScroller}. */ private void checkCustomScrolling() { if(ViewCompat.isAttachedToWindow(this)) { checkCustomScrollingInterface(); } else { addOnLayoutChangeListener(new OnLayoutChangeListener() { @Override public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) { MaterialScrollBar.this.removeOnLayoutChangeListener(this); checkCustomScrollingInterface(); } }); } }
if (!ViewCompat.isAttachedToWindow(v)) { mDoReveal = false; return;
@Override @TargetApi(Build.VERSION_CODES.LOLLIPOP) public void run() { if (!ViewCompat.isAttachedToWindow(mTarget)) { mBinding.searchView.setVisibility(mIn ? View.VISIBLE : View.INVISIBLE); if (!mIn) {
/** * Adds an indicator which accompanies this scroll bar. * * @param addSpaceSide Should space be put between the indicator and the bar or should they touch? */ public T setIndicator(final Indicator indicator, final boolean addSpaceSide) { if(ViewCompat.isAttachedToWindow(this)) { setupIndicator(indicator, addSpaceSide); } else { removeOnLayoutChangeListener(indicatorLayoutListener); indicatorLayoutListener = (a,b,c,d,e,f,g,h,i) -> { setupIndicator(indicator, addSpaceSide); MaterialScrollBar.this.removeOnLayoutChangeListener(indicatorLayoutListener); }; addOnLayoutChangeListener(indicatorLayoutListener); } return (T)this; }