Display artist in controls text
This commit is contained in:
parent
5ef2343272
commit
a3a9a0fc21
@ -72,6 +72,8 @@
|
||||
<string name="playlists">Playlists</string>
|
||||
|
||||
<string name="none">None</string>
|
||||
<string name="unknown">Unknown</string>
|
||||
<string name="title_by_artist">%s by %s</string>
|
||||
|
||||
<!-- Preferences -->
|
||||
<string name="pref_output">Audio Output</string>
|
||||
|
@ -571,10 +571,21 @@ public class SongSelector extends PlaybackActivity implements AdapterView.OnItem
|
||||
private void onSongChange(final Song song)
|
||||
{
|
||||
if (mStatusText != null) {
|
||||
Resources res = getResources();
|
||||
CharSequence text;
|
||||
if (song == null) {
|
||||
text = res.getText(R.string.none);
|
||||
} else {
|
||||
String title = song.title == null ? res.getString(R.string.unknown) : song.title;
|
||||
String artist = song.artist == null ? res.getString(R.string.unknown) : song.artist;
|
||||
text = res.getString(R.string.title_by_artist, title, artist);
|
||||
}
|
||||
|
||||
final CharSequence result = text;
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run()
|
||||
{
|
||||
mStatusText.setText(song == null ? getResources().getText(R.string.none) : song.title);
|
||||
mStatusText.setText(result);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user