Commit 5a3f44fa authored by Edward Wang's avatar Edward Wang

src: Remove directory view from the audio media library

parent 8e41ac5d
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment