Commit bea806fc authored by Adrien Maglo's avatar Adrien Maglo

VideoGridList: show the group list as a secondary fragment

parent 13e5acbe
......@@ -38,6 +38,7 @@ import org.videolan.vlc.gui.audio.AudioAlbumsSongsFragment;
import org.videolan.vlc.gui.audio.AudioPlayer;
import org.videolan.vlc.gui.audio.EqualizerFragment;
import org.videolan.vlc.gui.video.MediaInfoFragment;
import org.videolan.vlc.gui.video.VideoGridFragment;
import org.videolan.vlc.gui.video.VideoListAdapter;
import org.videolan.vlc.interfaces.ISortable;
import org.videolan.vlc.widget.SlidingPaneLayout;
......@@ -116,7 +117,8 @@ public class MainActivity extends SherlockFragmentActivity {
private String mCurrentFragment;
private String mPreviousFragment;
private List<String> secondaryFragments = Arrays.asList("albumsSongs", "equalizer",
"about", "search", "mediaInfo");
"about", "search", "mediaInfo",
"videoGroupList");
private HashMap<String, Fragment> mSecondaryFragments = new HashMap<String, Fragment>();
private SharedPreferences mSettings;
......@@ -491,6 +493,8 @@ public class MainActivity extends SherlockFragmentActivity {
f = new SearchFragment();
} else if(id.equals("mediaInfo")) {
f = new MediaInfoFragment();
} else if(id.equals("videoGroupList")) {
f = new VideoGridFragment();
}
else {
throw new IllegalArgumentException("Wrong fragment id.");
......
......@@ -257,9 +257,9 @@ public class VideoGridFragment extends SherlockGridFragment implements ISortable
public void onGridItemClick(GridView l, View v, int position, long id) {
Media media = (Media) getListAdapter().getItem(position);
if (media instanceof MediaGroup) {
VideoGridFragment videoList = new VideoGridFragment();
videoList.setGroup(media.getTitle());
MainActivity.ShowFragment(getActivity(), "videolist", videoList);
MainActivity activity = (MainActivity)getActivity();
VideoGridFragment frag = (VideoGridFragment)activity.showSecondaryFragment("videoGroupList");
frag.setGroup(media.getTitle());
}
else
playVideo(media, false);
......
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