Solvings some bugs and adding screenshots

This commit is contained in:
Anonymous Raccoon
2018-05-25 22:44:15 +02:00
parent 1efd5d4e4f
commit cead3364ea
11 changed files with 48 additions and 14 deletions

View File

@@ -766,11 +766,14 @@ namespace MusicApp
else
FolderBrowse.instance.ListView.SmoothScrollToPosition(0);
}
foreach(YoutubeEngine instance in YoutubeEngine.instances)
if(YoutubeEngine.instances != null)
{
if (instance.focused)
foreach (YoutubeEngine instance in YoutubeEngine.instances)
{
instance.ListView.SmoothScrollToPosition(0);
if (instance.focused)
{
instance.ListView.SmoothScrollToPosition(0);
}
}
}
}

View File

@@ -125,7 +125,6 @@ namespace MusicApp.Resources.Portable_Class
listPadding = MainActivity.paddingBot - MainActivity.defaultPaddingBot
};
ListAdapter = adapter;
ListView.TextFilterEnabled = true;
ListView.ItemClick += ListView_ItemClick;
ListView.ItemLongClick += ListView_ItemLongClick;
@@ -458,7 +457,7 @@ namespace MusicApp.Resources.Portable_Class
public override void OnResume()
{
base.OnResume();
if (MainActivity.parcelable != null)
if (MainActivity.parcelable != null && MainActivity.parcelableSender == "FolderBrowse")
{
ListView.OnRestoreInstanceState(MainActivity.parcelable);
MainActivity.parcelable = null;

View File

@@ -250,9 +250,26 @@ namespace MusicApp.Resources.Portable_Class
if(addToQueue)
AddToQueue(song);
Player.instance?.UpdateNext();
Player.instance?.RefreshPlayer();
ParseNextSong();
CoordinatorLayout smallPlayer = MainActivity.instance.FindViewById<CoordinatorLayout>(Resource.Id.smallPlayer);
smallPlayer.FindViewById<TextView>(Resource.Id.spTitle).Text = song.GetName();
smallPlayer.FindViewById<TextView>(Resource.Id.spArtist).Text = song.GetArtist();
smallPlayer.FindViewById<ImageView>(Resource.Id.spPlay).SetImageResource(Resource.Drawable.ic_pause_black_24dp);
ImageView art = smallPlayer.FindViewById<ImageView>(Resource.Id.spArt);
if (!song.IsYt)
{
var songCover = Uri.Parse("content://media/external/audio/albumart");
var nextAlbumArtUri = ContentUris.WithAppendedId(songCover, song.GetAlbumArt());
Picasso.With(Application.Context).Load(nextAlbumArtUri).Placeholder(Resource.Drawable.MusicIcon).Resize(400, 400).CenterCrop().Into(art);
}
else
{
Picasso.With(Application.Context).Load(song.GetAlbum()).Placeholder(Resource.Drawable.MusicIcon).Resize(400, 400).CenterCrop().Into(art);
}
}
public void Play(Song song, bool addToQueue = true, long progress = -1)
@@ -328,9 +345,26 @@ namespace MusicApp.Resources.Portable_Class
Player.instance.playerView.FindViewById<ImageButton>(Resource.Id.playButton).SetImageResource(Resource.Drawable.ic_pause_black_24dp);
}
Player.instance?.UpdateNext();
Player.instance?.RefreshPlayer();
ParseNextSong();
CoordinatorLayout smallPlayer = MainActivity.instance.FindViewById<CoordinatorLayout>(Resource.Id.smallPlayer);
smallPlayer.FindViewById<TextView>(Resource.Id.spTitle).Text = song.GetName();
smallPlayer.FindViewById<TextView>(Resource.Id.spArtist).Text = song.GetArtist();
smallPlayer.FindViewById<ImageView>(Resource.Id.spPlay).SetImageResource(Resource.Drawable.ic_pause_black_24dp);
ImageView art = smallPlayer.FindViewById<ImageView>(Resource.Id.spArt);
if (!song.IsYt)
{
var songCover = Uri.Parse("content://media/external/audio/albumart");
var nextAlbumArtUri = ContentUris.WithAppendedId(songCover, song.GetAlbumArt());
Picasso.With(Application.Context).Load(nextAlbumArtUri).Placeholder(Resource.Drawable.MusicIcon).Resize(400, 400).CenterCrop().Into(art);
}
else
{
Picasso.With(Application.Context).Load(song.GetAlbum()).Placeholder(Resource.Drawable.MusicIcon).Resize(400, 400).CenterCrop().Into(art);
}
}
public async void RandomPlay(List<string> filePath, bool clearQueue)
@@ -797,7 +831,8 @@ namespace MusicApp.Resources.Portable_Class
private void SleepPause()
{
Pause();
//Pause();
Stop();
}
public static void Swap(int fromPosition, int toPosition)
@@ -805,6 +840,7 @@ namespace MusicApp.Resources.Portable_Class
queue[fromPosition].queueSlot = fromPosition;
for(int i = 0; i < queue.Count; i++)
{
Console.WriteLine("&CurrentID = " + CurrentID() + " item id = " + queue[i].queueSlot + " i = " + i + "Item name = " + queue[i].GetName());
if (CurrentID() == queue[i].queueSlot)
currentID = i;

View File

@@ -182,16 +182,12 @@ namespace MusicApp.Resources.Portable_Class
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);

BIN
Screenshots/Browse.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 401 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 KiB

BIN
Screenshots/Player.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 777 KiB

BIN
Screenshots/Playlists.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

BIN
Screenshots/Queue.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 KiB

BIN
Screenshots/Settings.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 KiB