From 5dca6365c071f1137725dea8b1e7dde58873bd10 Mon Sep 17 00:00:00 2001
From: Tristan Roux
Date: Thu, 28 Feb 2019 19:27:41 +0100
Subject: [PATCH] Adding dark background on the buttons of the queue and
changing the padding.
---
Opus/Resources/Portable Class/MusicPlayer.cs | 2 ++
Opus/Resources/Portable Class/QueueAdapter.cs | 7 +++----
Opus/Resources/Portable Class/RecyclerHolder.cs | 6 ++++--
Opus/Resources/layout/QueueCurrent.xml | 12 ++++++------
Opus/Resources/layout/SongList.xml | 9 +++------
5 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/Opus/Resources/Portable Class/MusicPlayer.cs b/Opus/Resources/Portable Class/MusicPlayer.cs
index a3d5915..9293e2e 100644
--- a/Opus/Resources/Portable Class/MusicPlayer.cs
+++ b/Opus/Resources/Portable Class/MusicPlayer.cs
@@ -252,6 +252,8 @@ namespace Opus.Resources.Portable_Class
queue?.Clear();
currentID = -1;
+ Queue.instance?.Refresh();
+ Home.instance?.RefreshQueue();
Song song = null;
if (title == null)
diff --git a/Opus/Resources/Portable Class/QueueAdapter.cs b/Opus/Resources/Portable Class/QueueAdapter.cs
index feda65c..e6445d2 100644
--- a/Opus/Resources/Portable Class/QueueAdapter.cs
+++ b/Opus/Resources/Portable Class/QueueAdapter.cs
@@ -123,6 +123,9 @@ namespace Opus.Resources.Portable_Class
holder.youtubeIcon.SetColorFilter(Color.White);
holder.reorder.Visibility = ViewStates.Visible;
holder.more.Visibility = ViewStates.Gone;
+ holder.RightButtons.SetBackgroundResource(Resource.Drawable.darkLinear);
+ ((RelativeLayout.LayoutParams)holder.RightButtons.LayoutParameters).RightMargin = MainActivity.instance.DpToPx(5);
+ holder.TextLayout.SetPadding(5, 0, 5, 0);
if (position == MusicPlayer.CurrentID())
{
holder.status.Visibility = ViewStates.Visible;
@@ -375,8 +378,6 @@ namespace Opus.Resources.Portable_Class
fromPosition--;
toPosition--;
- Console.WriteLine("&From: " + fromPosition + " To: " + toPosition + " CurrentID:" + MusicPlayer.CurrentID());
-
if (MusicPlayer.CurrentID() > fromPosition && MusicPlayer.CurrentID() <= toPosition)
MusicPlayer.currentID--;
@@ -386,8 +387,6 @@ namespace Opus.Resources.Portable_Class
else if (MusicPlayer.CurrentID() == fromPosition)
MusicPlayer.currentID = toPosition;
- Console.WriteLine("&Updated! From: " + fromPosition + " To: " + toPosition + " CurrentID:" + MusicPlayer.CurrentID());
-
if (MusicPlayer.UseCastPlayer)
{
int nextItemID = MusicPlayer.RemotePlayer.MediaQueue.ItemCount > toPosition ? MusicPlayer.RemotePlayer.MediaQueue.ItemIdAtIndex(toPosition + 1) : 0; //0 = InvalidItemID = end of the queue
diff --git a/Opus/Resources/Portable Class/RecyclerHolder.cs b/Opus/Resources/Portable Class/RecyclerHolder.cs
index ffbaf95..23fe906 100644
--- a/Opus/Resources/Portable Class/RecyclerHolder.cs
+++ b/Opus/Resources/Portable Class/RecyclerHolder.cs
@@ -16,8 +16,9 @@ namespace Opus.Resources.Portable_Class
public ImageView youtubeIcon;
public ImageView more;
public TextView status;
- public CheckBox checkBox;
public Button action;
+ public View RightButtons;
+ public View TextLayout;
public RecyclerHolder(View itemView, Action listener, Action longListener) : base(itemView)
{
@@ -28,8 +29,9 @@ namespace Opus.Resources.Portable_Class
AlbumArt = itemView.FindViewById(Resource.Id.albumArt);
youtubeIcon = itemView.FindViewById(Resource.Id.youtubeIcon);
more = itemView.FindViewById(Resource.Id.moreButton);
+ RightButtons = itemView.FindViewById(Resource.Id.rightButtons);
+ TextLayout = itemView.FindViewById(Resource.Id.textLayout);
status = itemView.FindViewById(Resource.Id.status);
- checkBox = itemView.FindViewById(Resource.Id.checkBox);
action = itemView.FindViewById