mirror of
https://github.com/zoriya/Opus.git
synced 2026-06-09 00:34:42 +00:00
Solving bugs
This commit is contained in:
@@ -222,8 +222,6 @@ namespace MusicApp.Resources.Portable_Class
|
||||
|
||||
if (song.queueSlot == -1)
|
||||
{
|
||||
song.queueSlot = CurrentID() + 1;
|
||||
|
||||
if (queue.Exists(x => x.queueSlot == CurrentID() + 1) && queue.Find(x => x.queueSlot == CurrentID() + 1) != song)
|
||||
{
|
||||
foreach (Song item in queue)
|
||||
@@ -234,6 +232,8 @@ namespace MusicApp.Resources.Portable_Class
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
song.queueSlot = CurrentID() + 1;
|
||||
}
|
||||
|
||||
Console.WriteLine("&QueueSlot = " + song.queueSlot + "Title = " + song.GetName());
|
||||
@@ -310,8 +310,6 @@ namespace MusicApp.Resources.Portable_Class
|
||||
|
||||
if (song.queueSlot == -1)
|
||||
{
|
||||
song.queueSlot = CurrentID() + 1;
|
||||
|
||||
if (queue.Exists(x => x.queueSlot == CurrentID() + 1) && queue.Find(x => x.queueSlot == CurrentID() + 1) != song)
|
||||
{
|
||||
foreach (Song item in queue)
|
||||
@@ -322,8 +320,9 @@ namespace MusicApp.Resources.Portable_Class
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
song.queueSlot = CurrentID() + 1;
|
||||
}
|
||||
|
||||
currentID = song.queueSlot;
|
||||
|
||||
|
||||
@@ -469,7 +469,7 @@ namespace MusicApp.Resources.Portable_Class
|
||||
Console.WriteLine("&Going to sleep in " + time + ", slected item is the " + checkedItem + " one.");
|
||||
Intent intent = new Intent(this, typeof(Sleeper));
|
||||
intent.PutExtra("time", time);
|
||||
this.StartService(intent);
|
||||
StartService(intent);
|
||||
}
|
||||
|
||||
protected override void OnResume()
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
using Android.Database;
|
||||
using Android.OS;
|
||||
using Android.Provider;
|
||||
using Android.Support.Design.Widget;
|
||||
using Android.Support.V4.App;
|
||||
using Android.Support.V7.App;
|
||||
using Android.Support.V7.Widget;
|
||||
|
||||
@@ -220,43 +220,6 @@ namespace MusicApp.Resources.Portable_Class
|
||||
Activity.FindViewById<RelativeLayout>(Resource.Id.playlistHeader).Visibility = ViewStates.Gone;
|
||||
|
||||
MainActivity.instance.SupportFragmentManager.PopBackStack();
|
||||
|
||||
//if (MainActivity.instance.HomeDetails)
|
||||
//{
|
||||
// Home.instance = null;
|
||||
// MainActivity.instance.Navigate(Resource.Id.musicLayout);
|
||||
// MainActivity.instance.HomeDetails = false;
|
||||
//}
|
||||
//else if (MainActivity.youtubeInstanceSave != null)
|
||||
//{
|
||||
// int selectedTab = 0;
|
||||
// switch (MainActivity.youtubeInstanceSave)
|
||||
// {
|
||||
// case "YoutubeEngine-All":
|
||||
// selectedTab = 0;
|
||||
// break;
|
||||
// case "YoutubeEngine-Tracks":
|
||||
// selectedTab = 1;
|
||||
// break;
|
||||
// case "YoutubeEngine-Playlists":
|
||||
// selectedTab = 2;
|
||||
// break;
|
||||
// case "YoutubeEngine-Channels":
|
||||
// selectedTab = 3;
|
||||
// break;
|
||||
// default:
|
||||
// break;
|
||||
// }
|
||||
// MainActivity.instance.SupportFragmentManager.BeginTransaction().Replace(Resource.Id.contentView, Pager.NewInstance(2, selectedTab)).Commit();
|
||||
// YoutubeEngine.instances[selectedTab].focused = true;
|
||||
// YoutubeEngine.instances[selectedTab].OnFocus();
|
||||
// YoutubeEngine.instances[selectedTab].ResumeListView();
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// MainActivity.instance.Navigate(Resource.Id.playlistLayout);
|
||||
//}
|
||||
|
||||
base.OnDestroy();
|
||||
instance = null;
|
||||
}
|
||||
@@ -295,7 +258,7 @@ namespace MusicApp.Resources.Portable_Class
|
||||
|
||||
if (playlistId != 0)
|
||||
{
|
||||
Uri musicUri = MediaStore.Audio.Playlists.Members.GetContentUri("external", playlistId);
|
||||
Uri musicUri = Playlists.Members.GetContentUri("external", playlistId);
|
||||
|
||||
CursorLoader cursorLoader = new CursorLoader(Android.App.Application.Context, musicUri, null, null, null, null);
|
||||
ICursor musicCursor = (ICursor)cursorLoader.LoadInBackground();
|
||||
@@ -304,17 +267,17 @@ namespace MusicApp.Resources.Portable_Class
|
||||
|
||||
if (musicCursor != null && musicCursor.MoveToFirst())
|
||||
{
|
||||
int titleID = musicCursor.GetColumnIndex(MediaStore.Audio.Media.InterfaceConsts.Title);
|
||||
int artistID = musicCursor.GetColumnIndex(MediaStore.Audio.Media.InterfaceConsts.Artist);
|
||||
int albumID = musicCursor.GetColumnIndex(MediaStore.Audio.Media.InterfaceConsts.Album);
|
||||
int thisID = musicCursor.GetColumnIndex(MediaStore.Audio.Media.InterfaceConsts.Id);
|
||||
int pathID = musicCursor.GetColumnIndex(MediaStore.Audio.Media.InterfaceConsts.Data);
|
||||
int titleID = musicCursor.GetColumnIndex(Media.InterfaceConsts.Title);
|
||||
int artistID = musicCursor.GetColumnIndex(Media.InterfaceConsts.Artist);
|
||||
int albumID = musicCursor.GetColumnIndex(Media.InterfaceConsts.Album);
|
||||
int thisID = musicCursor.GetColumnIndex(Media.InterfaceConsts.Id);
|
||||
int pathID = musicCursor.GetColumnIndex(Media.InterfaceConsts.Data);
|
||||
do
|
||||
{
|
||||
string Artist = musicCursor.GetString(artistID);
|
||||
string Title = musicCursor.GetString(titleID);
|
||||
string Album = musicCursor.GetString(albumID);
|
||||
long AlbumArt = musicCursor.GetLong(musicCursor.GetColumnIndex(MediaStore.Audio.Albums.InterfaceConsts.AlbumId));
|
||||
long AlbumArt = musicCursor.GetLong(musicCursor.GetColumnIndex(Albums.InterfaceConsts.AlbumId));
|
||||
long id = musicCursor.GetLong(thisID);
|
||||
string path = musicCursor.GetString(pathID);
|
||||
|
||||
|
||||
@@ -145,20 +145,20 @@ namespace MusicApp.Resources.Portable_Class
|
||||
else
|
||||
holder.ItemView.SetBackgroundColor(Color.ParseColor("#424242"));
|
||||
|
||||
if (position + 1 == songList.Count)
|
||||
{
|
||||
holder.ItemView.SetPadding((int)(8 * scale + 0.5f), (int)(8 * scale + 0.5f), (int)(8 * scale + 0.5f), listPadding);
|
||||
LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams)holder.more.LayoutParameters;
|
||||
layoutParams.SetMargins(0, 0, 0, listPadding);
|
||||
holder.more.LayoutParameters = layoutParams;
|
||||
}
|
||||
else
|
||||
{
|
||||
holder.ItemView.SetPadding((int)(8 * scale + 0.5f), (int)(8 * scale + 0.5f), (int)(8 * scale + 0.5f), (int)(8 * scale + 0.5f));
|
||||
LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams)holder.more.LayoutParameters;
|
||||
layoutParams.SetMargins(0, 0, 0, 0);
|
||||
holder.more.LayoutParameters = layoutParams;
|
||||
}
|
||||
//if (position + 1 == songList.Count)
|
||||
//{
|
||||
// holder.ItemView.SetPadding((int)(8 * scale + 0.5f), (int)(8 * scale + 0.5f), (int)(8 * scale + 0.5f), listPadding);
|
||||
// LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams)holder.more.LayoutParameters;
|
||||
// layoutParams.SetMargins(0, 0, 0, listPadding);
|
||||
// holder.more.LayoutParameters = layoutParams;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// holder.ItemView.SetPadding((int)(8 * scale + 0.5f), (int)(8 * scale + 0.5f), (int)(8 * scale + 0.5f), (int)(8 * scale + 0.5f));
|
||||
// LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams)holder.more.LayoutParameters;
|
||||
// layoutParams.SetMargins(0, 0, 0, 0);
|
||||
// holder.more.LayoutParameters = layoutParams;
|
||||
//}
|
||||
}
|
||||
|
||||
public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
|
||||
|
||||
@@ -315,23 +315,6 @@ namespace MusicApp.Resources.Portable_Class
|
||||
intent.PutExtra("artist", artist);
|
||||
intent.PutExtra("thumbnailURI", thumbnailURL);
|
||||
Android.App.Application.Context.StartService(intent);
|
||||
|
||||
//if (instance != null)
|
||||
//{
|
||||
// MainActivity.youtubeParcel = instance.ListView.GetLayoutManager().OnSaveInstanceState();
|
||||
// MainActivity.youtubeInstanceSave = "YoutubeEngine" + "-" + instance.querryType;
|
||||
|
||||
// ViewGroup rootView = instance.Activity.FindViewById<ViewGroup>(Android.Resource.Id.Content);
|
||||
// foreach (YoutubeEngine inst in instances)
|
||||
// {
|
||||
// MainActivity.instance.OnPaddingChanged -= inst.OnPaddingChanged;
|
||||
// rootView.RemoveView(inst.emptyView);
|
||||
// }
|
||||
// rootView.RemoveView(loadingView);
|
||||
// instances = null;
|
||||
//}
|
||||
//else
|
||||
// MainActivity.instance.SaveInstance();
|
||||
}
|
||||
|
||||
public static async void PlayFiles(Song[] files)
|
||||
@@ -342,6 +325,7 @@ namespace MusicApp.Resources.Portable_Class
|
||||
if (MusicPlayer.isRunning)
|
||||
MusicPlayer.queue.Clear();
|
||||
|
||||
MusicPlayer.currentID = -1;
|
||||
Play(files[0].GetPath(), files[0].GetName(), files[0].GetArtist(), files[0].GetAlbum());
|
||||
|
||||
if (files.Length < 2)
|
||||
@@ -350,7 +334,6 @@ namespace MusicApp.Resources.Portable_Class
|
||||
while (MusicPlayer.instance == null || MusicPlayer.CurrentID() == -1)
|
||||
await Task.Delay(10);
|
||||
|
||||
MusicPlayer.currentID = -1;
|
||||
foreach (Song song in files)
|
||||
{
|
||||
MusicPlayer.instance.AddToQueue(song);
|
||||
|
||||
Reference in New Issue
Block a user