private void removeListeners() { if (dependency == null) return; if (dependency instanceof TransformationView) ((TransformationView) dependency).removeOnTransformationChangedListener(transformationListener); dependency.removeOnLayoutChangeListener(layoutListener); } }
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment final View view = inflater.inflate(R.layout.fragment_map_list, container, false); if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { view.addOnLayoutChangeListener(new View.OnLayoutChangeListener() { @TargetApi(Build.VERSION_CODES.LOLLIPOP) @Override public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) { v.removeOnLayoutChangeListener(this); toggleInformationView(view); } }); } return view; }
@Override public void onVideoSizeChanged( int width, int height, int unappliedRotationDegrees, float pixelWidthHeightRatio) { float videoAspectRatio = (height == 0 || width == 0) ? 1 : (width * pixelWidthHeightRatio) / height; if (surfaceView instanceof TextureView) { // Try to apply rotation transformation when our surface is a TextureView. if (unappliedRotationDegrees == 90 || unappliedRotationDegrees == 270) { // We will apply a rotation 90/270 degree to the output texture of the TextureView. // In this case, the output video's width and height will be swapped. videoAspectRatio = 1 / videoAspectRatio; } if (textureViewRotation != 0) { surfaceView.removeOnLayoutChangeListener(this); } textureViewRotation = unappliedRotationDegrees; if (textureViewRotation != 0) { // The texture view's dimensions might be changed after layout step. // So add an OnLayoutChangeListener to apply rotation after layout step. surfaceView.addOnLayoutChangeListener(this); } applyTextureViewRotation((TextureView) surfaceView, textureViewRotation); } onContentAspectRatioChanged(videoAspectRatio, contentFrame, surfaceView); }
sheetView.removeOnLayoutChangeListener(sheetViewOnLayoutChangeListener); cancelCurrentAnimation(); ObjectAnimator anim = ObjectAnimator.ofFloat(this, SHEET_TRANSLATION, 0);
@Override public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) { updateScrollPositions(); v.removeOnLayoutChangeListener(this); } });
@Override public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) { v.removeOnLayoutChangeListener(this); revealProfileInfo(); } });
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment final View view = inflater.inflate(R.layout.fragment_map_list, container, false); if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { view.addOnLayoutChangeListener(new View.OnLayoutChangeListener() { @TargetApi(Build.VERSION_CODES.LOLLIPOP) @Override public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) { v.removeOnLayoutChangeListener(this); revealView(view); } }); } return view; }
void clear(View containerView) { containerView.removeOnLayoutChangeListener(preventerListener); preventerListener = null; } }
@Override public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) { updateViewPositions(); v.removeOnLayoutChangeListener(this); } });
@Override public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) { v.removeOnLayoutChangeListener(this); show_search_view(); } });
@Override public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) { v.removeOnLayoutChangeListener(this); setUpUserInput(); } });
@Override public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) { if (v.getWidth() > 0) { startErrorAnimation(); } v.removeOnLayoutChangeListener(this); } });
private void setArrowToRef(View targetView) { if (mArrowToViewRef != null) { View oldTargetView = mArrowToViewRef.get(); if (oldTargetView != null) { oldTargetView.removeOnLayoutChangeListener(mOnLayoutChangeListener); } } mArrowToViewRef = targetView != null ? new WeakReference<>(targetView) : null; if (targetView != null) { targetView.addOnLayoutChangeListener(mOnLayoutChangeListener); } }
@Override public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) { v.removeOnLayoutChangeListener(this); setUpGridView(getView()); } });
@Override public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) { sendEmptyMessageDelayed(MSG_ID_CLEAR_LAYOUT_FULLSCREEN_FLAG, CLEAR_LAYOUT_FULLSCREEN_DELAY_MS); contentView.removeOnLayoutChangeListener(this); } });
@Override public void onLayoutChange(View view, int i, int i1, int i2, int i3, int i4, int i5, int i6, int i7) { mBinding.getRoot().removeOnLayoutChangeListener(this); mHandler.postDelayed(SplashActivity.this::requestPermission, 2000); } });
public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) { v.removeOnLayoutChangeListener(this); ((MainActivity) RowViewAdapter.this.mContext).includeInLaunchAnimation(holder.itemView); } });
@Override public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) { if ((bottom - top) < (oldBottom - oldTop)) { mDelegate.onFullscreenExited(tab); contentView.removeOnLayoutChangeListener(this); } } };
@Override public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) { v.removeOnLayoutChangeListener(this); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { int x = (int) (mFab.getWidth() / 2 + mFab.getX()); int y = (int) (mFab.getHeight() / 2 + mFab.getY()); Animator animator = ViewAnimationUtils.createCircularReveal(decorView, x, y, 0, decorView.getHeight()); animator.setDuration(400); animator.start(); } } });
private void finish(boolean immediate) { mView.removeView(immediate); mCallback.onDestroyActionMode(mMode); mFinished = true; mTarget.removeOnAttachStateChangeListener(this); final View root = mTarget.getRootView(); root.removeOnLayoutChangeListener(this); root.removeOnAttachStateChangeListener(this); mTarget = null; }