@Override public void onLayoutChange(View v, int l, int t, int r, int b, int oL, int oT, int oR, int oB) { recyclerView.removeOnLayoutChangeListener(this); startPostponedEnterTransition(); } });
@Override public void onLayoutChange(View v, int l, int t, int r, int b, int oL, int oT, int oR, int oB) { nestedRecyclerView.removeOnLayoutChangeListener(this); callback.startPostponedEnterTransition(); } });
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) @Override public void onLayoutChange(View v, int l, int t, int r, int b, int oL, int oT, int oR, int oB) { RecyclerView.ViewHolder viewHolder = recyclerView.findViewHolderForAdapterPosition(finalIndex); if (viewHolder != null) { recyclerView.removeOnLayoutChangeListener(this); } else { //viewHolder hasn't been laid out yet --> wait recyclerView.scrollToPosition(finalIndex); } if (viewHolder instanceof NestedRecyclerViewAlbumHolder) { //found ViewHolder sharedElementViewHolder = (NestedRecyclerViewAlbumHolder) viewHolder; ((NestedRecyclerViewAlbumHolder) viewHolder) .onSharedElement(sharedElementReturnPosition, callback); } } });
@Override public void onDetachedFromRecyclerView(@NonNull RecyclerView recyclerView) { topBottomLocationManager.setRecyclerView(null); if (recyclerView != null && mHorDividerDecoration != null && (!disableDecoration)) { recyclerView.removeItemDecoration(mHorDividerDecoration); } if (recyclerView.getLayoutManager() instanceof StaggeredGridLayoutManager) { recyclerView.removeItemDecoration(staggeredGridSpaceDecoration); } this.recyclerView.removeOnLayoutChangeListener(onLayoutChangeListener); this.recyclerView.removeOnScrollListener(onScrollListener); this.recyclerView = null; super.onDetachedFromRecyclerView(recyclerView); }