Commit eaab8600 authored by Geoffrey Métais's avatar Geoffrey Métais

Fix video item update notification

parent 11aa8a75
...@@ -243,6 +243,7 @@ public class VideoListAdapter extends RecyclerView.Adapter<VideoListAdapter.View ...@@ -243,6 +243,7 @@ public class VideoListAdapter extends RecyclerView.Adapter<VideoListAdapter.View
int position = mVideos.indexOf(item); int position = mVideos.indexOf(item);
if (position != -1) { if (position != -1) {
mVideos.set(position, item); mVideos.set(position, item);
notifyItemChanged(position);
} else { } else {
MediaWrapper mw; MediaWrapper mw;
for (int i = 0; i < mVideos.size(); ++i) { for (int i = 0; i < mVideos.size(); ++i) {
...@@ -254,14 +255,13 @@ public class VideoListAdapter extends RecyclerView.Adapter<VideoListAdapter.View ...@@ -254,14 +255,13 @@ public class VideoListAdapter extends RecyclerView.Adapter<VideoListAdapter.View
} }
if (position == -1) { if (position == -1) {
position = mVideos.size(); position = mVideos.size();
mVideos.add(item); mVideos.add(position, item);
notifyItemChanged(position); notifyItemInserted(position);
} else { } else {
mVideos.add(position, item); mVideos.add(position, item);
notifyItemRangeChanged(position, mVideos.size()); notifyItemRangeChanged(position, mVideos.size());
} }
} }
notifyItemChanged(position);
} }
public void clear() { public void clear() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment