[Android] Audio adapter has stable ids

Geoffrey Métais git at videolan.org
Fri Jan 18 15:50:39 CET 2019


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Jan 18 15:48:27 2019 +0100| [0614b19742d9d0004b42c93a52fd53dc96627a3f] | committer: Geoffrey Métais

Audio adapter has stable ids

> https://code.videolan.org/videolan/vlc-android/commit/0614b19742d9d0004b42c93a52fd53dc96627a3f
---

 .../org/videolan/vlc/gui/audio/AudioBrowserAdapter.java    | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserAdapter.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserAdapter.java
index 0d75eb6e2..ac4f22521 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserAdapter.java
@@ -24,15 +24,9 @@
 package org.videolan.vlc.gui.audio;
 
 import android.annotation.TargetApi;
-import androidx.paging.PagedList;
-import androidx.paging.PagedListAdapter;
 import android.content.Context;
-import androidx.databinding.ViewDataBinding;
 import android.graphics.drawable.BitmapDrawable;
 import android.os.Build;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.recyclerview.widget.DiffUtil;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -54,6 +48,13 @@ import org.videolan.vlc.util.Util;
 
 import java.util.List;
 
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.databinding.ViewDataBinding;
+import androidx.paging.PagedList;
+import androidx.paging.PagedListAdapter;
+import androidx.recyclerview.widget.DiffUtil;
+
 import static org.videolan.medialibrary.media.MediaLibraryItem.FLAG_SELECTED;
 
 public class AudioBrowserAdapter extends PagedListAdapter<MediaLibraryItem, AudioBrowserAdapter.ViewHolder> implements MultiSelectAdapter<MediaLibraryItem> {
@@ -74,6 +75,7 @@ public class AudioBrowserAdapter extends PagedListAdapter<MediaLibraryItem, Audi
         mType = type;
         mDefaultCover = getIconDrawable();
         mSort = sort;
+        setHasStableIds(true);
     }
 
     void setSort(int sort) {



More information about the Android mailing list