Add option to disable cover art
This commit is contained in:
parent
a9db1f55fb
commit
17e8e400e4
@ -117,6 +117,8 @@ THE SOFTWARE.
|
|||||||
<string name="default_action_summary">What to do when an item is tapped</string>
|
<string name="default_action_summary">What to do when an item is tapped</string>
|
||||||
|
|
||||||
<string name="pref_misc">Miscellaneous Features</string>
|
<string name="pref_misc">Miscellaneous Features</string>
|
||||||
|
<string name="disable_cover_art_title">Disable Cover Art</string>
|
||||||
|
<string name="disable_cover_art_summary">Do not show cover art anywhere in the application</string>
|
||||||
<string name="use_idle_timeout_title">Enable Idle Timeout</string>
|
<string name="use_idle_timeout_title">Enable Idle Timeout</string>
|
||||||
<string name="use_idle_timeout_summary">When active, playback will be stopped after the given period of inactivity</string>
|
<string name="use_idle_timeout_summary">When active, playback will be stopped after the given period of inactivity</string>
|
||||||
<string name="idle_timeout_title">Idle Timeout</string>
|
<string name="idle_timeout_title">Idle Timeout</string>
|
||||||
|
@ -75,6 +75,11 @@ THE SOFTWARE.
|
|||||||
android:defaultValue="0" />
|
android:defaultValue="0" />
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
<PreferenceCategory android:title="@string/pref_misc">
|
<PreferenceCategory android:title="@string/pref_misc">
|
||||||
|
<CheckBoxPreference
|
||||||
|
android:key="disable_cover_art"
|
||||||
|
android:title="@string/disable_cover_art_title"
|
||||||
|
android:summary="@string/disable_cover_art_summary"
|
||||||
|
android:defaultValue="false" />
|
||||||
<CheckBoxPreference
|
<CheckBoxPreference
|
||||||
android:key="use_idle_timeout"
|
android:key="use_idle_timeout"
|
||||||
android:title="@string/use_idle_timeout_title"
|
android:title="@string/use_idle_timeout_title"
|
||||||
|
@ -416,6 +416,7 @@ public final class PlaybackService extends Service implements Handler.Callback,
|
|||||||
mMediaPlayer.setVolume(volume, volume);
|
mMediaPlayer.setVolume(volume, volume);
|
||||||
}
|
}
|
||||||
mIdleTimeout = settings.getBoolean("use_idle_timeout", false) ? settings.getInt("idle_timeout", 3600) : 0;
|
mIdleTimeout = settings.getBoolean("use_idle_timeout", false) ? settings.getInt("idle_timeout", 3600) : 0;
|
||||||
|
Song.mDisableCoverArt = settings.getBoolean("disable_cover_art", false);
|
||||||
|
|
||||||
PowerManager powerManager = (PowerManager)getSystemService(POWER_SERVICE);
|
PowerManager powerManager = (PowerManager)getSystemService(POWER_SERVICE);
|
||||||
mWakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "VanillaMusicSongChangeLock");
|
mWakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "VanillaMusicSongChangeLock");
|
||||||
@ -456,6 +457,8 @@ public final class PlaybackService extends Service implements Handler.Callback,
|
|||||||
} else if ("use_idle_timeout".equals(key) || "idle_timeout".equals(key)) {
|
} else if ("use_idle_timeout".equals(key) || "idle_timeout".equals(key)) {
|
||||||
mIdleTimeout = settings.getBoolean("use_idle_timeout", false) ? settings.getInt("idle_timeout", 3600) : 0;
|
mIdleTimeout = settings.getBoolean("use_idle_timeout", false) ? settings.getInt("idle_timeout", 3600) : 0;
|
||||||
userActionTriggered();
|
userActionTriggered();
|
||||||
|
} else if ("disable_cover_art".equals(key)) {
|
||||||
|
Song.mDisableCoverArt = settings.getBoolean("disable_cover_art", false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,6 +54,11 @@ public class Song implements Parcelable {
|
|||||||
*/
|
*/
|
||||||
private static final Cache<Bitmap> mCoverCache = new Cache<Bitmap>(10);
|
private static final Cache<Bitmap> mCoverCache = new Cache<Bitmap>(10);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If true, will not attempt to load any cover art in getCover()
|
||||||
|
*/
|
||||||
|
public static boolean mDisableCoverArt = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shuffled list of all ids in the library.
|
* Shuffled list of all ids in the library.
|
||||||
*/
|
*/
|
||||||
@ -393,7 +398,7 @@ public class Song implements Parcelable {
|
|||||||
*/
|
*/
|
||||||
public Bitmap getCover()
|
public Bitmap getCover()
|
||||||
{
|
{
|
||||||
if (id == -1)
|
if (id == -1 || mDisableCoverArt)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
// Query the cache for the cover
|
// Query the cache for the cover
|
||||||
|
Loading…
x
Reference in New Issue
Block a user