Java Code Examples for android.view.View.removeOnLayoutChangeListener()

The following are Jave code examples for showing how to use removeOnLayoutChangeListener() of the android.view.View class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: ViewPrinter   File: DocumentView.java   Source Code and License Vote up 6 votes
@Override
public void onLayoutChange(View view, int left, int top, int right, int bottom,
                           int oldLeft, int oldTop, int oldRight, int oldBottom) {
    if (view.isFocused() && view instanceof TextView) {
        // A focused view changed its bounds. Follow it?
        int height = bottom - top;
        int oldHeight = oldBottom - oldTop;
        if (oldHeight != height) {
            zoomToView(view, false);
        }
    } else {
        view.removeOnLayoutChangeListener(this);
    }
}
 
Example 2
Project: RNLearn_Project1   File: ReactViewGroup.java   Source Code and License Vote up 6 votes
void removeViewWithSubviewClippingEnabled(View view) {
  Assertions.assertCondition(mRemoveClippedSubviews);
  Assertions.assertNotNull(mClippingRect);
  Assertions.assertNotNull(mAllChildren);
  view.removeOnLayoutChangeListener(mChildrenLayoutChangeListener);
  int index = indexOfChildInAllChildren(view);
  if (mAllChildren[index].getParent() != null) {
    int clippedSoFar = 0;
    for (int i = 0; i < index; i++) {
      if (mAllChildren[i].getParent() == null) {
        clippedSoFar++;
      }
    }
    super.removeViewsInLayout(index - clippedSoFar, 1);
  }
  removeFromArray(index);
}
 
Example 3
Project: RNLearn_Project1   File: ReactViewGroup.java   Source Code and License Vote up 6 votes
void removeViewWithSubviewClippingEnabled(View view) {
  Assertions.assertCondition(mRemoveClippedSubviews);
  Assertions.assertNotNull(mClippingRect);
  Assertions.assertNotNull(mAllChildren);
  view.removeOnLayoutChangeListener(mChildrenLayoutChangeListener);
  int index = indexOfChildInAllChildren(view);
  if (mAllChildren[index].getParent() != null) {
    int clippedSoFar = 0;
    for (int i = 0; i < index; i++) {
      if (mAllChildren[i].getParent() == null) {
        clippedSoFar++;
      }
    }
    super.removeViewsInLayout(index - clippedSoFar, 1);
  }
  removeFromArray(index);
}
 
Example 4
Project: poper   File: FPoper.java   Source Code and License Vote up 6 votes
/**
 * 设置要Pop的view
 *
 * @param popView
 * @return
 */
public FPoper setPopView(View popView)
{
    final View old = mPopView;
    if (old != popView)
    {
        if (old != null)
        {
            old.removeOnLayoutChangeListener(mOnLayoutChangeListenerPopView);
        }

        mPopView = popView;

        if (popView != null)
        {
            popView.removeOnLayoutChangeListener(mOnLayoutChangeListenerPopView);
            popView.addOnLayoutChangeListener(mOnLayoutChangeListenerPopView);
        }
    }
    return this;
}
 
Example 5
Project: Phial   File: LayoutHelper.java   Source Code and License Vote up 5 votes
@Override
public void onLayoutChange(View v, int left, int top, int right, int bottom,
                           int oldLeft, int oldTop, int oldRight, int oldBottom) {
    targets.remove(v);
    v.removeOnLayoutChangeListener(this);
    if (targets.isEmpty()) {
        listener.onLayout();
    }
}
 
Example 6
Project: Phial   File: LayoutHelper.java   Source Code and License Vote up 5 votes
@Override
public void dispose() {
    for (View target : targets) {
        target.removeOnLayoutChangeListener(this);
    }
    targets.clear();
}
 
Example 7
Project: react-native-recyclerview-list   File: RecyclerViewBackedScrollView.java   Source Code and License Vote up 4 votes
@Override
public void onViewRemoved(View child) {
    super.onViewRemoved(child);
    child.removeOnLayoutChangeListener(mChildLayoutChangeListener);
}