AppListAdapter: force redraw on removal of selection

When a selection is removed, the selection index of other items
may also be changed. We have to notify all of them in order to display
the order correctly.
This commit is contained in:
Peter Cai 2018-10-14 13:43:10 +08:00
parent a2b893bb92
commit b95eed4e46
No known key found for this signature in database
GPG key ID: 71F5FB4E4F3FD54F

View file

@ -110,7 +110,11 @@ public class AppListAdapter extends RecyclerView.Adapter<AppListAdapter.ViewHold
@Override
public void onAnimationEnd(Animation animation) {
if (mIndex != -1) {
hideSelectOrder(mList.get(mIndex));
// The selection index of items other than this one
// can be changed because of the removal of the current one
// Thus, we just notify that the data set has been changed,
// to force redraw all of them.
notifyDataSetChanged();
}
}