Skip to content

Commit

Permalink
iOS: Added timestamp to ResumePlaybackTableViewCell.
Browse files Browse the repository at this point in the history
Related to issue #405.
  • Loading branch information
ycastonguay committed Oct 23, 2013
1 parent 3510ae1 commit bfd01a3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
Expand Up @@ -77,6 +77,7 @@ public UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)

cell.TextLabel.Text = device.DeviceName;
cell.DetailTextLabel.Text = "On-the-fly Playlist";
cell.LabelLastUpdated.Text = string.Format("Last updated on {0}", device.Timestamp);
cell.LabelArtistName.Text = device.ArtistName;
cell.LabelAlbumTitle.Text = device.AlbumTitle;
cell.LabelSongTitle.Text = device.SongTitle;
Expand Down Expand Up @@ -107,7 +108,7 @@ public void DidUnhighlightRowAtIndexPath(UITableView tableView, NSIndexPath inde
[Export ("tableView:heightForRowAtIndexPath:")]
public float HeightForRow(UITableView tableView, NSIndexPath indexPath)
{
return 116;
return 130;
}

partial void actionResumePlayback(NSObject sender)
Expand Down
15 changes: 12 additions & 3 deletions MPfm/MPfm.iOS/Classes/Controls/MPfmResumePlaybackTableViewCell.cs
Expand Up @@ -34,6 +34,7 @@ namespace MPfm.iOS.Classes.Controls
public class MPfmResumePlaybackTableViewCell : UITableViewCell
{
public bool IsTextAnimationEnabled { get; set; }
public UILabel LabelLastUpdated { get; private set; }
public UILabel LabelArtistName { get; private set; }
public UILabel LabelAlbumTitle { get; private set; }
public UILabel LabelSongTitle { get; private set; }
Expand Down Expand Up @@ -78,19 +79,26 @@ public void Initialize()
TextLabel.TextColor = UIColor.Black;
TextLabel.HighlightedTextColor = UIColor.White;
DetailTextLabel.Layer.AnchorPoint = new PointF(0, 0.5f);
DetailTextLabel.TextColor = UIColor.Gray;
DetailTextLabel.TextColor = UIColor.DarkGray;
DetailTextLabel.BackgroundColor = UIColor.Clear;
DetailTextLabel.HighlightedTextColor = UIColor.White;
DetailTextLabel.Font = UIFont.FromName("HelveticaNeue-Light", 14);
ImageView.Hidden = true;
ImageView.BackgroundColor = UIColor.Clear;

// Make sure the text label is over all other subviews
DetailTextLabel.RemoveFromSuperview();
ImageView.RemoveFromSuperview();
AddSubview(DetailTextLabel);
AddSubview(ImageView);

LabelLastUpdated = new UILabel();
LabelLastUpdated.BackgroundColor = UIColor.Clear;
LabelLastUpdated.Font = UIFont.FromName("HelveticaNeue-Light", 12);
LabelLastUpdated.TextColor = UIColor.Gray;
LabelLastUpdated.LineBreakMode = UILineBreakMode.TailTruncation;
LabelLastUpdated.HighlightedTextColor = UIColor.White;
AddSubview(LabelLastUpdated);

LabelArtistName = new UILabel();
LabelArtistName.BackgroundColor = UIColor.Clear;
LabelArtistName.Font = UIFont.FromName("HelveticaNeue", 13);
Expand Down Expand Up @@ -134,8 +142,9 @@ public override void LayoutSubviews()
LabelArtistName.Frame = new RectangleF(74, 52, 232, 18);
LabelAlbumTitle.Frame = new RectangleF(74, 68, 232, 18);
LabelSongTitle.Frame = new RectangleF(74, 84, 232, 18);
LabelLastUpdated.Frame = new RectangleF(12, 106, 300, 20);
ImageAlbum.Frame = new RectangleF(12, 50, 54, 54);
ImageChevron.Frame = new RectangleF(UIScreen.MainScreen.Bounds.Width - 22, 36, 22, 44);
ImageChevron.Frame = new RectangleF(UIScreen.MainScreen.Bounds.Width - 22, 43, 22, 44);
}

public override void TouchesBegan(NSSet touches, UIEvent evt)
Expand Down

0 comments on commit bfd01a3

Please sign in to comment.