forked from len0rd/rockbox
Move android notification display format logic to java code (no functional change, this is used by FS #11902).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29132 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
a448d8bac7
commit
ef980355c8
2 changed files with 19 additions and 27 deletions
|
@ -5,6 +5,7 @@ import java.lang.reflect.Method;
|
|||
|
||||
import org.rockbox.R;
|
||||
import org.rockbox.RockboxActivity;
|
||||
import org.rockbox.RockboxWidgetProvider;
|
||||
|
||||
import android.app.Notification;
|
||||
import android.app.NotificationManager;
|
||||
|
@ -82,12 +83,15 @@ public class RunForegroundManager
|
|||
api.stopForeground();
|
||||
}
|
||||
|
||||
public void updateNotification(String title, String content, String ticker)
|
||||
public void updateNotification(String title, String artist, String album)
|
||||
{
|
||||
RemoteViews views = mNotification.contentView;
|
||||
views.setTextViewText(R.id.title, title);
|
||||
views.setTextViewText(R.id.content, content);
|
||||
mNotification.tickerText = ticker;
|
||||
views.setTextViewText(R.id.content, artist+"\n"+album);
|
||||
if (artist.equals(""))
|
||||
mNotification.tickerText = title;
|
||||
else
|
||||
mNotification.tickerText = title+" - "+artist;
|
||||
mNM.notify(R.string.notification, mNotification);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue