Adding a try catch block and debug messages for the blurred bitmap creation for the queue background.

This commit is contained in:
Anonymus Raccoon
2019-06-28 21:29:42 +02:00
parent 6133c8f394
commit 03195bb734

View File

@@ -159,7 +159,7 @@ namespace Opus
{
drawable = Picasso.With(Application.Context).Load(current.Album).Error(Resource.Drawable.noAlbum).Placeholder(Resource.Drawable.noAlbum).Transform(new RemoveBlackBorder(true)).Get();
}
catch (Exception)
catch
{
drawable = Picasso.With(Application.Context).Load(Resource.Drawable.noAlbum).Get();
}
@@ -176,7 +176,7 @@ namespace Opus
{
drawable = Picasso.With(Application.Context).Load(iconURI).Error(Resource.Drawable.noAlbum).Placeholder(Resource.Drawable.noAlbum).NetworkPolicy(NetworkPolicy.Offline).Get();
}
catch (Exception)
catch
{
drawable = Picasso.With(Application.Context).Load(Resource.Drawable.noAlbum).Get();
}
@@ -187,6 +187,8 @@ namespace Opus
Palette.From(drawable).MaximumColorCount(28).Generate(this);
if (albumArt.Width > 0)
{
try
{
//The width of the view in pixel (we'll multiply this by 0.75f because the drawer has a width of 75%)
int width = (int)(albumArt.Width * (float)drawable.Height / albumArt.Height);
@@ -207,6 +209,12 @@ namespace Opus
output.CopyTo(blured);
MainActivity.instance.FindViewById<ImageView>(Resource.Id.queueBackground).SetImageBitmap(blured);
Console.WriteLine("&Bitmap set to image view");
}
catch (Exception ex)
{
Console.WriteLine("&Queue background error: " + ex.Message);
}
}
if (bar != null)