[Android] [PATCH 1/3] AudioBrowserListAdapter: refactor

Thomas Guillem thomas at gllm.fr
Mon Jan 26 15:54:24 CET 2015


---
 .../org/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);
             }
-- 
2.1.3



More information about the Android mailing list