protected void SetContactsScreenItems() { if (offset < 0) { offset = 0; } var contacts = GetContacts((uint)offset, (uint)contactsPerPage); if (contacts.Count == 0 && offset > 0) { offset = 0; SetContactsScreenItems(); return; } contactsScreen.IsUpdateSuspended = true; var i = 2; if (contacts.Count == 0) { contactsScreen.AddItem(new MenuItem(mi => Localization.Current.NoContacts), i++); } else { foreach (var c in contacts) { var contact = (PhoneContact)c; contactsScreen.AddItem(new MenuItem(contact.Name, it => CallPhone(contact.Phones)), i++); // TODO show phones } // TODO clear empty items (if any) } contactsScreen.IsUpdateSuspended = false; contactsScreen.Refresh(); }
void UpdateNowPlayingScreen(MenuScreen nowPlayingScreen, TrackInfo nowPlaying) { nowPlayingScreen.IsUpdateSuspended = true; nowPlayingScreen.Status = nowPlaying.GetTrackPlaylistPosition(); nowPlayingScreen.ClearItems(); if (NowPlayingTagsSeparatedRows) { if (!StringHelpers.IsNullOrEmpty(nowPlaying.Title)) { nowPlayingScreen.AddItem(new MenuItem(i => nowPlaying.Title)); } if (!StringHelpers.IsNullOrEmpty(nowPlaying.Artist)) { nowPlayingScreen.AddItem(new MenuItem(i => CharIcons.BordmonitorBull + " " + Localization.Current.Artist + ":")); nowPlayingScreen.AddItem(new MenuItem(i => nowPlaying.Artist)); } if (!StringHelpers.IsNullOrEmpty(nowPlaying.Album)) { nowPlayingScreen.AddItem(new MenuItem(i => CharIcons.BordmonitorBull + " " + Localization.Current.Album + ":")); nowPlayingScreen.AddItem(new MenuItem(i => nowPlaying.Album)); } if (!StringHelpers.IsNullOrEmpty(nowPlaying.Genre)) { nowPlayingScreen.AddItem(new MenuItem(i => CharIcons.BordmonitorBull + " " + Localization.Current.Genre + ":")); nowPlayingScreen.AddItem(new MenuItem(i => nowPlaying.Genre)); } } else { if (!StringHelpers.IsNullOrEmpty(nowPlaying.Title)) { nowPlayingScreen.AddItem(new MenuItem(i => nowPlaying.GetTitleWithLabel())); } if (!StringHelpers.IsNullOrEmpty(nowPlaying.Artist)) { nowPlayingScreen.AddItem(new MenuItem(i => nowPlaying.GetArtistWithLabel())); } if (!StringHelpers.IsNullOrEmpty(nowPlaying.Album)) { nowPlayingScreen.AddItem(new MenuItem(i => nowPlaying.GetAlbumWithLabel())); } if (!StringHelpers.IsNullOrEmpty(nowPlaying.Genre)) { nowPlayingScreen.AddItem(new MenuItem(i => nowPlaying.GetGenreWithLabel())); } } nowPlayingScreen.AddBackButton(); nowPlayingScreen.IsUpdateSuspended = false; nowPlayingScreen.Refresh(); }