update shortcut overrides and other code changes
This commit is contained in:
parent
fc6a71b2c0
commit
d8d5b97d4b
29 changed files with 55 additions and 51 deletions
|
|
@ -16,28 +16,28 @@ public class AbsMusicServiceFragment extends Fragment implements MusicServiceEve
|
|||
@Override
|
||||
public void onAttach(@NonNull Context context) {
|
||||
super.onAttach(context);
|
||||
try {
|
||||
activity = (AbsMusicServiceActivity) context;
|
||||
} catch (ClassCastException e) {
|
||||
throw new RuntimeException(context.getClass().getSimpleName() + " must be an instance of " + AbsMusicServiceActivity.class.getSimpleName());
|
||||
}
|
||||
|
||||
activity = (AbsMusicServiceActivity) context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDetach() {
|
||||
super.onDetach();
|
||||
|
||||
activity = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
|
||||
activity.addMusicServiceEventListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
|
||||
activity.removeMusicServiceEventListener(this);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ public class GenresFragment extends AbsLibraryPagerRecyclerViewFragment<GenreAda
|
|||
@Override
|
||||
protected GenreAdapter createAdapter() {
|
||||
List<Genre> dataSet = getAdapter() == null ? new ArrayList<>() : getAdapter().getDataSet();
|
||||
return new GenreAdapter(getLibraryFragment().getMainActivity(), dataSet, R.layout.item_list_single_row);
|
||||
return new GenreAdapter(getLibraryFragment().getMainActivity(), dataSet);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ public abstract class AbsPlayerFragment extends AbsMusicServiceFragment implemen
|
|||
toggleFavorite(song);
|
||||
return true;
|
||||
case R.id.action_share:
|
||||
SongShareDialog.create(song).show(getParentFragmentManager(), "SHARE_SONG");
|
||||
SongShareDialog.create(song).show(getParentFragmentManager(), SongShareDialog.TAG);
|
||||
return true;
|
||||
case R.id.action_add_to_playlist:
|
||||
AddToPlaylistDialog.create(song).show(getParentFragmentManager(), "ADD_PLAYLIST");
|
||||
|
|
@ -67,7 +67,7 @@ public abstract class AbsPlayerFragment extends AbsMusicServiceFragment implemen
|
|||
CreatePlaylistDialog.create(MusicPlayerRemote.getPlayingQueue()).show(getParentFragmentManager(), "ADD_TO_PLAYLIST");
|
||||
return true;
|
||||
case R.id.action_details:
|
||||
SongDetailDialog.create(song).show(getParentFragmentManager(), "SONG_DETAIL");
|
||||
SongDetailDialog.create(song).show(getParentFragmentManager(), SongDetailDialog.TAG);
|
||||
return true;
|
||||
case R.id.action_go_to_album:
|
||||
NavigationUtil.startAlbum(requireActivity(), new Album(song));
|
||||
|
|
|
|||
|
|
@ -419,7 +419,7 @@ public class CardPlayerFragment extends AbsPlayerFragment implements PlayerAlbum
|
|||
MusicPlayerRemote.removeFromQueue(MusicPlayerRemote.getPosition());
|
||||
return true;
|
||||
case R.id.action_share:
|
||||
SongShareDialog.create(getSong()).show(fragment.getParentFragmentManager(), "SONG_SHARE_DIALOG");
|
||||
SongShareDialog.create(getSong()).show(fragment.getParentFragmentManager(), SongShareDialog.TAG);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -406,7 +406,7 @@ public class FlatPlayerFragment extends AbsPlayerFragment implements PlayerAlbum
|
|||
MusicPlayerRemote.removeFromQueue(MusicPlayerRemote.getPosition());
|
||||
return true;
|
||||
case R.id.action_share:
|
||||
SongShareDialog.create(getSong()).show(fragment.getParentFragmentManager(), "SONG_SHARE_DIALOG");
|
||||
SongShareDialog.create(getSong()).show(fragment.getParentFragmentManager(), SongShareDialog.TAG);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue