[Android] AudioBrowserListAdapter: refactor

Thomas Guillem git at videolan.org
Mon Jan 26 15:59:54 CET 2015


vlc-ports/android | branch: master | Thomas Guillem <thomas at gllm.fr> | Mon Jan 26 15:06:19 2015 +0100| [0a3f38ff2dd7d72d405790f6598182054e56d49c] | committer: Thomas Guillem

AudioBrowserListAdapter: refactor

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=0a3f38ff2dd7d72d405790f6598182054e56d49c
---

 .../videolan/vlc/gui/audio/AudioBrowserListAdapter.java    |   12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserListAdapter.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserListAdapter.java
index 1800c5a..58dc170 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserListAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserListAdapter.java
@@ -148,17 +148,7 @@ public class AudioBrowserListAdapter extends BaseAdapter implements SectionIndex
                             title = media.getTitle();
                             subTitle = Util.getMediaArtist(mContext, media);
                     }
-                    if (title == null)
-                        continue;
-                    title = title.trim();
-                    if (subTitle != null) subTitle = subTitle.trim();
-                    if (mMediaItemMap.containsKey(title))
-                        mMediaItemMap.get(title).mMediaList.add(media);
-                    else {
-                        ListItem item = new ListItem(title, subTitle, media, false);
-                        mMediaItemMap.put(title, item);
-                        mItems.add(item);
-                    }
+                    add(title, subTitle, media);
                 }
                 calculateSections(type);
             }



More information about the Android mailing list