|
|
|
@ -113,10 +113,33 @@ namespace QuickPlay
|
|
|
|
|
{
|
|
|
|
|
TextView playerName = FindViewById<TextView>(Resource.Id.playerNameText);
|
|
|
|
|
playerName.Text = currentPlayer.PlayerName;
|
|
|
|
|
var bar = FindViewById(Resource.Id.currentSongBar);
|
|
|
|
|
switch (currentPlayer.Status)
|
|
|
|
|
{
|
|
|
|
|
case IPlayer.PlayerStatus.Disconnected:
|
|
|
|
|
Toolbar tb = FindViewById<Toolbar>(Resource.Id.toolbar);
|
|
|
|
|
tb.SetBackgroundColor(Android.Graphics.Color.Red);
|
|
|
|
|
bar.Visibility = ViewStates.Invisible;
|
|
|
|
|
break;
|
|
|
|
|
case IPlayer.PlayerStatus.Playing:
|
|
|
|
|
ResetToolbarColor();
|
|
|
|
|
// Show progress bar
|
|
|
|
|
bar.Visibility = ViewStates.Visible;
|
|
|
|
|
break;
|
|
|
|
|
case IPlayer.PlayerStatus.Stopped:
|
|
|
|
|
ResetToolbarColor();
|
|
|
|
|
bar.Visibility = ViewStates.Invisible;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
private void ResetToolbarColor()
|
|
|
|
|
{
|
|
|
|
|
Toolbar tb = FindViewById<Toolbar>(Resource.Id.toolbar);
|
|
|
|
|
// This code is seriously lovely. FML.
|
|
|
|
|
tb.SetBackgroundColor(currentPlayer.IsReady ? new Android.Graphics.Color(Android.Support.V4.Content.ContextCompat.GetColor(this, Resource.Color.colorPrimary)) : Android.Graphics.Color.Red);
|
|
|
|
|
// throw new NotImplementedException("Activity should update.");
|
|
|
|
|
tb.SetBackgroundColor(
|
|
|
|
|
new Android.Graphics.Color(
|
|
|
|
|
Android.Support.V4.Content.ContextCompat.GetColor(this, Resource.Color.colorPrimary)
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|