Skip to content

Commit

Permalink
Merge branch 'feature/make_wrapper_adapters_safe_after_released' into…
Browse files Browse the repository at this point in the history
… develop
  • Loading branch information
h6ah4i committed Nov 7, 2015
2 parents 766a75b + 823954a commit 710b001
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,16 @@ public void onViewRecycled(VH holder) {

// reset SwipeableItemViewHolder state
if (holder instanceof SwipeableItemViewHolder) {
mSwipeManager.cancelPendingAnimations(holder);
if (mSwipeManager != null) {
mSwipeManager.cancelPendingAnimations(holder);
}

SwipeableItemViewHolder swipeableHolder = (SwipeableItemViewHolder) holder;

setSwipeItemSlideAmount(((SwipeableItemViewHolder) holder), 0.0f, swipeHorizontal());
swipeableHolder.setSwipeItemHorizontalSlideAmount(0);
swipeableHolder.setSwipeItemVerticalSlideAmount(0);

View containerView = ((SwipeableItemViewHolder) holder).getSwipeableContainerView();
View containerView = swipeableHolder.getSwipeableContainerView();

if (containerView != null) {
ViewCompat.animate(containerView).cancel();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public BaseWrapperAdapter(RecyclerView.Adapter<VH> adapter) {
super.setHasStableIds(mWrappedAdapter.hasStableIds());
}

private boolean isWrappedAdapterAlive(){
public boolean isWrappedAdapterAlive(){
return mWrappedAdapter!=null;
}

Expand Down

0 comments on commit 710b001

Please sign in to comment.