mirror of
https://github.com/zoriya/Opus.git
synced 2025-12-06 06:26:15 +00:00
Solving a bug in the playlist screen for older versions of android.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using Android.App;
|
||||
using Android.Content.Res;
|
||||
using Android.Graphics;
|
||||
using Android.OS;
|
||||
using Android.Support.V7.Widget;
|
||||
using Android.Text;
|
||||
using Android.Util;
|
||||
@@ -80,7 +81,13 @@ namespace Opus.Adapter
|
||||
else if (position < LocalPlaylists.Count && LocalPlaylists[position].Name == "Error" && LocalPlaylists[position].LocalID == -1)
|
||||
{
|
||||
EmptyHolder holder = (EmptyHolder)viewHolder;
|
||||
holder.text.TextFormatted = Html.FromHtml(LocalPlaylists[position].Owner, FromHtmlOptions.OptionUseCssColors);
|
||||
|
||||
if(Build.VERSION.SdkInt >= BuildVersionCodes.N)
|
||||
holder.text.TextFormatted = Html.FromHtml(LocalPlaylists[position].Owner, FromHtmlOptions.OptionUseCssColors);
|
||||
else
|
||||
#pragma warning disable CS0618 // Type or member is obsolete
|
||||
holder.text.TextFormatted = Html.FromHtml(LocalPlaylists[position].Owner);
|
||||
#pragma warning restore CS0618 // Type or member is obsolete
|
||||
|
||||
if (!holder.text.HasOnClickListeners)
|
||||
{
|
||||
@@ -93,7 +100,12 @@ namespace Opus.Adapter
|
||||
else if(position >= LocalPlaylists.Count && YoutubePlaylists[position - LocalPlaylists.Count].Name == "Error" && YoutubePlaylists[position - LocalPlaylists.Count].YoutubeID == null)
|
||||
{
|
||||
EmptyHolder holder = (EmptyHolder)viewHolder;
|
||||
holder.text.TextFormatted = Html.FromHtml(YoutubePlaylists[position - LocalPlaylists.Count].Owner, FromHtmlOptions.OptionUseCssColors);
|
||||
if (Build.VERSION.SdkInt >= BuildVersionCodes.N)
|
||||
holder.text.TextFormatted = Html.FromHtml(YoutubePlaylists[position - LocalPlaylists.Count].Owner, FromHtmlOptions.OptionUseCssColors);
|
||||
else
|
||||
#pragma warning disable CS0618 // Type or member is obsolete
|
||||
holder.text.TextFormatted = Html.FromHtml(YoutubePlaylists[position - LocalPlaylists.Count].Owner);
|
||||
#pragma warning restore CS0618 // Type or member is obsolete
|
||||
|
||||
if (!holder.text.HasOnClickListeners)
|
||||
{
|
||||
|
||||
@@ -191,7 +191,11 @@ namespace Opus
|
||||
//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);
|
||||
int dX = (int)((drawable.Width - width) * 0.5f);
|
||||
Console.WriteLine("&Drawable Info: Width: " + drawable.Width + " Height: " + drawable.Height);
|
||||
Console.WriteLine("&AlbumArt Info: Width: " + albumArt.Width + " Height: " + albumArt.Height);
|
||||
Console.WriteLine("&Blur Creation: Width: " + width + " dX: " + dX);
|
||||
Bitmap blured = Bitmap.CreateBitmap(drawable, dX, 0, (int)(width * 0.75f), drawable.Height);
|
||||
Console.WriteLine("&BLured bitmap created");
|
||||
|
||||
RenderScript rs = RenderScript.Create(MainActivity.instance);
|
||||
Allocation input = Allocation.CreateFromBitmap(rs, blured);
|
||||
|
||||
Reference in New Issue
Block a user