[Android] Audio browser: assign more meaningful type of item names

Adrien Maglo git at videolan.org
Tue Nov 19 17:38:22 CET 2013


vlc-ports/android | branch: master | Adrien Maglo <magsoft at videolan.org> | Tue Nov 19 17:37:57 2013 +0100| [e9d81f67e4278a285a3c90bd32aee2dca4be93e2] | committer: Adrien Maglo

Audio browser: assign more meaningful type of item names

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

 .../org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java   |    4 ++--
 .../src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java   |    2 +-
 .../org/videolan/vlc/gui/audio/AudioBrowserListAdapter.java    |    8 ++++----
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java
index 20dd3c8..65b7de2 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java
@@ -69,8 +69,8 @@ public class AudioAlbumsSongsFragment extends SherlockFragment {
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
-        mAlbumsAdapter = new AudioBrowserListAdapter(getActivity(), AudioBrowserListAdapter.ITEM_NORMAL);
-        mSongsAdapter = new AudioBrowserListAdapter(getActivity(), AudioBrowserListAdapter.ITEM_NORMAL);
+        mAlbumsAdapter = new AudioBrowserListAdapter(getActivity(), AudioBrowserListAdapter.ITEM_WITH_COVER);
+        mSongsAdapter = new AudioBrowserListAdapter(getActivity(), AudioBrowserListAdapter.ITEM_WITH_COVER);
 
         mAudioController = AudioServiceController.getInstance();
     }
diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
index f35ad34..b7c6527 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
@@ -111,7 +111,7 @@ public class AudioBrowserFragment extends SherlockFragment implements ISortable
         mArtistsAdapter = new AudioPlaylistAdapter(getActivity(), R.plurals.albums_quantity, R.plurals.songs_quantity);
         mAlbumsAdapter = new AudioPlaylistAdapter(getActivity(), R.plurals.songs_quantity, R.plurals.songs_quantity);
         mGenresAdapter = new AudioPlaylistAdapter(getActivity(), R.plurals.albums_quantity, R.plurals.songs_quantity);
-        mArtistsAdapter2 = new AudioBrowserListAdapter(getActivity(), AudioBrowserListAdapter.ITEM_SIMPLE);
+        mArtistsAdapter2 = new AudioBrowserListAdapter(getActivity(), AudioBrowserListAdapter.ITEM_WITHOUT_COVER);
     }
 
     @Override
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 5973881..d41bbd4 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserListAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserListAdapter.java
@@ -54,8 +54,8 @@ public class AudioBrowserListAdapter implements ListAdapter {
     private static final int VIEW_SEPARATOR = 1;
 
     // The types of the media views.
-    public static final int ITEM_SIMPLE = 0;
-    public static final int ITEM_NORMAL = 1;
+    public static final int ITEM_WITHOUT_COVER = 0;
+    public static final int ITEM_WITH_COVER = 1;
     private int mItemType;
 
     // An item of the list: a media or a separator.
@@ -81,7 +81,7 @@ public class AudioBrowserListAdapter implements ListAdapter {
         mMediaItemMap = new HashMap<String, ListItem>();
         mItems = new ArrayList<ListItem>();
         mContext = context;
-        if (itemType != ITEM_SIMPLE && itemType != ITEM_NORMAL)
+        if (itemType != ITEM_WITHOUT_COVER && itemType != ITEM_WITH_COVER)
             throw new IllegalArgumentException();
         mItemType = itemType;
     }
@@ -144,7 +144,7 @@ public class AudioBrowserListAdapter implements ListAdapter {
         holder.title.setText(item.mTitle);
 
         RelativeLayout.LayoutParams paramsCover;
-        if (mItemType == ITEM_NORMAL) {
+        if (mItemType == ITEM_WITH_COVER) {
             /*Bitmap cover = AudioUtil.getCover(v.getContext(), media, 64);
             if (cover == null)*/
             Bitmap cover = BitmapCache.GetFromResource(v, R.drawable.icon);



More information about the Android mailing list