Java Code Examples for androidx.recyclerview.widget.RecyclerView#addOnChildAttachStateChangeListener()

The following examples show how to use androidx.recyclerview.widget.RecyclerView#addOnChildAttachStateChangeListener() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EpoxyVisibilityTracker.java    From epoxy with Apache License 2.0 5 votes vote down vote up
/**
 * Attach the tracker.
 *
 * @param recyclerView The recyclerview that the EpoxyController has its adapter added to.
 */
public void attach(@NonNull RecyclerView recyclerView) {
  attachedRecyclerView = recyclerView;
  recyclerView.addOnScrollListener(this.listener);
  recyclerView.addOnLayoutChangeListener(this.listener);
  recyclerView.addOnChildAttachStateChangeListener(this.listener);
  setTracker(recyclerView, this);
}
 
Example 2
Source File: PagerLayoutManager.java    From videoplay with Apache License 2.0 4 votes vote down vote up
@Override
public void onAttachedToWindow(RecyclerView view) {
    view.addOnChildAttachStateChangeListener(this);
    mPagerSnapHelper.attachToRecyclerView(view);
    super.onAttachedToWindow(view);
}
 
Example 3
Source File: ViewPagerLayoutManager.java    From DKVideoPlayer with Apache License 2.0 4 votes vote down vote up
@Override
public void onAttachedToWindow(RecyclerView recyclerView) {
    super.onAttachedToWindow(recyclerView);
    mPagerSnapHelper.attachToRecyclerView(recyclerView);
    recyclerView.addOnChildAttachStateChangeListener(this);
}