mirror of
https://github.com/zoriya/Opus.git
synced 2026-06-09 08:44:02 +00:00
Reworking queue
This commit is contained in:
@@ -330,16 +330,6 @@ namespace MusicApp
|
||||
// Home.instance.LoadMore();
|
||||
//}
|
||||
}
|
||||
if(Queue.instance != null)
|
||||
{
|
||||
if (!Queue.instance.adapter.RefreshDisabled())
|
||||
contentRefresh.SetEnabled(((LinearLayoutManager)Queue.instance.ListView.GetLayoutManager()).FindFirstCompletelyVisibleItemPosition() == 0);
|
||||
|
||||
if (((LinearLayoutManager)Queue.instance.ListView.GetLayoutManager()).FindLastCompletelyVisibleItemPosition() == Queue.instance.adapter.songList.Count)
|
||||
{
|
||||
Queue.instance.LoadMore();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private async void ActionPlayer()
|
||||
@@ -1191,16 +1181,6 @@ namespace MusicApp
|
||||
StartService(intent);
|
||||
HideTabs();
|
||||
HideSearch();
|
||||
|
||||
if (Queue.instance != null)
|
||||
{
|
||||
ViewGroup rootView = FindViewById<ViewGroup>(Android.Resource.Id.Content);
|
||||
rootView.RemoveView(Queue.instance.recyclerFragment);
|
||||
|
||||
if (Queue.instance.isEmpty)
|
||||
rootView.RemoveView(Queue.instance.emptyView);
|
||||
}
|
||||
|
||||
SaveInstance();
|
||||
SupportFragmentManager.BeginTransaction().AddToBackStack(null).Replace(Resource.Id.contentView, Player.NewInstance()).Commit();
|
||||
}
|
||||
|
||||
@@ -574,6 +574,21 @@
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\layout\SeekbarPreference.xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\layout\ListPopupLayout.xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\menu\QueueItems.xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable\Loop.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable\Shuffle.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AndroidResource Include="Resources\drawable\Close.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace MusicApp.Resources.Portable_Class
|
||||
private bool hasPermission = false;
|
||||
private const int RequestCode = 8539;
|
||||
private const int PickerRequestCode = 9852;
|
||||
private string[] actions = new string[] { "Pick an album art from storage", "Download album art on youtube" };
|
||||
private readonly string[] actions = new string[] { "Pick an album art from storage", "Download album art on youtube" };
|
||||
|
||||
protected override void OnCreate(Bundle savedInstanceState)
|
||||
{
|
||||
|
||||
@@ -43,6 +43,7 @@ namespace MusicApp.Resources.Portable_Class
|
||||
public static string title;
|
||||
private static bool parsing = false;
|
||||
public static int currentID = -1;
|
||||
public static bool repeat = false;
|
||||
|
||||
private Notification notification;
|
||||
private const int notificationID = 1000;
|
||||
@@ -93,6 +94,10 @@ namespace MusicApp.Resources.Portable_Class
|
||||
RandomPlay(files, clearQueue);
|
||||
break;
|
||||
|
||||
case "RandomizeQueue":
|
||||
RandomizeQueue();
|
||||
break;
|
||||
|
||||
case "PlayNext":
|
||||
string title = intent.GetStringExtra("title");
|
||||
if (title != null)
|
||||
@@ -275,10 +280,10 @@ namespace MusicApp.Resources.Portable_Class
|
||||
if (Build.VERSION.SdkInt >= BuildVersionCodes.O)
|
||||
{
|
||||
AudioFocusRequestClass focusRequest = new AudioFocusRequestClass.Builder(AudioFocus.Gain)
|
||||
.SetAudioAttributes(attributes)
|
||||
.SetAcceptsDelayedFocusGain(true)
|
||||
.SetOnAudioFocusChangeListener(this)
|
||||
.Build();
|
||||
.SetAudioAttributes(attributes)
|
||||
.SetAcceptsDelayedFocusGain(true)
|
||||
.SetOnAudioFocusChangeListener(this)
|
||||
.Build();
|
||||
AudioFocusRequest audioFocus = audioManager.RequestAudioFocus(focusRequest);
|
||||
|
||||
if (audioFocus != AudioFocusRequest.Granted)
|
||||
@@ -349,6 +354,27 @@ namespace MusicApp.Resources.Portable_Class
|
||||
}
|
||||
}
|
||||
|
||||
private void RandomizeQueue()
|
||||
{
|
||||
Random r = new Random();
|
||||
Song current = queue[CurrentID()];
|
||||
List<Song> newQueue = queue.OrderBy(x => r.Next()).ToList();
|
||||
queue.Clear();
|
||||
|
||||
newQueue.Remove(current);
|
||||
current.queueSlot = 0;
|
||||
queue.Add(current);
|
||||
|
||||
foreach(Song song in newQueue)
|
||||
{
|
||||
song.queueSlot = queue.Count;
|
||||
queue.Add(song);
|
||||
}
|
||||
|
||||
Player.instance?.UpdateNext();
|
||||
Queue.instance?.Refresh();
|
||||
}
|
||||
|
||||
public void AddToQueue(string filePath, string title = null, string artist = null, string youtubeID = null, string thumbnailURI = null)
|
||||
{
|
||||
Song song = null;
|
||||
@@ -414,8 +440,17 @@ namespace MusicApp.Resources.Portable_Class
|
||||
{
|
||||
if (CurrentID() + 1 > queue.Count - 1 || CurrentID() == -1)
|
||||
{
|
||||
Pause();
|
||||
return;
|
||||
if (repeat)
|
||||
{
|
||||
Song first = queue[0];
|
||||
SwitchQueue(first);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
Pause();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Song next = queue[CurrentID() + 1];
|
||||
@@ -442,8 +477,8 @@ namespace MusicApp.Resources.Portable_Class
|
||||
|
||||
Play(song, false);
|
||||
|
||||
if (Player.instance != null)
|
||||
Player.instance.RefreshPlayer();
|
||||
Player.instance?.RefreshPlayer();
|
||||
Queue.instance?.RefreshCurrent();
|
||||
|
||||
CoordinatorLayout smallPlayer = MainActivity.instance.FindViewById<CoordinatorLayout>(Resource.Id.smallPlayer);
|
||||
smallPlayer.FindViewById<TextView>(Resource.Id.spTitle).Text = song.GetName();
|
||||
@@ -631,10 +666,6 @@ namespace MusicApp.Resources.Portable_Class
|
||||
tmpDefaultIntent.SetAction("Player");
|
||||
PendingIntent defaultIntent = PendingIntent.GetActivity(Application.Context, 0, tmpDefaultIntent, PendingIntentFlags.UpdateCurrent);
|
||||
|
||||
//Intent tmpCancelIntent = new Intent(Application.Context, typeof(MainActivity));
|
||||
//tmpCancelIntent.SetAction("Stop");
|
||||
//PendingIntent cancelIntent = PendingIntent.GetActivity(Application.Context, 0, tmpCancelIntent, PendingIntentFlags.UpdateCurrent);
|
||||
|
||||
notification = new NotificationCompat.Builder(Application.Context, "MusicApp.Channel")
|
||||
.SetVisibility(NotificationCompat.VisibilityPublic)
|
||||
.SetSmallIcon(Resource.Drawable.MusicIcon)
|
||||
@@ -646,14 +677,12 @@ namespace MusicApp.Resources.Portable_Class
|
||||
.SetStyle(new MediaStyle()
|
||||
.SetShowActionsInCompactView(1)
|
||||
.SetShowCancelButton(true)
|
||||
//.SetCancelButtonIntent(cancelIntent)
|
||||
.SetMediaSession(mediaSession.SessionToken))
|
||||
.SetColor(ContextCompat.GetColor(Application.Context, Resource.Color.notification_icon_bg_color))
|
||||
.SetContentTitle(title)
|
||||
.SetContentText(artist)
|
||||
.SetLargeIcon(icon)
|
||||
.SetContentIntent(defaultIntent)
|
||||
//.SetDeleteIntent(cancelIntent)
|
||||
.Build();
|
||||
ContextCompat.StartForegroundService(Application.Context, new Intent(Application.Context, typeof(MusicPlayer)));
|
||||
StartForeground(notificationID, notification);
|
||||
|
||||
@@ -164,6 +164,25 @@ namespace MusicApp.Resources.Portable_Class
|
||||
Picasso.With(Android.App.Application.Context).Load(next.GetAlbum()).Placeholder(Resource.Drawable.MusicIcon).Resize(400, 400).CenterCrop().Into(nextArt);
|
||||
}
|
||||
}
|
||||
else if (MusicPlayer.repeat)
|
||||
{
|
||||
Song next = MusicPlayer.queue[0];
|
||||
NextTitle.Text = "Next music:";
|
||||
NextAlbum.Text = next.GetName();
|
||||
ImageView nextArt = playerView.FindViewById<ImageView>(Resource.Id.nextArt);
|
||||
|
||||
if (next.GetAlbum() == null)
|
||||
{
|
||||
var songCover = Android.Net.Uri.Parse("content://media/external/audio/albumart");
|
||||
var nextAlbumArtUri = ContentUris.WithAppendedId(songCover, next.GetAlbumArt());
|
||||
|
||||
Picasso.With(Android.App.Application.Context).Load(nextAlbumArtUri).Placeholder(Resource.Drawable.MusicIcon).Resize(400, 400).CenterCrop().Into(nextArt);
|
||||
}
|
||||
else
|
||||
{
|
||||
Picasso.With(Android.App.Application.Context).Load(next.GetAlbum()).Placeholder(Resource.Drawable.MusicIcon).Resize(400, 400).CenterCrop().Into(nextArt);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
NextTitle.Text = "Next music:";
|
||||
@@ -186,12 +205,6 @@ namespace MusicApp.Resources.Portable_Class
|
||||
MusicPlayer.SetSeekBar(bar);
|
||||
}
|
||||
|
||||
private void Download_Click(object sender, EventArgs e)
|
||||
{
|
||||
Song song = MusicPlayer.queue[MusicPlayer.CurrentID()];
|
||||
YoutubeEngine.Download(song.GetName(), song.youtubeID);
|
||||
}
|
||||
|
||||
public async void RefreshPlayer()
|
||||
{
|
||||
while (MusicPlayer.CurrentID() == -1)
|
||||
@@ -256,6 +269,25 @@ namespace MusicApp.Resources.Portable_Class
|
||||
Picasso.With(Android.App.Application.Context).Load(next.GetAlbum()).Placeholder(Resource.Drawable.MusicIcon).Resize(400, 400).CenterCrop().Into(nextArt);
|
||||
}
|
||||
}
|
||||
else if (MusicPlayer.repeat)
|
||||
{
|
||||
Song next = MusicPlayer.queue[0];
|
||||
playerView.FindViewById<TextView>(Resource.Id.nextTitle).Text = "Next music:";
|
||||
playerView.FindViewById<TextView>(Resource.Id.nextArtist).Text = next.GetName();
|
||||
ImageView nextArt = playerView.FindViewById<ImageView>(Resource.Id.nextArt);
|
||||
|
||||
if (next.GetAlbum() == null)
|
||||
{
|
||||
var songCover = Android.Net.Uri.Parse("content://media/external/audio/albumart");
|
||||
var nextAlbumArtUri = ContentUris.WithAppendedId(songCover, next.GetAlbumArt());
|
||||
|
||||
Picasso.With(Android.App.Application.Context).Load(nextAlbumArtUri).Placeholder(Resource.Drawable.MusicIcon).Resize(400, 400).CenterCrop().Into(nextArt);
|
||||
}
|
||||
else
|
||||
{
|
||||
Picasso.With(Android.App.Application.Context).Load(next.GetAlbum()).Placeholder(Resource.Drawable.MusicIcon).Resize(400, 400).CenterCrop().Into(nextArt);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
playerView.FindViewById<TextView>(Resource.Id.nextTitle).Text = "Next music:";
|
||||
@@ -295,6 +327,25 @@ namespace MusicApp.Resources.Portable_Class
|
||||
Picasso.With(Android.App.Application.Context).Load(next.GetAlbum()).Placeholder(Resource.Drawable.MusicIcon).Resize(400, 400).CenterCrop().Into(nextArt);
|
||||
}
|
||||
}
|
||||
else if (MusicPlayer.repeat)
|
||||
{
|
||||
Song next = MusicPlayer.queue[0];
|
||||
playerView.FindViewById<TextView>(Resource.Id.nextTitle).Text = "Next music:";
|
||||
playerView.FindViewById<TextView>(Resource.Id.nextArtist).Text = next.GetName();
|
||||
ImageView nextArt = playerView.FindViewById<ImageView>(Resource.Id.nextArt);
|
||||
|
||||
if (next.GetAlbum() == null)
|
||||
{
|
||||
var songCover = Android.Net.Uri.Parse("content://media/external/audio/albumart");
|
||||
var nextAlbumArtUri = ContentUris.WithAppendedId(songCover, next.GetAlbumArt());
|
||||
|
||||
Picasso.With(Android.App.Application.Context).Load(nextAlbumArtUri).Placeholder(Resource.Drawable.MusicIcon).Resize(400, 400).CenterCrop().Into(nextArt);
|
||||
}
|
||||
else
|
||||
{
|
||||
Picasso.With(Android.App.Application.Context).Load(next.GetAlbum()).Placeholder(Resource.Drawable.MusicIcon).Resize(400, 400).CenterCrop().Into(nextArt);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
playerView.FindViewById<TextView>(Resource.Id.nextTitle).Text = "Next music:";
|
||||
@@ -305,6 +356,12 @@ namespace MusicApp.Resources.Portable_Class
|
||||
}
|
||||
}
|
||||
|
||||
private void Download_Click(object sender, EventArgs e)
|
||||
{
|
||||
Song song = MusicPlayer.queue[MusicPlayer.CurrentID()];
|
||||
YoutubeEngine.Download(song.GetName(), song.youtubeID);
|
||||
}
|
||||
|
||||
public void Stoped()
|
||||
{
|
||||
MainActivity.instance.FindViewById<BottomNavigationView>(Resource.Id.bottomView).SelectedItemId = Resource.Id.musicLayout;
|
||||
@@ -366,8 +423,11 @@ namespace MusicApp.Resources.Portable_Class
|
||||
|
||||
private void ShowQueue_Click(object sender, EventArgs e)
|
||||
{
|
||||
MainActivity.instance.SupportFragmentManager.PopBackStack();
|
||||
MainActivity.instance.Transition(Resource.Id.contentView, Queue.NewInstance(), false);
|
||||
//MainActivity.instance.SupportFragmentManager.PopBackStack();
|
||||
//MainActivity.instance.Transition(Resource.Id.contentView, Queue.NewInstance(), false);
|
||||
|
||||
Intent intent = new Intent(Activity, typeof(Queue));
|
||||
StartActivity(intent);
|
||||
}
|
||||
|
||||
private void Last_Click(object sender, EventArgs e)
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
using Android.OS;
|
||||
using Android.App;
|
||||
using Android.Content;
|
||||
using Android.Content.PM;
|
||||
using Android.OS;
|
||||
using Android.Support.Design.Widget;
|
||||
using Android.Support.V4.App;
|
||||
using Android.Support.V7.App;
|
||||
using Android.Support.V7.Widget;
|
||||
using Android.Support.V7.Widget.Helper;
|
||||
using Android.Views;
|
||||
@@ -12,55 +15,33 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace MusicApp.Resources.Portable_Class
|
||||
{
|
||||
public class Queue : Fragment
|
||||
[Activity(Label = "Queue", Theme = "@style/Theme", ScreenOrientation = ScreenOrientation.Portrait)]
|
||||
public class Queue : AppCompatActivity
|
||||
{
|
||||
public static Queue instance;
|
||||
public RecyclerView ListView;
|
||||
public RecyclerAdapter adapter;
|
||||
public bool isEmpty = false;
|
||||
public View emptyView;
|
||||
public View recyclerFragment;
|
||||
public ItemTouchHelper itemTouchHelper;
|
||||
public View view;
|
||||
|
||||
private string[] actions = new string[] { "Remove from queue", "Edit Metadata" };
|
||||
private readonly string[] actions = new string[] { "Remove from queue", "Edit Metadata" };
|
||||
|
||||
public override void OnActivityCreated(Bundle savedInstanceState)
|
||||
|
||||
protected override void OnCreate(Bundle savedInstanceState)
|
||||
{
|
||||
base.OnActivityCreated(savedInstanceState);
|
||||
MainActivity.instance.contentRefresh.Refresh += OnRefresh;
|
||||
emptyView = LayoutInflater.Inflate(Resource.Layout.NoQueue, null);
|
||||
MainActivity.instance.OnPaddingChanged += OnPaddingChanged;
|
||||
}
|
||||
base.OnCreate(savedInstanceState);
|
||||
|
||||
private void OnPaddingChanged(object sender, PaddingChange e)
|
||||
{
|
||||
if (MainActivity.paddingBot > e.oldPadding)
|
||||
adapter.listPadding = MainActivity.paddingBot - MainActivity.defaultPaddingBot;
|
||||
else
|
||||
adapter.listPadding = (int)(8 * MainActivity.instance.Resources.DisplayMetrics.Density + 0.5f);
|
||||
}
|
||||
if (MainActivity.Theme == 1)
|
||||
SetTheme(Resource.Style.DarkTheme);
|
||||
|
||||
public override void OnDestroy()
|
||||
{
|
||||
MainActivity.instance.contentRefresh.Refresh -= OnRefresh;
|
||||
MainActivity.instance.OnPaddingChanged -= OnPaddingChanged;
|
||||
ViewGroup rootView = Activity.FindViewById<ViewGroup>(Android.Resource.Id.Content);
|
||||
rootView.RemoveView(recyclerFragment);
|
||||
SetContentView(Resource.Layout.ListPopupLayout);
|
||||
instance = this;
|
||||
|
||||
if (isEmpty)
|
||||
rootView.RemoveView(emptyView);
|
||||
SetSupportActionBar(FindViewById<Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar));
|
||||
SupportActionBar.SetHomeAsUpIndicator(Resource.Drawable.Close);
|
||||
SupportActionBar.SetDisplayHomeAsUpEnabled(true);
|
||||
|
||||
base.OnDestroy();
|
||||
instance = null;
|
||||
}
|
||||
|
||||
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
|
||||
{
|
||||
view = inflater.Inflate(Resource.Layout.RecyclerFragment, container, false);
|
||||
ListView = view.FindViewById<RecyclerView>(Resource.Id.recycler);
|
||||
view.SetPadding(0, 0, 0, MainActivity.defaultPaddingBot);
|
||||
ListView.SetLayoutManager(new LinearLayoutManager(Android.App.Application.Context));
|
||||
ListView = FindViewById<RecyclerView>(Resource.Id.recycler);
|
||||
ListView.SetLayoutManager(new LinearLayoutManager(Application.Context));
|
||||
|
||||
if (MusicPlayer.queue != null)
|
||||
adapter = new RecyclerAdapter(MusicPlayer.queue);
|
||||
@@ -72,55 +53,70 @@ namespace MusicApp.Resources.Portable_Class
|
||||
adapter.ItemClick += ListView_ItemClick;
|
||||
adapter.ItemLongCLick += ListView_ItemLongCLick;
|
||||
ListView.SetItemAnimator(new DefaultItemAnimator());
|
||||
ListView.ScrollChange += MainActivity.instance.Scroll;
|
||||
ListView.ScrollChange += Scroll; ;
|
||||
|
||||
ItemTouchHelper.Callback callback = new ItemTouchCallback(adapter);
|
||||
itemTouchHelper = new ItemTouchHelper(callback);
|
||||
itemTouchHelper.AttachToRecyclerView(ListView);
|
||||
|
||||
|
||||
if (adapter == null || adapter.ItemCount == 0)
|
||||
{
|
||||
if (isEmpty)
|
||||
return view;
|
||||
|
||||
isEmpty = true;
|
||||
return LayoutInflater.Inflate(Resource.Layout.NoQueue, container, false);
|
||||
}
|
||||
return view;
|
||||
ListView.ScrollToPosition(MusicPlayer.CurrentID());
|
||||
}
|
||||
|
||||
public async void AddEmptyView()
|
||||
private void Scroll(object sender, View.ScrollChangeEventArgs e)
|
||||
{
|
||||
await Task.Delay(500);
|
||||
Activity.AddContentView(emptyView, View.LayoutParameters);
|
||||
if (((LinearLayoutManager)ListView.GetLayoutManager()).FindLastCompletelyVisibleItemPosition() == adapter.songList.Count)
|
||||
LoadMore();
|
||||
}
|
||||
|
||||
public static Fragment NewInstance()
|
||||
protected override void OnDestroy()
|
||||
{
|
||||
instance = new Queue { Arguments = new Bundle() };
|
||||
return instance;
|
||||
}
|
||||
|
||||
private void OnRefresh(object sender, System.EventArgs e)
|
||||
{
|
||||
Refresh();
|
||||
MainActivity.instance.contentRefresh.Refreshing = false;
|
||||
base.OnDestroy();
|
||||
instance = null;
|
||||
}
|
||||
|
||||
public void Refresh()
|
||||
{
|
||||
adapter.UpdateList(MusicPlayer.queue);
|
||||
}
|
||||
|
||||
if (adapter == null || adapter.ItemCount == 0)
|
||||
public void RefreshCurrent()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override bool OnCreateOptionsMenu(IMenu menu)
|
||||
{
|
||||
MenuInflater.Inflate(Resource.Menu.QueueItems, menu);
|
||||
return base.OnCreateOptionsMenu(menu);
|
||||
}
|
||||
|
||||
public override bool OnOptionsItemSelected(IMenuItem item)
|
||||
{
|
||||
if (item.ItemId == Android.Resource.Id.Home)
|
||||
{
|
||||
if (isEmpty)
|
||||
return;
|
||||
isEmpty = true;
|
||||
if(emptyView == null)
|
||||
emptyView = LayoutInflater.Inflate(Resource.Layout.NoQueue, null);
|
||||
Activity.AddContentView(emptyView, View.LayoutParameters);
|
||||
Finish();
|
||||
}
|
||||
else if(item.ItemId == Resource.Id.shuffle)
|
||||
{
|
||||
ShuffleQueue();
|
||||
}
|
||||
else if(item.ItemId == Resource.Id.repeat)
|
||||
{
|
||||
Repeat();
|
||||
}
|
||||
return base.OnOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
void ShuffleQueue()
|
||||
{
|
||||
Intent intent = new Intent(this, typeof(MusicPlayer));
|
||||
intent.SetAction("RandomizeQueue");
|
||||
StartService(intent);
|
||||
}
|
||||
|
||||
void Repeat()
|
||||
{
|
||||
MusicPlayer.repeat = true;
|
||||
}
|
||||
|
||||
public void LoadMore()
|
||||
@@ -151,7 +147,7 @@ namespace MusicApp.Resources.Portable_Class
|
||||
|
||||
public void More(Song item)
|
||||
{
|
||||
Android.Support.V7.App.AlertDialog.Builder builder = new Android.Support.V7.App.AlertDialog.Builder(Activity, MainActivity.dialogTheme);
|
||||
Android.Support.V7.App.AlertDialog.Builder builder = new Android.Support.V7.App.AlertDialog.Builder(this, MainActivity.dialogTheme);
|
||||
builder.SetTitle("Pick an action");
|
||||
builder.SetItems(actions, (senderAlert, args) =>
|
||||
{
|
||||
@@ -188,7 +184,7 @@ namespace MusicApp.Resources.Portable_Class
|
||||
MusicPlayer.queue.Remove(item);
|
||||
}
|
||||
|
||||
public override void OnResume()
|
||||
protected override void OnResume()
|
||||
{
|
||||
base.OnResume();
|
||||
if (MainActivity.parcelableSender == "Queue" && !MainActivity.instance.ResumeKiller)
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace MusicApp.Resources.Portable_Class
|
||||
public class RecyclerAdapter : RecyclerView.Adapter, IItemTouchAdapter
|
||||
{
|
||||
public List<Song> songList;
|
||||
private bool refreshDisabled = false;
|
||||
private bool refreshDisabled = true;
|
||||
public event EventHandler<int> ItemClick;
|
||||
public event EventHandler<int> ItemLongCLick;
|
||||
public int listPadding;
|
||||
@@ -118,6 +118,7 @@ namespace MusicApp.Resources.Portable_Class
|
||||
|
||||
if (MainActivity.Theme == 1)
|
||||
{
|
||||
|
||||
holder.more.SetColorFilter(Color.White);
|
||||
holder.reorder.SetColorFilter(Color.White);
|
||||
holder.Title.SetTextColor(Color.White);
|
||||
@@ -199,7 +200,6 @@ namespace MusicApp.Resources.Portable_Class
|
||||
|
||||
public void ItemDismissed(int position)
|
||||
{
|
||||
Console.WriteLine("&Swiped");
|
||||
Queue.RemoveFromQueue(songList[position]);
|
||||
NotifyItemRemoved(position);
|
||||
}
|
||||
|
||||
Generated
+473
-452
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
After Width: | Height: | Size: 225 B |
Binary file not shown.
|
After Width: | Height: | Size: 224 B |
Binary file not shown.
|
After Width: | Height: | Size: 287 B |
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent">
|
||||
<android.support.design.widget.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
|
||||
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
<ProgressBar
|
||||
android:layout_height="4dp"
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/ytProgress"
|
||||
android:indeterminate="true"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:visibility="gone" />
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/recycler"
|
||||
android:scrollbars="vertical"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent" />
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<menu
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<item
|
||||
android:id="@+id/shuffle"
|
||||
android:icon="@drawable/Shuffle"
|
||||
android:title="Shuffle Queue"
|
||||
app:showAsAction="always" />
|
||||
<item
|
||||
android:id="@+id/repeat"
|
||||
android:icon="@drawable/Loop"
|
||||
android:title="Repeat"
|
||||
app:showAsAction="always" />
|
||||
</menu>
|
||||
Reference in New Issue
Block a user