forked from kabouzeid/Phonograph
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes issue kabouzeid#112 - Crash on too many songs in App Shortcut p…
…laylist Instead of passing all songs in an intent extra, pass the Playlist which is then used to load the songs in MusicService
- Loading branch information
Showing
4 changed files
with
111 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
app/src/main/java/com/kabouzeid/gramophone/model/smartplaylist/ShuffleAllPlaylist.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package com.kabouzeid.gramophone.model.smartplaylist; | ||
|
||
import android.content.Context; | ||
import android.os.Parcel; | ||
import android.support.annotation.NonNull; | ||
|
||
import com.kabouzeid.gramophone.R; | ||
import com.kabouzeid.gramophone.loader.SongLoader; | ||
import com.kabouzeid.gramophone.model.Song; | ||
|
||
import java.util.ArrayList; | ||
|
||
public class ShuffleAllPlaylist extends AbsSmartPlaylist { | ||
|
||
public ShuffleAllPlaylist(@NonNull Context context) { | ||
super(context.getString(R.string.shuffle_all), R.drawable.ic_shuffle_white_24dp); | ||
} | ||
|
||
@NonNull | ||
@Override | ||
public ArrayList<Song> getSongs(@NonNull Context context) { | ||
return SongLoader.getAllSongs(context); | ||
} | ||
|
||
@Override | ||
public void clear(@NonNull Context context) { | ||
//Can't clear all songs. Don't do anything here? | ||
} | ||
|
||
|
||
@Override | ||
public int describeContents() { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public void writeToParcel(Parcel dest, int flags) { | ||
super.writeToParcel(dest, flags); | ||
} | ||
|
||
protected ShuffleAllPlaylist(Parcel in) { | ||
super(in); | ||
} | ||
|
||
public static final Creator<ShuffleAllPlaylist> CREATOR = new Creator<ShuffleAllPlaylist>() { | ||
public ShuffleAllPlaylist createFromParcel(Parcel source) { | ||
return new ShuffleAllPlaylist(source); | ||
} | ||
|
||
public ShuffleAllPlaylist[] newArray(int size) { | ||
return new ShuffleAllPlaylist[size]; | ||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters