diff --git a/MusicApp/MainActivity.cs b/MusicApp/MainActivity.cs index ea947d4..c50c4a8 100644 --- a/MusicApp/MainActivity.cs +++ b/MusicApp/MainActivity.cs @@ -1270,7 +1270,7 @@ namespace MusicApp parseProgress.Visibility = ViewStates.Gone; } - int DpToPx(int dx) + public int DpToPx(int dx) { float scale = Resources.DisplayMetrics.Density; return (int) (dx * scale + 0.5f); diff --git a/MusicApp/MusicApp.csproj b/MusicApp/MusicApp.csproj index 48765c9..4be05e9 100644 --- a/MusicApp/MusicApp.csproj +++ b/MusicApp/MusicApp.csproj @@ -262,6 +262,8 @@ + + @@ -699,6 +701,12 @@ + + + + + + diff --git a/MusicApp/Resources/Portable Class/PlaylistItemTouch.cs b/MusicApp/Resources/Portable Class/PlaylistItemTouch.cs new file mode 100644 index 0000000..4bba02e --- /dev/null +++ b/MusicApp/Resources/Portable Class/PlaylistItemTouch.cs @@ -0,0 +1,91 @@ +using Android.Graphics; +using Android.Graphics.Drawables; +using Android.Support.V7.Widget; +using Android.Support.V7.Widget.Helper; +using Android.Widget; +using Square.Picasso; +using System; +using System.Threading.Tasks; + +namespace MusicApp.Resources.Portable_Class +{ + public class PlaylistItemTouch : ItemTouchHelper.Callback + { + private IItemTouchAdapter adapter; + + private int from = -1; + private int to = -1; + + public override bool IsItemViewSwipeEnabled => true; + public override bool IsLongPressDragEnabled => true; + + private Bitmap drawable; + private Paint paint; + + + public PlaylistItemTouch(IItemTouchAdapter adapter) + { + this.adapter = adapter; + drawable = BitmapFactory.DecodeResource(MainActivity.instance.Resources, Resource.Drawable.MusicIcon); + Console.WriteLine("&Drawable: " + drawable); + paint = new Paint(); + paint.SetColorFilter(new PorterDuffColorFilter(Color.Argb(255, 33, 33, 33), PorterDuff.Mode.SrcIn)); + } + + public override int GetMovementFlags(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) + { + int dragFlag = ItemTouchHelper.Up | ItemTouchHelper.Down; + int swipeFlag = ItemTouchHelper.Left | ItemTouchHelper.Right; + return MakeMovementFlags(dragFlag, swipeFlag); + } + + public override bool OnMove(RecyclerView recyclerView, RecyclerView.ViewHolder source, RecyclerView.ViewHolder target) + { + if (from == -1) + from = source.AdapterPosition; + + to = target.AdapterPosition; + adapter.ItemMoved(source.AdapterPosition, target.AdapterPosition); + return true; + } + + public override void OnSwiped(RecyclerView.ViewHolder viewHolder, int direction) + { + //adapter.ItemDismissed(viewHolder.AdapterPosition); + } + + + public override void OnChildDraw(Canvas c, RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, float dX, float dY, int actionState, bool isCurrentlyActive) + { + if (actionState == ItemTouchHelper.ActionStateSwipe) + { + viewHolder.ItemView.TranslationX = dX; + ColorDrawable background = new ColorDrawable(Color.Red); + background.SetBounds(viewHolder.ItemView.Right + (int)dX, viewHolder.ItemView.Top, viewHolder.ItemView.Right, viewHolder.ItemView.Bottom); + background.Draw(c); + c.DrawBitmap(drawable, viewHolder.ItemView.Left + MainActivity.instance.DpToPx(16), viewHolder.ItemView.Top + (viewHolder.ItemView.Bottom - viewHolder.ItemView.Top - drawable.Height) / 2, paint); + c.DrawBitmap(drawable, viewHolder.ItemView.Right + drawable.Width - 20, (viewHolder.ItemView.Top + viewHolder.ItemView.Bottom) / 2, paint); + MainActivity.instance.contentRefresh.SetEnabled(false); + //adapter.DisableRefresh(true); + } + else + base.OnChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive); + } + + //public override void OnSelectedChanged(RecyclerView.ViewHolder viewHolder, int actionState) + //{ + // if (actionState != ItemTouchHelper.ActionStateIdle) + // { + // if (viewHolder is IItemTouchHolder) + // ((IItemTouchHolder)viewHolder).ItemSelected(); + // } + + // base.OnSelectedChanged(viewHolder, actionState); + //} + + public override void ClearView(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) + { + DefaultUIUtil.ClearView(viewHolder.ItemView); + } + } +} \ No newline at end of file diff --git a/MusicApp/Resources/Portable Class/PlaylistTrackAdapter.cs b/MusicApp/Resources/Portable Class/PlaylistTrackAdapter.cs new file mode 100644 index 0000000..16ca441 --- /dev/null +++ b/MusicApp/Resources/Portable Class/PlaylistTrackAdapter.cs @@ -0,0 +1,168 @@ +using Android.App; +using Android.Content; +using Android.Graphics; +using Android.Support.V7.Widget; +using Android.Views; +using Android.Widget; +using MusicApp.Resources.values; +using Square.Picasso; +using System; +using System.Collections.Generic; + +namespace MusicApp.Resources.Portable_Class +{ + public class PlaylistTrackAdapter : RecyclerView.Adapter, IItemTouchAdapter + { + public List songList; + private bool refreshDisabled = true; + public event EventHandler ItemClick; + public event EventHandler ItemLongClick; + public int listPadding; + + public PlaylistTrackAdapter(List songList) + { + this.songList = songList; + } + + public void AddToList(List songList) + { + int positionStart = this.songList.Count; + this.songList.AddRange(songList); + NotifyItemRangeInserted(positionStart, songList.Count); + } + + public void Remove(Song song) + { + int position = songList.IndexOf(song); + songList.Remove(song); + NotifyItemRemoved(position); + } + + public override int ItemCount => songList.Count + (PlaylistTracks.instance.fullyLoadded ? 0 : 1); + + public override void OnBindViewHolder(RecyclerView.ViewHolder viewHolder, int position) + { + if(position >= songList.Count) + return; + + RecyclerHolder holder = (RecyclerHolder)viewHolder; + + holder.Title.Text = songList[position].Title; + holder.Artist.Text = songList[position].Artist; + + if (songList[position].AlbumArt == -1 || songList[position].IsYt) + { + var songAlbumArtUri = Android.Net.Uri.Parse(songList[position].Album); + Picasso.With(Application.Context).Load(songAlbumArtUri).Placeholder(Resource.Drawable.MusicIcon).Resize(400, 400).CenterCrop().Into(holder.AlbumArt); + } + else + { + var songCover = Android.Net.Uri.Parse("content://media/external/audio/albumart"); + var songAlbumArtUri = ContentUris.WithAppendedId(songCover, songList[position].AlbumArt); + + Picasso.With(Application.Context).Load(songAlbumArtUri).Placeholder(Resource.Drawable.MusicIcon).Resize(400, 400).CenterCrop().Into(holder.AlbumArt); + } + + holder.more.Tag = position; + if (!holder.more.HasOnClickListeners) + { + holder.more.Click += (sender, e) => + { + int tagPosition = (int)((ImageView)sender).Tag; + PlaylistTracks.instance.More(songList[tagPosition], tagPosition); + }; + } + + float scale = MainActivity.instance.Resources.DisplayMetrics.Density; + + if (MainActivity.Theme == 1) + { + holder.more.SetColorFilter(Color.White); + holder.Title.SetTextColor(Color.White); + holder.Artist.SetTextColor(Color.White); + holder.Artist.Alpha = 0.7f; + } + } + + public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) + { + if(viewType == 0) + { + View itemView = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.SongList, parent, false); + return new RecyclerHolder(itemView, OnClick, OnLongClick); + } + else + { + View itemView = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.smallLoading, parent, false); + return new UslessHolder(itemView); + } + } + + public override int GetItemViewType(int position) + { + if (position >= songList.Count) + return 1; + return 0; + } + + void OnClick(int position) + { + ItemClick?.Invoke(this, position); + } + + void OnLongClick(int position) + { + ItemLongClick?.Invoke(this, position); + } + + public void ItemMoved(int fromPosition, int toPosition) + { + //Enable this only if the user is editing the playlist + + //if (fromPosition < toPosition) + //{ + // for (int i = fromPosition; i < toPosition; i++) + // songList = Swap(songList, i, i + 1); + //} + //else + //{ + // for (int i = fromPosition; i > toPosition; i--) + // songList = Swap(songList, i, i - 1); + //} + + //NotifyItemMoved(fromPosition, toPosition); + } + + public void ItemMoveEnded(int fromPosition, int toPosition) + { + //if (MusicPlayer.CurrentID() == fromPosition) + // MusicPlayer.currentID = toPosition; + + //MusicPlayer.instance.UpdateQueueSlots(); + } + + //List Swap(List list, int fromPosition, int toPosition) + //{ + // T item = list[fromPosition]; + // list[fromPosition] = list[toPosition]; + // list[toPosition] = item; + // return list; + //} + + public void ItemDismissed(int position) + { + //Queue.RemoveFromQueue(songList[position]); + //NotifyItemRemoved(position); + } + + public bool RefreshDisabled() + { + return refreshDisabled; + } + + public void DisableRefresh(bool disable) + { + refreshDisabled = disable; + } + } +} \ No newline at end of file diff --git a/MusicApp/Resources/Portable Class/PlaylistTracks.cs b/MusicApp/Resources/Portable Class/PlaylistTracks.cs index 1e7d0c7..ab1fa00 100644 --- a/MusicApp/Resources/Portable Class/PlaylistTracks.cs +++ b/MusicApp/Resources/Portable Class/PlaylistTracks.cs @@ -18,15 +18,18 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using static Android.Provider.MediaStore.Audio; +using RecyclerView = Android.Support.V7.Widget.RecyclerView; namespace MusicApp.Resources.Portable_Class { - public class PlaylistTracks : ListFragment, PopupMenu.IOnMenuItemClickListener, AppBarLayout.IOnOffsetChangedListener + public class PlaylistTracks : Fragment, PopupMenu.IOnMenuItemClickListener, AppBarLayout.IOnOffsetChangedListener { public static PlaylistTracks instance; public string playlistName; - public Adapter adapter; + public RecyclerView ListView; + public PlaylistTrackAdapter adapter; public View emptyView; + private Android.Support.V7.Widget.Helper.ItemTouchHelper itemTouchHelper; public List result; public long playlistId; public string ytID; @@ -36,6 +39,7 @@ namespace MusicApp.Resources.Portable_Class private bool hasWriteAcess; private bool forked; private string nextPageToken = null; + public bool fullyLoadded = false; public bool isEmpty = false; public bool lastVisible = false; private bool useHeader = true; @@ -45,113 +49,14 @@ namespace MusicApp.Resources.Portable_Class private List ytTracksIDs = new List(); private List ytTracksIdsResult; private string[] actions = new string[] { "Play", "Play Next", "Play Last", "Remove Track from playlist", "Add To Playlist" }; - + private bool loading; public override void OnActivityCreated(Bundle savedInstanceState) { base.OnActivityCreated(savedInstanceState); - - emptyView = LayoutInflater.Inflate(Resource.Layout.NoPlaylist, null); - ListView.EmptyView = emptyView; - ListView.Scroll += MainActivity.instance.Scroll; - ListView.ScrollStateChanged += ListView_ScrollStateChanged; - ListView.NestedScrollingEnabled = true; MainActivity.instance.contentRefresh.Refresh += OnRefresh; MainActivity.instance.OnPaddingChanged += OnPaddingChanged; MainActivity.instance.DisplaySearch(1); - -#pragma warning disable CS4014 - PopulateList(); - - if (useHeader) - { - Activity.FindViewById(Resource.Id.playlistHeader).Visibility = ViewStates.Visible; - ((AppBarLayout.LayoutParams)Activity.FindViewById(Resource.Id.collapsingToolbar).LayoutParameters).ScrollFlags = AppBarLayout.LayoutParams.ScrollFlagScroll | AppBarLayout.LayoutParams.ScrollFlagExitUntilCollapsed | AppBarLayout.LayoutParams.ScrollFlagSnap; - Activity.FindViewById(Resource.Id.appbar).AddOnOffsetChangedListener(this); - Activity.FindViewById(Resource.Id.headerTitle).Text = playlistName; - Activity.FindViewById(Resource.Id.headerPlay).Click += (sender, e0) => { PlayInOrder(0, false); }; - Activity.FindViewById(Resource.Id.headerShuffle).Click += (sender, e0) => - { - if (playlistId != 0) - Playlist.RandomPlay(playlistId, Activity); - else - YoutubeEngine.RandomPlay(ytID); - }; - Activity.FindViewById(Resource.Id.headerMore).Click += (sender, e0) => - { - PopupMenu menu = new PopupMenu(MainActivity.instance, MainActivity.instance.FindViewById(Resource.Id.headerMore)); - if (playlistId == 0 && hasWriteAcess) - menu.Inflate(Resource.Menu.ytplaylist_header_more); - else if (playlistId == 0 && forked) - menu.Inflate(Resource.Menu.ytplaylistnowrite_header_more); - else if (playlistId == 0) - menu.Inflate(Resource.Menu.ytplaylist_nowrite_nofork_header_more); - else - menu.Inflate(Resource.Menu.playlist_header_more); - menu.SetOnMenuItemClickListener(this); - menu.Show(); - }; - - - if (playlistId != 0) - { - Activity.FindViewById(Resource.Id.headerAuthor).Text = MainActivity.account == null ? "by me" : "by " + MainActivity.account.DisplayName; - } - else if (ytID != null && ytID != "") - { - Activity.FindViewById(Resource.Id.headerAuthor).Text = author; - Activity.FindViewById(Resource.Id.headerNumber).Text = count.ToString() + " songs"; - if (count == -1) - Activity.FindViewById(Resource.Id.headerNumber).Text = "NaN songs"; - - Picasso.With(Android.App.Application.Context).Load(thumnailURI).Placeholder(Resource.Drawable.noAlbum).Resize(1080, 1080).CenterCrop().Into(Activity.FindViewById(Resource.Id.headerArt)); - } - } - else - { - View header = LayoutInflater.Inflate(Resource.Layout.PlaylistSmallHeader, null, false); - ListView.AddHeaderView(header); - header.FindViewById(Resource.Id.headerNumber).Text = tracks.Count + " songs"; - header.FindViewById(Resource.Id.headerPlay).Click += (sender, e0) => { PlayInOrder(0, false); }; - header.FindViewById(Resource.Id.headerShuffle).Click += (sender, e0) => - { - if (tracks[0].IsYt) - { - System.Random r = new System.Random(); - Song[] songs = tracks.OrderBy(x => r.Next()).ToArray(); - YoutubeEngine.PlayFiles(songs); - } - else - { - List tracksPath = new List(); - foreach (Song song in tracks) - tracksPath.Add(song.Path); - - Intent intent = new Intent(MainActivity.instance, typeof(MusicPlayer)); - intent.PutStringArrayListExtra("files", tracksPath); - intent.SetAction("RandomPlay"); - MainActivity.instance.StartService(intent); - - Intent inte = new Intent(MainActivity.instance, typeof(Player)); - MainActivity.instance.StartActivity(inte); - } - }; - header.FindViewById(Resource.Id.headerMore).Click += (sender, e0) => - { - PopupMenu menu = new PopupMenu(Activity, header.FindViewById(Resource.Id.headerMore)); - menu.Inflate(Resource.Menu.playlist_smallheader_more); - menu.SetOnMenuItemClickListener(this); - menu.Show(); - }; - - if(MainActivity.Theme != 1) - { - header.SetBackgroundColor(Color.Argb(255, 255, 255, 255)); - header.FindViewById(Resource.Id.headerPlay).ImageTintList = ColorStateList.ValueOf(Color.Black); - header.FindViewById(Resource.Id.headerShuffle).ImageTintList = ColorStateList.ValueOf(Color.Black); - header.FindViewById(Resource.Id.headerMore).ImageTintList = ColorStateList.ValueOf(Color.Black); - } - } } public bool OnMenuItemClick(IMenuItem item) @@ -163,6 +68,7 @@ namespace MusicApp.Resources.Portable_Class break; case Resource.Id.fork: +#pragma warning disable CS4014 YoutubeEngine.ForkPlaylist(ytID); break; @@ -279,15 +185,6 @@ namespace MusicApp.Resources.Portable_Class MainActivity.instance.SupportFragmentManager.PopBackStack(); } - private void ListView_ScrollStateChanged(object sender, AbsListView.ScrollStateChangedEventArgs e) - { - if (lastVisible && e.ScrollState == ScrollState.Idle) - { - lastVisible = false; - LoadMore(); - } - } - public void OnPaddingChanged(object sender, PaddingChange e) { if (MainActivity.paddingBot > e.oldPadding) @@ -333,10 +230,13 @@ namespace MusicApp.Resources.Portable_Class if (YoutubeEngine.instances[i].focused) selectedTab = i; } - MainActivity.instance.SupportFragmentManager.BeginTransaction().Attach(YoutubeEngine.instances[selectedTab]).Commit(); - MainActivity.instance.SupportFragmentManager.BeginTransaction().Remove(instance).Commit(); + if (Player.instance == null) + { + MainActivity.instance.SupportFragmentManager.BeginTransaction().Attach(YoutubeEngine.instances[selectedTab]).Commit(); + MainActivity.instance.SupportFragmentManager.BeginTransaction().Remove(instance).Commit(); + } } - else + else if (Player.instance == null) MainActivity.instance.SupportFragmentManager.PopBackStack(); base.OnStop(); @@ -345,11 +245,121 @@ namespace MusicApp.Resources.Portable_Class public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - View view = base.OnCreateView(inflater, container, savedInstanceState); + View view = inflater.Inflate(Resource.Layout.RecyclerFragment, container, false); view.SetPadding(0, 0, 0, MainActivity.defaultPaddingBot); + ListView = view.FindViewById(Resource.Id.recycler); + ListView.SetLayoutManager(new Android.Support.V7.Widget.LinearLayoutManager(MainActivity.instance)); + ListView.SetAdapter(new PlaylistTrackAdapter(new List())); + ListView.ScrollChange += ListView_ScrollChange; + + Android.Support.V7.Widget.Helper.ItemTouchHelper.Callback callback = new PlaylistItemTouch(adapter); + itemTouchHelper = new Android.Support.V7.Widget.Helper.ItemTouchHelper(callback); + itemTouchHelper.AttachToRecyclerView(ListView); + + PopulateList(); + CreateHeader(); return view; } + private void ListView_ScrollChange(object sender, View.ScrollChangeEventArgs e) + { + if (((Android.Support.V7.Widget.LinearLayoutManager)ListView.GetLayoutManager()).FindLastVisibleItemPosition() == adapter.ItemCount - 1) + LoadMore(); + } + + void CreateHeader() + { + if (useHeader) + { + Activity.FindViewById(Resource.Id.playlistHeader).Visibility = ViewStates.Visible; + ((AppBarLayout.LayoutParams)Activity.FindViewById(Resource.Id.collapsingToolbar).LayoutParameters).ScrollFlags = AppBarLayout.LayoutParams.ScrollFlagScroll | AppBarLayout.LayoutParams.ScrollFlagExitUntilCollapsed; + Activity.FindViewById(Resource.Id.appbar).AddOnOffsetChangedListener(this); + Activity.FindViewById(Resource.Id.headerTitle).Text = playlistName; + Activity.FindViewById(Resource.Id.headerPlay).Click += (sender, e0) => { PlayInOrder(0, false); }; + Activity.FindViewById(Resource.Id.headerShuffle).Click += (sender, e0) => + { + if (playlistId != 0) + Playlist.RandomPlay(playlistId, Activity); + else + YoutubeEngine.RandomPlay(ytID); + }; + Activity.FindViewById(Resource.Id.headerMore).Click += (sender, e0) => + { + PopupMenu menu = new PopupMenu(MainActivity.instance, MainActivity.instance.FindViewById(Resource.Id.headerMore)); + if (playlistId == 0 && hasWriteAcess) + menu.Inflate(Resource.Menu.ytplaylist_header_more); + else if (playlistId == 0 && forked) + menu.Inflate(Resource.Menu.ytplaylistnowrite_header_more); + else if (playlistId == 0) + menu.Inflate(Resource.Menu.ytplaylist_nowrite_nofork_header_more); + else + menu.Inflate(Resource.Menu.playlist_header_more); + menu.SetOnMenuItemClickListener(this); + menu.Show(); + }; + + + if (playlistId != 0) + { + Activity.FindViewById(Resource.Id.headerAuthor).Text = MainActivity.account == null ? "by me" : "by " + MainActivity.account.DisplayName; + } + else if (ytID != null && ytID != "") + { + Activity.FindViewById(Resource.Id.headerAuthor).Text = author; + Activity.FindViewById(Resource.Id.headerNumber).Text = count.ToString() + " songs"; + if (count == -1) + Activity.FindViewById(Resource.Id.headerNumber).Text = "NaN songs"; + + Picasso.With(Android.App.Application.Context).Load(thumnailURI).Placeholder(Resource.Drawable.noAlbum).Resize(1080, 1080).CenterCrop().Into(Activity.FindViewById(Resource.Id.headerArt)); + } + } + else + { + View header = LayoutInflater.Inflate(Resource.Layout.PlaylistSmallHeader, null, false); + //ListView.AddHeaderView(header); + header.FindViewById(Resource.Id.headerNumber).Text = tracks.Count + " songs"; + header.FindViewById(Resource.Id.headerPlay).Click += (sender, e0) => { PlayInOrder(0, false); }; + header.FindViewById(Resource.Id.headerShuffle).Click += (sender, e0) => + { + if (tracks[0].IsYt) + { + System.Random r = new System.Random(); + Song[] songs = tracks.OrderBy(x => r.Next()).ToArray(); + YoutubeEngine.PlayFiles(songs); + } + else + { + List tracksPath = new List(); + foreach (Song song in tracks) + tracksPath.Add(song.Path); + + Intent intent = new Intent(MainActivity.instance, typeof(MusicPlayer)); + intent.PutStringArrayListExtra("files", tracksPath); + intent.SetAction("RandomPlay"); + MainActivity.instance.StartService(intent); + + Intent inte = new Intent(MainActivity.instance, typeof(Player)); + MainActivity.instance.StartActivity(inte); + } + }; + header.FindViewById(Resource.Id.headerMore).Click += (sender, e0) => + { + PopupMenu menu = new PopupMenu(Activity, header.FindViewById(Resource.Id.headerMore)); + menu.Inflate(Resource.Menu.playlist_smallheader_more); + menu.SetOnMenuItemClickListener(this); + menu.Show(); + }; + + if (MainActivity.Theme != 1) + { + header.SetBackgroundColor(Color.Argb(255, 255, 255, 255)); + header.FindViewById(Resource.Id.headerPlay).ImageTintList = ColorStateList.ValueOf(Color.Black); + header.FindViewById(Resource.Id.headerShuffle).ImageTintList = ColorStateList.ValueOf(Color.Black); + header.FindViewById(Resource.Id.headerMore).ImageTintList = ColorStateList.ValueOf(Color.Black); + } + } + } + public static Fragment NewInstance(List songs, string playlistName) { instance = new PlaylistTracks { Arguments = new Bundle() }; @@ -423,17 +433,17 @@ namespace MusicApp.Resources.Portable_Class musicCursor.Close(); } - adapter = new Adapter(Android.App.Application.Context, Resource.Layout.SongList, tracks) - { - listPadding = MainActivity.paddingBot - MainActivity.defaultPaddingBot - }; - ListAdapter = adapter; - ListView.Adapter = adapter; - ListView.TextFilterEnabled = true; - ListView.ItemClick += ListView_ItemClick; - ListView.ItemLongClick += ListView_ItemLongClick; + //adapter = new PlaylistTrackAdapter(tracks) + //{ + // listPadding = MainActivity.paddingBot - MainActivity.defaultPaddingBot + //}; + adapter.AddToList(tracks); + adapter.listPadding = MainActivity.paddingBot - MainActivity.defaultPaddingBot; + adapter.ItemClick += ListView_ItemClick; + adapter.ItemLongClick += ListView_ItemLongClick; + ListView.SetAdapter(adapter); - if (adapter == null || adapter.Count == 0) + if (adapter == null || adapter.ItemCount == 0) { isEmpty = true; Activity.AddContentView(emptyView, View.LayoutParameters); @@ -465,17 +475,17 @@ namespace MusicApp.Resources.Portable_Class } nextPageToken = ytPlaylist.NextPageToken; - adapter = new Adapter(Android.App.Application.Context, Resource.Layout.SongList, tracks) - { - listPadding = MainActivity.paddingBot - MainActivity.defaultPaddingBot - }; - ListAdapter = adapter; - ListView.Adapter = adapter; - ListView.TextFilterEnabled = true; - ListView.ItemClick += ListView_ItemClick; - ListView.ItemLongClick += ListView_ItemLongClick; + //adapter = new PlaylistTrackAdapter(tracks) + //{ + // listPadding = MainActivity.paddingBot - MainActivity.defaultPaddingBot + //}; + adapter.AddToList(tracks); + adapter.listPadding = MainActivity.paddingBot - MainActivity.defaultPaddingBot; + adapter.ItemClick += ListView_ItemClick; + adapter.ItemLongClick += ListView_ItemLongClick; + ListView.SetAdapter(adapter); - if (adapter == null || adapter.Count == 0) + if (adapter == null || adapter.ItemCount == 0) { isEmpty = true; Activity.AddContentView(emptyView, View.LayoutParameters); @@ -483,17 +493,17 @@ namespace MusicApp.Resources.Portable_Class } else if(tracks.Count != 0) { - adapter = new Adapter(Android.App.Application.Context, Resource.Layout.SongList, tracks) - { - listPadding = MainActivity.paddingBot - MainActivity.defaultPaddingBot - }; - ListAdapter = adapter; - ListView.Adapter = adapter; - ListView.TextFilterEnabled = true; - ListView.ItemClick += ListView_ItemClick; - ListView.ItemLongClick += ListView_ItemLongClick; + //adapter = new PlaylistTrackAdapter(tracks) + //{ + // listPadding = MainActivity.paddingBot - MainActivity.defaultPaddingBot + //}; + adapter.AddToList(tracks); + adapter.listPadding = MainActivity.paddingBot - MainActivity.defaultPaddingBot; + adapter.ItemClick += ListView_ItemClick; + adapter.ItemLongClick += ListView_ItemLongClick; + ListView.SetAdapter(adapter); - if (adapter == null || adapter.Count == 0) + if (adapter == null || adapter.ItemCount == 0) { isEmpty = true; Activity.AddContentView(emptyView, View.LayoutParameters); @@ -509,9 +519,10 @@ namespace MusicApp.Resources.Portable_Class public async Task LoadMore() { - if (nextPageToken == null) + if (nextPageToken == null || loading) return; + loading = true; var ytPlaylistRequest = YoutubeEngine.youtubeService.PlaylistItems.List("snippet, contentDetails"); ytPlaylistRequest.PlaylistId = ytID; ytPlaylistRequest.MaxResults = 50; @@ -530,7 +541,10 @@ namespace MusicApp.Resources.Portable_Class } nextPageToken = ytPlaylist.NextPageToken; + if (nextPageToken == null) + fullyLoadded = true; adapter.NotifyDataSetChanged(); + loading = false; } public void Search(string search) @@ -547,25 +561,27 @@ namespace MusicApp.Resources.Portable_Class ytTracksIdsResult.Add(ytTracksIDs[i]); } } - adapter = new Adapter(Android.App.Application.Context, Resource.Layout.SongList, result) + adapter = new PlaylistTrackAdapter(result) { listPadding = MainActivity.paddingBot - MainActivity.defaultPaddingBot }; - ListAdapter = adapter; + adapter.ItemClick += ListView_ItemClick; + adapter.ItemLongClick += ListView_ItemLongClick; + ListView.SetAdapter(adapter); } - private void ListView_ItemClick(object sender, AdapterView.ItemClickEventArgs e) + private void ListView_ItemClick(object sender, int Position) { - PlayInOrder(useHeader ? e.Position : e.Position - 1, true); + PlayInOrder(useHeader ? Position : Position - 1, true); } - private void ListView_ItemLongClick(object sender, AdapterView.ItemLongClickEventArgs e) + private void ListView_ItemLongClick(object sender, int Position) { - Song item = tracks[useHeader ? e.Position : e.Position - 1]; - if (result != null && result.Count > (useHeader ? e.Position : e.Position - 1)) - item = result[useHeader ? e.Position : e.Position - 1]; + Song item = tracks[useHeader ? Position : Position - 1]; + if (result != null && result.Count > (useHeader ? Position : Position - 1)) + item = result[useHeader ? Position : Position - 1]; - More(item, useHeader ? e.Position : e.Position - 1); + More(item, useHeader ? Position : Position - 1); } public void More(Song item, int position) @@ -635,7 +651,7 @@ namespace MusicApp.Resources.Portable_Class if (item.IsYt) YoutubeEngine.Download(item.Title, item.Path); else - Browse.EditMetadata(item, "PlaylistTracks", ListView.OnSaveInstanceState()); + Browse.EditMetadata(item, "PlaylistTracks", ListView.GetLayoutManager().OnSaveInstanceState()); break; default: @@ -680,7 +696,7 @@ namespace MusicApp.Resources.Portable_Class if (item.IsYt) YoutubeEngine.Download(item.Title, item.Path); else - Browse.EditMetadata(item, "PlaylistTracks", ListView.OnSaveInstanceState()); + Browse.EditMetadata(item, "PlaylistTracks", ListView.GetLayoutManager().OnSaveInstanceState()); break; default: @@ -703,7 +719,7 @@ namespace MusicApp.Resources.Portable_Class if (!songs[0].IsYt) { Browse.act = Activity; - Browse.Play(songs[0], useTransition ? ListView.GetChildAt(fromPosition - ListView.FirstVisiblePosition).FindViewById(Resource.Id.albumArt) : null); + Browse.Play(songs[0], useTransition ? ListView.GetChildAt(fromPosition - ((Android.Support.V7.Widget.LinearLayoutManager)ListView.GetLayoutManager()).FindFirstVisibleItemPosition()).FindViewById(Resource.Id.albumArt) : null); } else YoutubeEngine.Play(songs[0].youtubeID, songs[0].Title, songs[0].Artist, songs[0].Album); @@ -733,7 +749,7 @@ namespace MusicApp.Resources.Portable_Class ytTracksIDs.Remove(ytTrackID); ytTracksIdsResult?.Remove(ytTrackID); adapter.Remove(item); - if (adapter == null || adapter.Count == 0) + if (adapter == null || adapter.ItemCount == 0) { isEmpty = true; Activity.AddContentView(emptyView, View.LayoutParameters); @@ -747,7 +763,7 @@ namespace MusicApp.Resources.Portable_Class resolver.Delete(uri, MediaStore.Audio.Playlists.Members.Id + "=?", new string[] { item.Id.ToString() }); tracks.Remove(item); adapter.Remove(item); - if (adapter == null || adapter.Count == 0) + if (adapter == null || adapter.ItemCount == 0) { isEmpty = true; Activity.AddContentView(emptyView, View.LayoutParameters); @@ -760,7 +776,7 @@ namespace MusicApp.Resources.Portable_Class instance = this; if (MainActivity.parcelable != null && MainActivity.parcelableSender == "PlaylistTrack") { - ListView.OnRestoreInstanceState(MainActivity.parcelable); + ListView.GetLayoutManager().OnRestoreInstanceState(MainActivity.parcelable); MainActivity.parcelable = null; MainActivity.parcelableSender = null; } @@ -783,4 +799,4 @@ namespace MusicApp.Resources.Portable_Class } } } -} \ No newline at end of file +} diff --git a/MusicApp/Resources/Portable Class/RecyclerAdapter.cs b/MusicApp/Resources/Portable Class/RecyclerAdapter.cs index 5592f70..412537b 100644 --- a/MusicApp/Resources/Portable Class/RecyclerAdapter.cs +++ b/MusicApp/Resources/Portable Class/RecyclerAdapter.cs @@ -90,15 +90,15 @@ namespace MusicApp.Resources.Portable_Class }; } - //if (!holder.reorder.HasOnClickListeners) - //{ - // holder.reorder.Click += (sender, e) => - // { - // Queue.instance.itemTouchHelper.StartDrag(viewHolder); - // MainActivity.instance.contentRefresh.SetEnabled(false); - // Queue.instance.adapter.DisableRefresh(true); - // }; - //} + if (!holder.reorder.HasOnClickListeners) + { + holder.reorder.Touch += (sender, e) => + { + Queue.instance.itemTouchHelper.StartDrag(viewHolder); + MainActivity.instance.contentRefresh.SetEnabled(false); + Queue.instance.adapter.DisableRefresh(true); + }; + } if (songList[position].queueSlot == MusicPlayer.CurrentID()) @@ -219,7 +219,7 @@ namespace MusicApp.Resources.Portable_Class if (MusicPlayer.CurrentID() == fromPosition) MusicPlayer.currentID = toPosition; - MusicPlayer.instance.UpdateQueueSlots(); + MusicPlayer.instance?.UpdateQueueSlots(); } List Swap(List list, int fromPosition, int toPosition) diff --git a/MusicApp/Resources/Resource.Designer.cs b/MusicApp/Resources/Resource.Designer.cs index 6178fa7..f58c790 100644 --- a/MusicApp/Resources/Resource.Designer.cs +++ b/MusicApp/Resources/Resource.Designer.cs @@ -2706,26 +2706,26 @@ namespace MusicApp // aapt resource value: 0x7f020053 public const int avd_hide_password = 2130837587; - // aapt resource value: 0x7f0200c4 - public const int avd_hide_password_1 = 2130837700; - // aapt resource value: 0x7f0200c5 - public const int avd_hide_password_2 = 2130837701; + public const int avd_hide_password_1 = 2130837701; // aapt resource value: 0x7f0200c6 - public const int avd_hide_password_3 = 2130837702; + public const int avd_hide_password_2 = 2130837702; + + // aapt resource value: 0x7f0200c7 + public const int avd_hide_password_3 = 2130837703; // aapt resource value: 0x7f020054 public const int avd_show_password = 2130837588; - // aapt resource value: 0x7f0200c7 - public const int avd_show_password_1 = 2130837703; - // aapt resource value: 0x7f0200c8 - public const int avd_show_password_2 = 2130837704; + public const int avd_show_password_1 = 2130837704; // aapt resource value: 0x7f0200c9 - public const int avd_show_password_3 = 2130837705; + public const int avd_show_password_2 = 2130837705; + + // aapt resource value: 0x7f0200ca + public const int avd_show_password_3 = 2130837706; // aapt resource value: 0x7f020055 public const int Close = 2130837589; @@ -2790,287 +2790,290 @@ namespace MusicApp // aapt resource value: 0x7f020069 public const int CrossToPlay = 2130837609; - // aapt resource value: 0x7f0200ca - public const int crosstoplay_1 = 2130837706; - // aapt resource value: 0x7f0200cb - public const int crosstoplay_2 = 2130837707; + public const int crosstoplay_1 = 2130837707; + + // aapt resource value: 0x7f0200cc + public const int crosstoplay_2 = 2130837708; // aapt resource value: 0x7f02006a public const int darkRectangle = 2130837610; // aapt resource value: 0x7f02006b - public const int design_bottom_navigation_item_background = 2130837611; + public const int Delete = 2130837611; // aapt resource value: 0x7f02006c - public const int design_fab_background = 2130837612; + public const int design_bottom_navigation_item_background = 2130837612; // aapt resource value: 0x7f02006d - public const int design_ic_visibility = 2130837613; + public const int design_fab_background = 2130837613; // aapt resource value: 0x7f02006e - public const int design_ic_visibility_off = 2130837614; + public const int design_ic_visibility = 2130837614; // aapt resource value: 0x7f02006f - public const int design_password_eye = 2130837615; + public const int design_ic_visibility_off = 2130837615; // aapt resource value: 0x7f020070 - public const int design_snackbar_background = 2130837616; + public const int design_password_eye = 2130837616; // aapt resource value: 0x7f020071 - public const int Download = 2130837617; + public const int design_snackbar_background = 2130837617; // aapt resource value: 0x7f020072 - public const int Edit = 2130837618; - - // aapt resource value: 0x7f0200b7 - public const int exo_controls_fastforward = 2130837687; + public const int Download = 2130837618; // aapt resource value: 0x7f020073 - public const int exo_controls_fullscreen_enter = 2130837619; - - // aapt resource value: 0x7f020074 - public const int exo_controls_fullscreen_exit = 2130837620; + public const int Edit = 2130837619; // aapt resource value: 0x7f0200b8 - public const int exo_controls_next = 2130837688; + public const int exo_controls_fastforward = 2130837688; - // aapt resource value: 0x7f0200b9 - public const int exo_controls_pause = 2130837689; - - // aapt resource value: 0x7f0200ba - public const int exo_controls_play = 2130837690; - - // aapt resource value: 0x7f0200bb - public const int exo_controls_previous = 2130837691; + // aapt resource value: 0x7f020074 + public const int exo_controls_fullscreen_enter = 2130837620; // aapt resource value: 0x7f020075 - public const int exo_controls_repeat_all = 2130837621; + public const int exo_controls_fullscreen_exit = 2130837621; - // aapt resource value: 0x7f020076 - public const int exo_controls_repeat_off = 2130837622; + // aapt resource value: 0x7f0200b9 + public const int exo_controls_next = 2130837689; - // aapt resource value: 0x7f020077 - public const int exo_controls_repeat_one = 2130837623; + // aapt resource value: 0x7f0200ba + public const int exo_controls_pause = 2130837690; + + // aapt resource value: 0x7f0200bb + public const int exo_controls_play = 2130837691; // aapt resource value: 0x7f0200bc - public const int exo_controls_rewind = 2130837692; + public const int exo_controls_previous = 2130837692; + + // aapt resource value: 0x7f020076 + public const int exo_controls_repeat_all = 2130837622; + + // aapt resource value: 0x7f020077 + public const int exo_controls_repeat_off = 2130837623; // aapt resource value: 0x7f020078 - public const int exo_controls_shuffle = 2130837624; - - // aapt resource value: 0x7f020079 - public const int exo_edit_mode_logo = 2130837625; - - // aapt resource value: 0x7f02007a - public const int exo_icon_fastforward = 2130837626; - - // aapt resource value: 0x7f02007b - public const int exo_icon_next = 2130837627; - - // aapt resource value: 0x7f02007c - public const int exo_icon_pause = 2130837628; - - // aapt resource value: 0x7f02007d - public const int exo_icon_play = 2130837629; - - // aapt resource value: 0x7f02007e - public const int exo_icon_previous = 2130837630; - - // aapt resource value: 0x7f02007f - public const int exo_icon_rewind = 2130837631; - - // aapt resource value: 0x7f020080 - public const int exo_icon_stop = 2130837632; + public const int exo_controls_repeat_one = 2130837624; // aapt resource value: 0x7f0200bd - public const int exo_notification_fastforward = 2130837693; + public const int exo_controls_rewind = 2130837693; - // aapt resource value: 0x7f0200be - public const int exo_notification_next = 2130837694; + // aapt resource value: 0x7f020079 + public const int exo_controls_shuffle = 2130837625; - // aapt resource value: 0x7f0200bf - public const int exo_notification_pause = 2130837695; + // aapt resource value: 0x7f02007a + public const int exo_edit_mode_logo = 2130837626; - // aapt resource value: 0x7f0200c0 - public const int exo_notification_play = 2130837696; + // aapt resource value: 0x7f02007b + public const int exo_icon_fastforward = 2130837627; - // aapt resource value: 0x7f0200c1 - public const int exo_notification_previous = 2130837697; + // aapt resource value: 0x7f02007c + public const int exo_icon_next = 2130837628; - // aapt resource value: 0x7f0200c2 - public const int exo_notification_rewind = 2130837698; + // aapt resource value: 0x7f02007d + public const int exo_icon_pause = 2130837629; + + // aapt resource value: 0x7f02007e + public const int exo_icon_play = 2130837630; + + // aapt resource value: 0x7f02007f + public const int exo_icon_previous = 2130837631; + + // aapt resource value: 0x7f020080 + public const int exo_icon_rewind = 2130837632; // aapt resource value: 0x7f020081 - public const int exo_notification_small_icon = 2130837633; + public const int exo_icon_stop = 2130837633; + + // aapt resource value: 0x7f0200be + public const int exo_notification_fastforward = 2130837694; + + // aapt resource value: 0x7f0200bf + public const int exo_notification_next = 2130837695; + + // aapt resource value: 0x7f0200c0 + public const int exo_notification_pause = 2130837696; + + // aapt resource value: 0x7f0200c1 + public const int exo_notification_play = 2130837697; + + // aapt resource value: 0x7f0200c2 + public const int exo_notification_previous = 2130837698; // aapt resource value: 0x7f0200c3 - public const int exo_notification_stop = 2130837699; + public const int exo_notification_rewind = 2130837699; // aapt resource value: 0x7f020082 - public const int FlatButtonBorder = 2130837634; + public const int exo_notification_small_icon = 2130837634; + + // aapt resource value: 0x7f0200c4 + public const int exo_notification_stop = 2130837700; // aapt resource value: 0x7f020083 - public const int folderIcon = 2130837635; + public const int FlatButtonBorder = 2130837635; // aapt resource value: 0x7f020084 - public const int googleg_disabled_color_18 = 2130837636; + public const int folderIcon = 2130837636; // aapt resource value: 0x7f020085 - public const int googleg_standard_color_18 = 2130837637; + public const int googleg_disabled_color_18 = 2130837637; // aapt resource value: 0x7f020086 - public const int GradientShape = 2130837638; + public const int googleg_standard_color_18 = 2130837638; // aapt resource value: 0x7f020087 - public const int History = 2130837639; + public const int GradientShape = 2130837639; // aapt resource value: 0x7f020088 - public const int HomeIcon = 2130837640; + public const int History = 2130837640; // aapt resource value: 0x7f020089 - public const int ic_account_circle_black_24dp = 2130837641; + public const int HomeIcon = 2130837641; // aapt resource value: 0x7f02008a - public const int ic_done_black_24dp = 2130837642; + public const int ic_account_circle_black_24dp = 2130837642; // aapt resource value: 0x7f02008b - public const int ic_expand_less_black_24dp = 2130837643; + public const int ic_done_black_24dp = 2130837643; // aapt resource value: 0x7f02008c - public const int ic_expand_more_black_24dp = 2130837644; + public const int ic_expand_less_black_24dp = 2130837644; // aapt resource value: 0x7f02008d - public const int ic_filter_list_white_24dp = 2130837645; + public const int ic_expand_more_black_24dp = 2130837645; // aapt resource value: 0x7f02008e - public const int ic_more_vert_black_24dp = 2130837646; + public const int ic_filter_list_white_24dp = 2130837646; // aapt resource value: 0x7f02008f - public const int ic_pause_black_24dp = 2130837647; + public const int ic_more_vert_black_24dp = 2130837647; // aapt resource value: 0x7f020090 - public const int ic_play_arrow_black_24dp = 2130837648; + public const int ic_pause_black_24dp = 2130837648; // aapt resource value: 0x7f020091 - public const int ic_playlist_add_white_24dp = 2130837649; + public const int ic_play_arrow_black_24dp = 2130837649; // aapt resource value: 0x7f020092 - public const int ic_playlist_play_black_24dp = 2130837650; + public const int ic_playlist_add_white_24dp = 2130837650; // aapt resource value: 0x7f020093 - public const int ic_query_builder_black_24dp = 2130837651; + public const int ic_playlist_play_black_24dp = 2130837651; // aapt resource value: 0x7f020094 - public const int ic_reorder_black_24dp = 2130837652; + public const int ic_query_builder_black_24dp = 2130837652; // aapt resource value: 0x7f020095 - public const int ic_skip_next_black_24dp = 2130837653; + public const int ic_reorder_black_24dp = 2130837653; // aapt resource value: 0x7f020096 - public const int ic_skip_previous_black_24dp = 2130837654; + public const int ic_skip_next_black_24dp = 2130837654; // aapt resource value: 0x7f020097 - public const int ic_timer_white_24dp = 2130837655; + public const int ic_skip_previous_black_24dp = 2130837655; // aapt resource value: 0x7f020098 - public const int launcher_icon = 2130837656; + public const int ic_timer_white_24dp = 2130837656; // aapt resource value: 0x7f020099 - public const int Loop = 2130837657; + public const int launcher_icon = 2130837657; // aapt resource value: 0x7f02009a - public const int MusicIcon = 2130837658; + public const int Loop = 2130837658; // aapt resource value: 0x7f02009b - public const int navigation_empty_icon = 2130837659; + public const int MusicIcon = 2130837659; // aapt resource value: 0x7f02009c - public const int needProcessing = 2130837660; + public const int navigation_empty_icon = 2130837660; // aapt resource value: 0x7f02009d - public const int noAlbum = 2130837661; + public const int needProcessing = 2130837661; // aapt resource value: 0x7f02009e - public const int notification_action_background = 2130837662; + public const int noAlbum = 2130837662; // aapt resource value: 0x7f02009f - public const int notification_bg = 2130837663; + public const int notification_action_background = 2130837663; // aapt resource value: 0x7f0200a0 - public const int notification_bg_low = 2130837664; + public const int notification_bg = 2130837664; // aapt resource value: 0x7f0200a1 - public const int notification_bg_low_normal = 2130837665; + public const int notification_bg_low = 2130837665; // aapt resource value: 0x7f0200a2 - public const int notification_bg_low_pressed = 2130837666; + public const int notification_bg_low_normal = 2130837666; // aapt resource value: 0x7f0200a3 - public const int notification_bg_normal = 2130837667; + public const int notification_bg_low_pressed = 2130837667; // aapt resource value: 0x7f0200a4 - public const int notification_bg_normal_pressed = 2130837668; + public const int notification_bg_normal = 2130837668; // aapt resource value: 0x7f0200a5 - public const int notification_icon_background = 2130837669; - - // aapt resource value: 0x7f0200b5 - public const int notification_template_icon_bg = 2130837685; - - // aapt resource value: 0x7f0200b6 - public const int notification_template_icon_low_bg = 2130837686; + public const int notification_bg_normal_pressed = 2130837669; // aapt resource value: 0x7f0200a6 - public const int notification_tile_bg = 2130837670; + public const int notification_icon_background = 2130837670; + + // aapt resource value: 0x7f0200b6 + public const int notification_template_icon_bg = 2130837686; + + // aapt resource value: 0x7f0200b7 + public const int notification_template_icon_low_bg = 2130837687; // aapt resource value: 0x7f0200a7 - public const int notify_panel_notification_icon_bg = 2130837671; + public const int notification_tile_bg = 2130837671; // aapt resource value: 0x7f0200a8 - public const int OpenInYoutube = 2130837672; + public const int notify_panel_notification_icon_bg = 2130837672; // aapt resource value: 0x7f0200a9 - public const int PlaylistPlayIcon = 2130837673; + public const int OpenInYoutube = 2130837673; // aapt resource value: 0x7f0200aa - public const int PlayToCross = 2130837674; - - // aapt resource value: 0x7f0200cc - public const int playtocross_1 = 2130837708; - - // aapt resource value: 0x7f0200cd - public const int playtocross_2 = 2130837709; + public const int PlaylistPlayIcon = 2130837674; // aapt resource value: 0x7f0200ab - public const int Queue = 2130837675; + public const int PlayToCross = 2130837675; + + // aapt resource value: 0x7f0200cd + public const int playtocross_1 = 2130837709; + + // aapt resource value: 0x7f0200ce + public const int playtocross_2 = 2130837710; // aapt resource value: 0x7f0200ac - public const int Refine = 2130837676; + public const int Queue = 2130837676; // aapt resource value: 0x7f0200ad - public const int search = 2130837677; + public const int Refine = 2130837677; // aapt resource value: 0x7f0200ae - public const int settings = 2130837678; + public const int search = 2130837678; // aapt resource value: 0x7f0200af - public const int Shuffle = 2130837679; + public const int settings = 2130837679; // aapt resource value: 0x7f0200b0 - public const int tooltip_frame_dark = 2130837680; + public const int Shuffle = 2130837680; // aapt resource value: 0x7f0200b1 - public const int tooltip_frame_light = 2130837681; + public const int tooltip_frame_dark = 2130837681; // aapt resource value: 0x7f0200b2 - public const int TranslucentBackground = 2130837682; + public const int tooltip_frame_light = 2130837682; // aapt resource value: 0x7f0200b3 - public const int youtubeIcon = 2130837683; + public const int TranslucentBackground = 2130837683; // aapt resource value: 0x7f0200b4 - public const int YtPlay = 2130837684; + public const int youtubeIcon = 2130837684; + + // aapt resource value: 0x7f0200b5 + public const int YtPlay = 2130837685; static Drawable() { @@ -3097,8 +3100,8 @@ namespace MusicApp // aapt resource value: 0x7f0a0051 public const int META = 2131361873; - // aapt resource value: 0x7f0a0117 - public const int PreferenceScreen = 2131362071; + // aapt resource value: 0x7f0a011a + public const int PreferenceScreen = 2131362074; // aapt resource value: 0x7f0a0052 public const int SHIFT = 2131361874; @@ -3106,8 +3109,8 @@ namespace MusicApp // aapt resource value: 0x7f0a0053 public const int SYM = 2131361875; - // aapt resource value: 0x7f0a0118 - public const int accountPreference = 2131362072; + // aapt resource value: 0x7f0a011b + public const int accountPreference = 2131362075; // aapt resource value: 0x7f0a00b1 public const int action = 2131361969; @@ -3175,8 +3178,8 @@ namespace MusicApp // aapt resource value: 0x7f0a0043 public const int add = 2131361859; - // aapt resource value: 0x7f0a013d - public const int addToQueue = 2131362109; + // aapt resource value: 0x7f0a013f + public const int addToQueue = 2131362111; // aapt resource value: 0x7f0a0031 public const int adjust_height = 2131361841; @@ -3226,8 +3229,8 @@ namespace MusicApp // aapt resource value: 0x7f0a00e0 public const int bottomView = 2131362016; - // aapt resource value: 0x7f0a0139 - public const int browseLayout = 2131362105; + // aapt resource value: 0x7f0a013b + public const int browseLayout = 2131362107; // aapt resource value: 0x7f0a00ae public const int browseList = 2131361966; @@ -3241,8 +3244,8 @@ namespace MusicApp // aapt resource value: 0x7f0a00e7 public const int cancel_action = 2131362023; - // aapt resource value: 0x7f0a0123 - public const int cardPlayer = 2131362083; + // aapt resource value: 0x7f0a0126 + public const int cardPlayer = 2131362086; // aapt resource value: 0x7f0a0060 public const int center = 2131361888; @@ -3304,8 +3307,11 @@ namespace MusicApp // aapt resource value: 0x7f0a0082 public const int default_activity_button = 2131361922; - // aapt resource value: 0x7f0a013f - public const int delete = 2131362111; + // aapt resource value: 0x7f0a0141 + public const int delete = 2131362113; + + // aapt resource value: 0x7f0a0110 + public const int deleteButton = 2131362064; // aapt resource value: 0x7f0a00ba public const int design_bottom_sheet = 2131361978; @@ -3328,14 +3334,14 @@ namespace MusicApp // aapt resource value: 0x7f0a0108 public const int downFAB = 2131362056; - // aapt resource value: 0x7f0a0144 - public const int download = 2131362116; + // aapt resource value: 0x7f0a0146 + public const int download = 2131362118; - // aapt resource value: 0x7f0a013b - public const int downloadMDfromYT = 2131362107; + // aapt resource value: 0x7f0a013d + public const int downloadMDfromYT = 2131362109; - // aapt resource value: 0x7f0a012f - public const int edit = 2131362095; + // aapt resource value: 0x7f0a0132 + public const int edit = 2131362098; // aapt resource value: 0x7f0a00a0 public const int edit_query = 2131361952; @@ -3439,8 +3445,8 @@ namespace MusicApp // aapt resource value: 0x7f0a0063 public const int fill_vertical = 2131361891; - // aapt resource value: 0x7f0a0142 - public const int filter = 2131362114; + // aapt resource value: 0x7f0a0144 + public const int filter = 2131362116; // aapt resource value: 0x7f0a0076 public const int fit = 2131361910; @@ -3463,11 +3469,14 @@ namespace MusicApp // aapt resource value: 0x7f0a00d1 public const int folderUsed = 2131362001; + // aapt resource value: 0x7f0a0111 + public const int foreground = 2131362065; + // aapt resource value: 0x7f0a0073 public const int forever = 2131361907; - // aapt resource value: 0x7f0a0145 - public const int fork = 2131362117; + // aapt resource value: 0x7f0a0147 + public const int fork = 2131362119; // aapt resource value: 0x7f0a000a public const int ghost_view = 2131361802; @@ -3502,11 +3511,11 @@ namespace MusicApp // aapt resource value: 0x7f0a0084 public const int icon = 2131361924; - // aapt resource value: 0x7f0a0131 - public const int icon1 = 2131362097; + // aapt resource value: 0x7f0a0133 + public const int icon1 = 2131362099; - // aapt resource value: 0x7f0a0110 - public const int icon_frame = 2131362064; + // aapt resource value: 0x7f0a0113 + public const int icon_frame = 2131362067; // aapt resource value: 0x7f0a00f4 public const int icon_group = 2131362036; @@ -3547,8 +3556,8 @@ namespace MusicApp // aapt resource value: 0x7f0a0017 public const int line1 = 2131361815; - // aapt resource value: 0x7f0a0135 - public const int line2 = 2131362101; + // aapt resource value: 0x7f0a0137 + public const int line2 = 2131362103; // aapt resource value: 0x7f0a0018 public const int line3 = 2131361816; @@ -3556,8 +3565,8 @@ namespace MusicApp // aapt resource value: 0x7f0a00d2 public const int lineRecycler = 2131362002; - // aapt resource value: 0x7f0a0112 - public const int list = 2131362066; + // aapt resource value: 0x7f0a0115 + public const int list = 2131362069; // aapt resource value: 0x7f0a003a public const int listMode = 2131361850; @@ -3565,23 +3574,23 @@ namespace MusicApp // aapt resource value: 0x7f0a0083 public const int list_item = 2131361923; - // aapt resource value: 0x7f0a011b - public const int localPlay = 2131362075; + // aapt resource value: 0x7f0a011e + public const int localPlay = 2131362078; // aapt resource value: 0x7f0a00d7 public const int logButton = 2131362007; - // aapt resource value: 0x7f0a0137 - public const int masked = 2131362103; + // aapt resource value: 0x7f0a0139 + public const int masked = 2131362105; - // aapt resource value: 0x7f0a0122 - public const int maxValue = 2131362082; + // aapt resource value: 0x7f0a0125 + public const int maxValue = 2131362085; // aapt resource value: 0x7f0a00e9 public const int media_actions = 2131362025; - // aapt resource value: 0x7f0a0134 - public const int message = 2131362100; + // aapt resource value: 0x7f0a0136 + public const int message = 2131362102; // aapt resource value: 0x7f0a00c9 public const int metadataAlbum = 2131361993; @@ -3607,20 +3616,20 @@ namespace MusicApp // aapt resource value: 0x7f0a004d public const int middle = 2131361869; - // aapt resource value: 0x7f0a0121 - public const int minValue = 2131362081; + // aapt resource value: 0x7f0a0124 + public const int minValue = 2131362084; // aapt resource value: 0x7f0a006e public const int mini = 2131361902; - // aapt resource value: 0x7f0a0130 - public const int moreButton = 2131362096; + // aapt resource value: 0x7f0a0112 + public const int moreButton = 2131362066; // aapt resource value: 0x7f0a0044 public const int multiply = 2131361860; - // aapt resource value: 0x7f0a0138 - public const int musicLayout = 2131362104; + // aapt resource value: 0x7f0a013a + public const int musicLayout = 2131362106; // aapt resource value: 0x7f0a00bd public const int navigation_header_container = 2131361981; @@ -3664,8 +3673,8 @@ namespace MusicApp // aapt resource value: 0x7f0a0075 public const int one = 2131361909; - // aapt resource value: 0x7f0a0133 - public const int pager = 2131362099; + // aapt resource value: 0x7f0a0135 + public const int pager = 2131362101; // aapt resource value: 0x7f0a0067 public const int parallax = 2131361895; @@ -3706,17 +3715,17 @@ namespace MusicApp // aapt resource value: 0x7f0a00d9 public const int playlistHeader = 2131362009; - // aapt resource value: 0x7f0a013a - public const int playlistLayout = 2131362106; + // aapt resource value: 0x7f0a013c + public const int playlistLayout = 2131362108; // aapt resource value: 0x7f0a00b4 public const int playlistName = 2131361972; - // aapt resource value: 0x7f0a011e - public const int playlistURL = 2131362078; + // aapt resource value: 0x7f0a0121 + public const int playlistURL = 2131362081; - // aapt resource value: 0x7f0a0116 - public const int preferenceContent = 2131362070; + // aapt resource value: 0x7f0a0119 + public const int preferenceContent = 2131362073; // aapt resource value: 0x7f0a0006 public const int progress_circular = 2131361798; @@ -3724,14 +3733,14 @@ namespace MusicApp // aapt resource value: 0x7f0a0007 public const int progress_horizontal = 2131361799; - // aapt resource value: 0x7f0a0119 - public const int queueSwitch = 2131362073; + // aapt resource value: 0x7f0a011c + public const int queueSwitch = 2131362076; + + // aapt resource value: 0x7f0a0120 + public const int quickPlay = 2131362080; // aapt resource value: 0x7f0a011d - public const int quickPlay = 2131362077; - - // aapt resource value: 0x7f0a011a - public const int quickPlayLinear = 2131362074; + public const int quickPlayLinear = 2131362077; // aapt resource value: 0x7f0a0097 public const int radio = 2131361943; @@ -3739,17 +3748,17 @@ namespace MusicApp // aapt resource value: 0x7f0a00d6 public const int recycler = 2131362006; - // aapt resource value: 0x7f0a0132 - public const int refine = 2131362098; + // aapt resource value: 0x7f0a0134 + public const int refine = 2131362100; - // aapt resource value: 0x7f0a013e - public const int rename = 2131362110; + // aapt resource value: 0x7f0a0140 + public const int rename = 2131362112; - // aapt resource value: 0x7f0a012c - public const int reorder = 2131362092; + // aapt resource value: 0x7f0a012f + public const int reorder = 2131362095; - // aapt resource value: 0x7f0a0141 - public const int repeat = 2131362113; + // aapt resource value: 0x7f0a0143 + public const int repeat = 2131362115; // aapt resource value: 0x7f0a0065 public const int right = 2131361893; @@ -3787,11 +3796,11 @@ namespace MusicApp // aapt resource value: 0x7f0a0070 public const int scrollable = 2131361904; - // aapt resource value: 0x7f0a011f - public const int search = 2131362079; + // aapt resource value: 0x7f0a0122 + public const int search = 2131362082; - // aapt resource value: 0x7f0a0120 - public const int searchSuggestions = 2131362080; + // aapt resource value: 0x7f0a0123 + public const int searchSuggestions = 2131362083; // aapt resource value: 0x7f0a00a2 public const int search_badge = 2131361954; @@ -3823,17 +3832,17 @@ namespace MusicApp // aapt resource value: 0x7f0a00ab public const int search_voice_btn = 2131361963; - // aapt resource value: 0x7f0a0113 - public const int seekbar = 2131362067; + // aapt resource value: 0x7f0a0116 + public const int seekbar = 2131362070; - // aapt resource value: 0x7f0a0114 - public const int seekbar_value = 2131362068; + // aapt resource value: 0x7f0a0117 + public const int seekbar_value = 2131362071; // aapt resource value: 0x7f0a00ac public const int select_dialog_listview = 2131361964; - // aapt resource value: 0x7f0a0143 - public const int settings = 2131362115; + // aapt resource value: 0x7f0a0145 + public const int settings = 2131362117; // aapt resource value: 0x7f0a0096 public const int shortcut = 2131361942; @@ -3850,8 +3859,8 @@ namespace MusicApp // aapt resource value: 0x7f0a0041 public const int showTitle = 2131361857; - // aapt resource value: 0x7f0a0140 - public const int shuffle = 2131362112; + // aapt resource value: 0x7f0a0142 + public const int shuffle = 2131362114; // aapt resource value: 0x7f0a00b5 public const int smallLabel = 2131361973; @@ -3877,35 +3886,35 @@ namespace MusicApp // aapt resource value: 0x7f0a0107 public const int songTimer = 2131362055; - // aapt resource value: 0x7f0a0125 - public const int spArt = 2131362085; - - // aapt resource value: 0x7f0a0127 - public const int spArtist = 2131362087; - - // aapt resource value: 0x7f0a0124 - public const int spContainer = 2131362084; + // aapt resource value: 0x7f0a0128 + public const int spArt = 2131362088; // aapt resource value: 0x7f0a012a - public const int spLast = 2131362090; + public const int spArtist = 2131362090; - // aapt resource value: 0x7f0a0128 - public const int spNext = 2131362088; + // aapt resource value: 0x7f0a0127 + public const int spContainer = 2131362087; - // aapt resource value: 0x7f0a0129 - public const int spPlay = 2131362089; + // aapt resource value: 0x7f0a012d + public const int spLast = 2131362093; // aapt resource value: 0x7f0a012b - public const int spProgress = 2131362091; + public const int spNext = 2131362091; - // aapt resource value: 0x7f0a0126 - public const int spTitle = 2131362086; + // aapt resource value: 0x7f0a012c + public const int spPlay = 2131362092; + + // aapt resource value: 0x7f0a012e + public const int spProgress = 2131362094; + + // aapt resource value: 0x7f0a0129 + public const int spTitle = 2131362089; // aapt resource value: 0x7f0a0086 public const int spacer = 2131361926; - // aapt resource value: 0x7f0a0111 - public const int spinner = 2131362065; + // aapt resource value: 0x7f0a0114 + public const int spinner = 2131362068; // aapt resource value: 0x7f0a0008 public const int split_action_bar = 2131361800; @@ -3925,8 +3934,8 @@ namespace MusicApp // aapt resource value: 0x7f0a0066 public const int start = 2131361894; - // aapt resource value: 0x7f0a012d - public const int status = 2131362093; + // aapt resource value: 0x7f0a0130 + public const int status = 2131362096; // aapt resource value: 0x7f0a00e8 public const int status_bar_latest_event_content = 2131362024; @@ -3940,8 +3949,8 @@ namespace MusicApp // aapt resource value: 0x7f0a007a public const int surface_view = 2131361914; - // aapt resource value: 0x7f0a0115 - public const int switchWidget = 2131362069; + // aapt resource value: 0x7f0a0118 + public const int switchWidget = 2131362072; // aapt resource value: 0x7f0a003c public const int tabMode = 2131361852; @@ -4021,8 +4030,8 @@ namespace MusicApp // aapt resource value: 0x7f0a0013 public const int transition_transform = 2131361811; - // aapt resource value: 0x7f0a013c - public const int undoChange = 2131362108; + // aapt resource value: 0x7f0a013e + public const int undoChange = 2131362110; // aapt resource value: 0x7f0a0049 public const int uniform = 2131361865; @@ -4039,8 +4048,8 @@ namespace MusicApp // aapt resource value: 0x7f0a0016 public const int view_offset_helper = 2131361814; - // aapt resource value: 0x7f0a0136 - public const int visible = 2131362102; + // aapt resource value: 0x7f0a0138 + public const int visible = 2131362104; // aapt resource value: 0x7f0a0036 public const int wide = 2131361846; @@ -4051,11 +4060,11 @@ namespace MusicApp // aapt resource value: 0x7f0a004a public const int wrap_content = 2131361866; - // aapt resource value: 0x7f0a012e - public const int youtubeIcon = 2131362094; + // aapt resource value: 0x7f0a0131 + public const int youtubeIcon = 2131362097; - // aapt resource value: 0x7f0a011c - public const int ytPlay = 2131362076; + // aapt resource value: 0x7f0a011f + public const int ytPlay = 2131362079; // aapt resource value: 0x7f0a00d5 public const int ytProgress = 2131362005; @@ -4390,109 +4399,112 @@ namespace MusicApp public const int PlaylistSmallHeader = 2130903128; // aapt resource value: 0x7f030059 - public const int preference = 2130903129; + public const int PlaylistSong = 2130903129; // aapt resource value: 0x7f03005a - public const int preference_category = 2130903130; + public const int preference = 2130903130; // aapt resource value: 0x7f03005b - public const int preference_dialog_edittext = 2130903131; + public const int preference_category = 2130903131; // aapt resource value: 0x7f03005c - public const int preference_dropdown = 2130903132; + public const int preference_dialog_edittext = 2130903132; // aapt resource value: 0x7f03005d - public const int preference_information = 2130903133; + public const int preference_dropdown = 2130903133; // aapt resource value: 0x7f03005e - public const int preference_list_fragment = 2130903134; + public const int preference_information = 2130903134; // aapt resource value: 0x7f03005f - public const int preference_recyclerview = 2130903135; + public const int preference_list_fragment = 2130903135; // aapt resource value: 0x7f030060 - public const int preference_widget_checkbox = 2130903136; + public const int preference_recyclerview = 2130903136; // aapt resource value: 0x7f030061 - public const int preference_widget_seekbar = 2130903137; + public const int preference_widget_checkbox = 2130903137; // aapt resource value: 0x7f030062 - public const int preference_widget_switch_compat = 2130903138; + public const int preference_widget_seekbar = 2130903138; // aapt resource value: 0x7f030063 - public const int PreferenceContent = 2130903139; + public const int preference_widget_switch_compat = 2130903139; // aapt resource value: 0x7f030064 - public const int Preferences = 2130903140; + public const int PreferenceContent = 2130903140; // aapt resource value: 0x7f030065 - public const int PreferenceToolbar = 2130903141; + public const int Preferences = 2130903141; // aapt resource value: 0x7f030066 - public const int QueueFooter = 2130903142; + public const int PreferenceToolbar = 2130903142; // aapt resource value: 0x7f030067 - public const int QuickPlayLayout = 2130903143; + public const int QueueFooter = 2130903143; // aapt resource value: 0x7f030068 - public const int RecyclerFragment = 2130903144; + public const int QuickPlayLayout = 2130903144; // aapt resource value: 0x7f030069 - public const int SaveAPlaylist = 2130903145; + public const int RecyclerFragment = 2130903145; // aapt resource value: 0x7f03006a - public const int search_layout = 2130903146; + public const int SaveAPlaylist = 2130903146; // aapt resource value: 0x7f03006b - public const int SearchLayout = 2130903147; + public const int search_layout = 2130903147; // aapt resource value: 0x7f03006c - public const int SeekbarPreference = 2130903148; + public const int SearchLayout = 2130903148; // aapt resource value: 0x7f03006d - public const int select_dialog_item_material = 2130903149; + public const int SeekbarPreference = 2130903149; // aapt resource value: 0x7f03006e - public const int select_dialog_multichoice_material = 2130903150; + public const int select_dialog_item_material = 2130903150; // aapt resource value: 0x7f03006f - public const int select_dialog_singlechoice_material = 2130903151; + public const int select_dialog_multichoice_material = 2130903151; // aapt resource value: 0x7f030070 - public const int smallLoading = 2130903152; + public const int select_dialog_singlechoice_material = 2130903152; // aapt resource value: 0x7f030071 - public const int SmallPlayer = 2130903153; + public const int smallLoading = 2130903153; // aapt resource value: 0x7f030072 - public const int SongList = 2130903154; + public const int SmallPlayer = 2130903154; // aapt resource value: 0x7f030073 - public const int SquareSong = 2130903155; + public const int SongList = 2130903155; // aapt resource value: 0x7f030074 - public const int SuggestionLayout = 2130903156; + public const int SquareSong = 2130903156; // aapt resource value: 0x7f030075 - public const int support_simple_spinner_dropdown_item = 2130903157; + public const int SuggestionLayout = 2130903157; // aapt resource value: 0x7f030076 - public const int tabs = 2130903158; + public const int support_simple_spinner_dropdown_item = 2130903158; // aapt resource value: 0x7f030077 - public const int TimerLayout = 2130903159; + public const int tabs = 2130903159; // aapt resource value: 0x7f030078 - public const int tooltip = 2130903160; + public const int TimerLayout = 2130903160; // aapt resource value: 0x7f030079 - public const int TwoLineLayout = 2130903161; + public const int tooltip = 2130903161; // aapt resource value: 0x7f03007a - public const int ViewPager = 2130903162; + public const int TwoLineLayout = 2130903162; // aapt resource value: 0x7f03007b - public const int YtList = 2130903163; + public const int ViewPager = 2130903163; + + // aapt resource value: 0x7f03007c + public const int YtList = 2130903164; static Layout() { diff --git a/MusicApp/Resources/drawable/Delete.xml b/MusicApp/Resources/drawable/Delete.xml new file mode 100644 index 0000000..8a028ed --- /dev/null +++ b/MusicApp/Resources/drawable/Delete.xml @@ -0,0 +1,11 @@ + + + + \ No newline at end of file diff --git a/MusicApp/Resources/layout/PlaylistSong.xml b/MusicApp/Resources/layout/PlaylistSong.xml new file mode 100644 index 0000000..fbb24d1 --- /dev/null +++ b/MusicApp/Resources/layout/PlaylistSong.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + \ No newline at end of file