[Android] src: Remove directory view from the audio media library

Edward Wang git at videolan.org
Fri Jun 22 04:01:02 CEST 2012


android | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Thu Jun 21 21:46:17 2012 -0400| [5a3f44fa07cdb7d6904482f82a810d6cd603069a] | committer: Edward Wang

src: Remove directory view from the audio media library

> http://git.videolan.org/gitweb.cgi/android.git/?a=commit;h=5a3f44fa07cdb7d6904482f82a810d6cd603069a
---

 vlc-android/res/layout/audio_browser.xml           |    8 -----
 .../vlc/gui/audio/AudioBrowserFragment.java        |   36 --------------------
 2 files changed, 44 deletions(-)

diff --git a/vlc-android/res/layout/audio_browser.xml b/vlc-android/res/layout/audio_browser.xml
index c74c6c2..ac1ad0e 100644
--- a/vlc-android/res/layout/audio_browser.xml
+++ b/vlc-android/res/layout/audio_browser.xml
@@ -49,14 +49,6 @@
                 android:layout_width="80dip"
                 android:layout_height="wrap_content"
                 android:gravity="center_horizontal" />
-            <TextView
-                android:text="@string/directories"
-                android:textSize="16dip"
-                android:textColor="#888888"
-                android:id="@+id/directory"
-                android:layout_width="80dip"
-                android:layout_height="wrap_content"
-                android:gravity="center_horizontal" />
         </LinearLayout>
     </HorizontalScrollView>
     <View
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 b39e7a6..e29f940 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
@@ -84,7 +84,6 @@ public class AudioBrowserFragment extends SherlockFragment implements ISortable
     private AudioPlaylistAdapter mArtistsAdapter;
     private AudioPlaylistAdapter mAlbumsAdapter;
     private AudioPlaylistAdapter mGenresAdapter;
-    private AudioDirectoryAdapter mDirectoryAdapter;
 
     public final static int SORT_BY_TITLE = 0;
     public final static int SORT_BY_LENGTH = 1;
@@ -95,7 +94,6 @@ public class AudioBrowserFragment extends SherlockFragment implements ISortable
     public final static int MODE_ALBUM = 1;
     public final static int MODE_SONG = 2;
     public final static int MODE_GENRE = 3;
-    public final static int MODE_DIRECTORY = 4;
 
     public final static int MENU_PLAY = Menu.FIRST;
     public final static int MENU_APPEND = Menu.FIRST + 1;
@@ -116,7 +114,6 @@ public class AudioBrowserFragment extends SherlockFragment implements ISortable
         mArtistsAdapter = new AudioPlaylistAdapter(getActivity(), R.plurals.albums, R.plurals.songs);
         mAlbumsAdapter = new AudioPlaylistAdapter(getActivity(), R.plurals.songs, R.plurals.songs);
         mGenresAdapter = new AudioPlaylistAdapter(getActivity(), R.plurals.albums, R.plurals.songs);
-        mDirectoryAdapter = new AudioDirectoryAdapter(getActivity());
     }
 
     @Override
@@ -146,24 +143,20 @@ public class AudioBrowserFragment extends SherlockFragment implements ISortable
         artistList.setAdapter(mArtistsAdapter);
         albumList.setAdapter(mAlbumsAdapter);
         genreList.setAdapter(mGenresAdapter);
-        directoryList.setAdapter(mDirectoryAdapter);
 
         songsList.setOnItemClickListener(songListener);
         artistList.setOnGroupClickListener(playlistListener);
         albumList.setOnGroupClickListener(playlistListener);
         genreList.setOnGroupClickListener(playlistListener);
-        directoryList.setOnItemClickListener(directoryListener);
 
         artistList.setOnChildClickListener(playlistChildListener);
         albumList.setOnChildClickListener(playlistChildListener);
         genreList.setOnChildClickListener(playlistChildListener);
-        //directoryList.setOnChildClickListener(playlistChildListener);
 
         songsList.setOnCreateContextMenuListener(contextMenuListener);
         artistList.setOnCreateContextMenuListener(contextMenuListener);
         albumList.setOnCreateContextMenuListener(contextMenuListener);
         genreList.setOnCreateContextMenuListener(contextMenuListener);
-        directoryList.setOnCreateContextMenuListener(contextMenuListener);
 
         return v;
     }
@@ -184,33 +177,6 @@ public class AudioBrowserFragment extends SherlockFragment implements ISortable
         }
     };
 
-    OnItemClickListener directoryListener = new OnItemClickListener() {
-        @Override
-        public void onItemClick(AdapterView<?> av, View v, int p, long id) {
-            Boolean success = mDirectoryAdapter.browse(p);
-            if(!success) { /* Clicked on a media file */
-                String mediaFile = mDirectoryAdapter.getMediaLocation(p);
-                try {
-                    if(!LibVLC.getExistingInstance().hasVideoTrack(mediaFile)) {
-                        ArrayList<String> arrayList = new ArrayList<String>();
-                        arrayList.add(mDirectoryAdapter.getMediaLocation(p));
-                        mAudioController.load(arrayList, 0);
-                        Intent intent = new Intent(getActivity(), AudioPlayerActivity.class);
-                        intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
-                        startActivity(intent);
-                    } else {
-                        mAudioController.stop();
-                        Intent intent = new Intent(getActivity(), VideoPlayerActivity.class);
-                        intent.putExtra("itemLocation", mediaFile);
-                        startActivity(intent);
-                    }
-                } catch (IOException e) {
-                    /* disk error maybe? */
-                }
-            }
-        }
-    };
-
     OnGroupClickListener playlistListener = new OnGroupClickListener() {
         @Override
         public boolean onGroupClick(ExpandableListView elv, View v, int groupPosition, long id) {
@@ -470,7 +436,6 @@ public class AudioBrowserFragment extends SherlockFragment implements ISortable
         mArtistsAdapter.clear();
         mAlbumsAdapter.clear();
         mGenresAdapter.clear();
-        mDirectoryAdapter.clear();
 
         switch(mSortBy) {
         case SORT_BY_LENGTH:
@@ -511,7 +476,6 @@ public class AudioBrowserFragment extends SherlockFragment implements ISortable
         mArtistsAdapter.notifyDataSetChanged();
         mAlbumsAdapter.notifyDataSetChanged();
         mGenresAdapter.notifyDataSetChanged();
-        mDirectoryAdapter.notifyDataSetChanged();
     }
 
     @Override



More information about the Android mailing list