diff options
Diffstat (limited to 'app/src/main/java/github/daneren2005/dsub/fragments/SelectGenreFragment.java')
-rw-r--r-- | app/src/main/java/github/daneren2005/dsub/fragments/SelectGenreFragment.java | 52 |
1 files changed, 30 insertions, 22 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/fragments/SelectGenreFragment.java b/app/src/main/java/github/daneren2005/dsub/fragments/SelectGenreFragment.java index 2d310172..cb57c280 100644 --- a/app/src/main/java/github/daneren2005/dsub/fragments/SelectGenreFragment.java +++ b/app/src/main/java/github/daneren2005/dsub/fragments/SelectGenreFragment.java @@ -1,37 +1,39 @@ /* - This file is part of Subsonic. + This file is part of Subsonic. + Subsonic is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + Subsonic is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with Subsonic. If not, see <http://www.gnu.org/licenses/>. + Copyright 2015 (C) Scott Jackson +*/ - Subsonic is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - Subsonic is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Subsonic. If not, see <http://www.gnu.org/licenses/>. - - Copyright 2010 (C) Sindre Mehus - */ package github.daneren2005.dsub.fragments; import android.os.Bundle; +import android.view.Menu; +import android.view.MenuInflater; +import android.view.MenuItem; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; import github.daneren2005.dsub.R; +import github.daneren2005.dsub.adapter.SectionAdapter; import github.daneren2005.dsub.domain.Genre; import github.daneren2005.dsub.service.MusicService; import github.daneren2005.dsub.util.Constants; import github.daneren2005.dsub.util.ProgressListener; import github.daneren2005.dsub.adapter.GenreAdapter; +import github.daneren2005.dsub.view.UpdateView; import java.util.List; -public class SelectGenreFragment extends SelectListFragment<Genre> { +public class SelectGenreFragment extends SelectRecyclerFragment<Genre> { private static final String TAG = SelectGenreFragment.class.getSimpleName(); @Override @@ -40,8 +42,8 @@ public class SelectGenreFragment extends SelectListFragment<Genre> { } @Override - public ArrayAdapter getAdapter(List<Genre> objs) { - return new GenreAdapter(context, objs); + public SectionAdapter getAdapter(List<Genre> objs) { + return new GenreAdapter(context, objs, this); } @Override @@ -55,9 +57,7 @@ public class SelectGenreFragment extends SelectListFragment<Genre> { } @Override - public void onItemClick(AdapterView<?> parent, View view, int position, long id) { - Genre genre = (Genre) parent.getItemAtPosition(position); - + public void onItemClicked(Genre genre) { SubsonicFragment fragment = new SelectDirectoryFragment(); Bundle args = new Bundle(); args.putString(Constants.INTENT_EXTRA_NAME_ALBUM_LIST_TYPE, "genres"); @@ -68,4 +68,12 @@ public class SelectGenreFragment extends SelectListFragment<Genre> { replaceFragment(fragment); } + + @Override + public void onCreateContextMenu(Menu menu, MenuInflater menuInflater, UpdateView<Genre> updateView, Genre item) {} + + @Override + public boolean onContextItemSelected(MenuItem menuItem, UpdateView<Genre> updateView, Genre item) { + return false; + } } |