Replaced Serializable with Parcelable everywhere
This commit is contained in:
parent
c5b5460e01
commit
5bdd763248
21 changed files with 413 additions and 175 deletions
|
|
@ -31,7 +31,7 @@ public class AddToPlaylistDialog extends LeakDetectDialogFragment {
|
|||
public static AddToPlaylistDialog create(ArrayList<Song> songs) {
|
||||
AddToPlaylistDialog dialog = new AddToPlaylistDialog();
|
||||
Bundle args = new Bundle();
|
||||
args.putSerializable("songs", songs);
|
||||
args.putParcelableArrayList("songs", songs);
|
||||
dialog.setArguments(args);
|
||||
return dialog;
|
||||
}
|
||||
|
|
@ -52,7 +52,7 @@ public class AddToPlaylistDialog extends LeakDetectDialogFragment {
|
|||
@Override
|
||||
public void onSelection(@NonNull MaterialDialog materialDialog, View view, int i, CharSequence charSequence) {
|
||||
//noinspection unchecked
|
||||
final ArrayList<Song> songs = (ArrayList<Song>) getArguments().getSerializable("songs");
|
||||
final ArrayList<Song> songs = getArguments().getParcelableArrayList("songs");
|
||||
if (songs == null) return;
|
||||
if (i == 0) {
|
||||
materialDialog.dismiss();
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ public class ClearSmartPlaylistDialog extends LeakDetectDialogFragment {
|
|||
public static ClearSmartPlaylistDialog create(AbsSmartPlaylist playlist) {
|
||||
ClearSmartPlaylistDialog dialog = new ClearSmartPlaylistDialog();
|
||||
Bundle args = new Bundle();
|
||||
args.putSerializable("playlist", playlist);
|
||||
args.putParcelable("playlist", playlist);
|
||||
dialog.setArguments(args);
|
||||
return dialog;
|
||||
}
|
||||
|
|
@ -27,7 +27,7 @@ public class ClearSmartPlaylistDialog extends LeakDetectDialogFragment {
|
|||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
//noinspection unchecked
|
||||
final AbsSmartPlaylist playlist = (AbsSmartPlaylist) getArguments().getSerializable("playlist");
|
||||
final AbsSmartPlaylist playlist = (AbsSmartPlaylist) getArguments().getParcelable("playlist");
|
||||
int title = R.string.clear_playlist_title;
|
||||
//noinspection ConstantConditions
|
||||
CharSequence content = Html.fromHtml(getString(R.string.clear_playlist_x, playlist.name));
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ public class CreatePlaylistDialog extends LeakDetectDialogFragment {
|
|||
public static CreatePlaylistDialog create(ArrayList<Song> songs) {
|
||||
CreatePlaylistDialog dialog = new CreatePlaylistDialog();
|
||||
Bundle args = new Bundle();
|
||||
args.putSerializable("songs", songs);
|
||||
args.putParcelableArrayList("songs", songs);
|
||||
dialog.setArguments(args);
|
||||
return dialog;
|
||||
}
|
||||
|
|
@ -59,7 +59,7 @@ public class CreatePlaylistDialog extends LeakDetectDialogFragment {
|
|||
final int playlistId = PlaylistsUtil.createPlaylist(getActivity(), charSequence.toString());
|
||||
if (playlistId != -1 && getActivity() != null) {
|
||||
//noinspection unchecked
|
||||
ArrayList<Song> songs = (ArrayList<Song>) getArguments().getSerializable("songs");
|
||||
ArrayList<Song> songs = getArguments().getParcelableArrayList("songs");
|
||||
if (songs != null) {
|
||||
PlaylistsUtil.addToPlaylist(getActivity(), songs, playlistId, true);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public class DeletePlaylistDialog extends LeakDetectDialogFragment {
|
|||
public static DeletePlaylistDialog create(ArrayList<Playlist> playlists) {
|
||||
DeletePlaylistDialog dialog = new DeletePlaylistDialog();
|
||||
Bundle args = new Bundle();
|
||||
args.putSerializable("playlists", playlists);
|
||||
args.putParcelableArrayList("playlists", playlists);
|
||||
dialog.setArguments(args);
|
||||
return dialog;
|
||||
}
|
||||
|
|
@ -37,7 +37,7 @@ public class DeletePlaylistDialog extends LeakDetectDialogFragment {
|
|||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
//noinspection unchecked
|
||||
final ArrayList<Playlist> playlists = (ArrayList<Playlist>) getArguments().getSerializable("playlists");
|
||||
final ArrayList<Playlist> playlists = getArguments().getParcelableArrayList("playlists");
|
||||
int title;
|
||||
CharSequence content;
|
||||
//noinspection ConstantConditions
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public class DeleteSongsDialog extends LeakDetectDialogFragment {
|
|||
public static DeleteSongsDialog create(ArrayList<Song> songs) {
|
||||
DeleteSongsDialog dialog = new DeleteSongsDialog();
|
||||
Bundle args = new Bundle();
|
||||
args.putSerializable("songs", songs);
|
||||
args.putParcelableArrayList("songs", songs);
|
||||
dialog.setArguments(args);
|
||||
return dialog;
|
||||
}
|
||||
|
|
@ -37,7 +37,7 @@ public class DeleteSongsDialog extends LeakDetectDialogFragment {
|
|||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
//noinspection unchecked
|
||||
final ArrayList<Song> songs = (ArrayList<Song>) getArguments().getSerializable("songs");
|
||||
final ArrayList<Song> songs = getArguments().getParcelableArrayList("songs");
|
||||
int title;
|
||||
CharSequence content;
|
||||
if (songs.size() > 1) {
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ public class PlayingQueueDialog extends LeakDetectDialogFragment {
|
|||
final ArrayList<Song> playingQueue = MusicPlayerRemote.getPlayingQueue();
|
||||
PlayingQueueDialog dialog = new PlayingQueueDialog();
|
||||
Bundle args = new Bundle();
|
||||
args.putSerializable("queue", playingQueue);
|
||||
args.putParcelableArrayList("queue", playingQueue);
|
||||
dialog.setArguments(args);
|
||||
return dialog;
|
||||
}
|
||||
|
|
@ -44,14 +44,14 @@ public class PlayingQueueDialog extends LeakDetectDialogFragment {
|
|||
if (getActivity() == null)
|
||||
return;
|
||||
//noinspection unchecked
|
||||
ArrayList<Song> playingQueue = (ArrayList<Song>) getArguments().getSerializable("queue");
|
||||
ArrayList<Song> playingQueue = getArguments().getParcelableArrayList("queue");
|
||||
AddToPlaylistDialog.create(playingQueue).show(getActivity().getSupportFragmentManager(), "ADD_PLAYLIST");
|
||||
}
|
||||
})
|
||||
.build();
|
||||
|
||||
//noinspection unchecked
|
||||
final ArrayList<Song> playingQueue = (ArrayList<Song>) getArguments().getSerializable("queue");
|
||||
final ArrayList<Song> playingQueue = getArguments().getParcelableArrayList("queue");
|
||||
final DragSortListView dragSortListView = (DragSortListView) dialog.getCustomView().findViewById(R.id.dragSortListView);
|
||||
final PlayingQueueAdapterDeprecated playingQueueAdapterDeprecated =
|
||||
new PlayingQueueAdapterDeprecated((AppCompatActivity) getActivity(), playingQueue);
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public class RemoveFromPlaylistDialog extends LeakDetectDialogFragment {
|
|||
public static RemoveFromPlaylistDialog create(ArrayList<PlaylistSong> songs) {
|
||||
RemoveFromPlaylistDialog dialog = new RemoveFromPlaylistDialog();
|
||||
Bundle args = new Bundle();
|
||||
args.putSerializable("songs", songs);
|
||||
args.putParcelableArrayList("songs", songs);
|
||||
dialog.setArguments(args);
|
||||
return dialog;
|
||||
}
|
||||
|
|
@ -37,7 +37,7 @@ public class RemoveFromPlaylistDialog extends LeakDetectDialogFragment {
|
|||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
//noinspection unchecked
|
||||
final ArrayList<PlaylistSong> songs = (ArrayList<PlaylistSong>) getArguments().getSerializable("songs");
|
||||
final ArrayList<PlaylistSong> songs = getArguments().getParcelableArrayList("songs");
|
||||
int title;
|
||||
CharSequence content;
|
||||
if (songs.size() > 1) {
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ public class SongDetailDialog extends LeakDetectDialogFragment {
|
|||
public static SongDetailDialog create(Song song) {
|
||||
SongDetailDialog dialog = new SongDetailDialog();
|
||||
Bundle args = new Bundle();
|
||||
args.putSerializable("song", song);
|
||||
args.putParcelable("song", song);
|
||||
dialog.setArguments(args);
|
||||
return dialog;
|
||||
}
|
||||
|
|
@ -57,7 +57,7 @@ public class SongDetailDialog extends LeakDetectDialogFragment {
|
|||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
final Activity context = getActivity();
|
||||
final Song song = (Song) getArguments().getSerializable("song");
|
||||
final Song song = (Song) getArguments().getParcelable("song");
|
||||
|
||||
MaterialDialog dialog = new MaterialDialog.Builder(context)
|
||||
.customView(R.layout.dialog_file_details, true)
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ public class SongShareDialog extends LeakDetectDialogFragment {
|
|||
public static SongShareDialog create(final Song song) {
|
||||
final SongShareDialog dialog = new SongShareDialog();
|
||||
final Bundle args = new Bundle();
|
||||
args.putSerializable("song", song);
|
||||
args.putParcelable("song", song);
|
||||
dialog.setArguments(args);
|
||||
return dialog;
|
||||
}
|
||||
|
|
@ -27,7 +27,7 @@ public class SongShareDialog extends LeakDetectDialogFragment {
|
|||
@NonNull
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
final Song song = (Song) getArguments().getSerializable("song");
|
||||
final Song song = (Song) getArguments().getParcelable("song");
|
||||
final String currentlyListening = getString(R.string.currently_listening_to_x_by_x, song.title, song.artistName);
|
||||
return new MaterialDialog.Builder(getActivity())
|
||||
.title(R.string.what_do_you_want_to_share)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue