Permalink
Browse files

added ability to use a resource for the lock screen image

  • Loading branch information...
1 parent f68e358 commit a470a2b82428c6dc2c5d7f20e9797d459b56350e @rebeccanesson rebeccanesson committed Oct 29, 2012
@@ -10,6 +10,7 @@
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
+import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.media.AudioManager;
@@ -171,6 +172,12 @@ public void setLockScreenImage(FileDescriptor fd) {
}
}
+ public void setLockScreenImage(Resources res, int id) {
+ if (res != null) {
+ this.lockScreenImage = BitmapFactory.decodeResource(res, id);
+ }
+ }
+
public void setLockScreenTitle(String title) {
this.lockScreenTitle = title;
}
@@ -4,6 +4,7 @@
import java.io.IOException;
import android.app.Activity;
+import android.content.res.Resources;
import android.media.MediaPlayer.OnBufferingUpdateListener;
import android.media.MediaPlayer.OnCompletionListener;
import android.media.MediaPlayer.OnErrorListener;
@@ -46,6 +47,7 @@
void setNotificationText(String notificationText);
void setLockScreenImage(FileDescriptor file);
+ void setLockScreenImage(Resources res, int id);
void setLockScreenTitle(String title);
void setAutoNotify(boolean autoNotify);
@@ -8,6 +8,7 @@
import org.prx.android.playerhater.PlayerHater;
import android.app.Activity;
+import android.content.res.Resources;
import android.media.MediaPlayer.OnBufferingUpdateListener;
import android.media.MediaPlayer.OnCompletionListener;
import android.media.MediaPlayer.OnErrorListener;
@@ -290,6 +291,11 @@ public void setNotificationText(String notificationText) {
public void setLockScreenImage(FileDescriptor file) {
mService.setLockScreenImage(file);
}
+
+ @Override
+ public void setLockScreenImage(Resources res, int id) {
+ mService.setLockScreenImage(res, id);
+ }
@Override
public void setLockScreenTitle(String title) {

0 comments on commit a470a2b

Please sign in to comment.