Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
Removed unnecessary ApiLevel variable in BrushExtensions
Browse files Browse the repository at this point in the history
  • Loading branch information
jsuarezruiz committed Oct 28, 2020
1 parent 6732903 commit e3d2993
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 21 deletions.
5 changes: 1 addition & 4 deletions Xamarin.Forms.Material.Android/MaterialFrameRenderer.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@

using System;
using System;
using System.ComponentModel;
using Android.Content;
using Android.Graphics.Drawables;
using Android.Views;
using AndroidX.Core.View;
using Xamarin.Forms.Platform.Android;
using Xamarin.Forms.Platform.Android.FastRenderers;
using Xamarin.Forms.Platform.Android;
using Android.Graphics.Drawables;
using Android.Graphics.Drawables.Shapes;
using AView = Android.Views.View;
using MaterialCardView = Google.Android.Material.Card.MaterialCardView;
Expand Down
16 changes: 2 additions & 14 deletions Xamarin.Forms.Platform.Android/Extensions/BrushExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@ namespace Xamarin.Forms.Platform.Android
{
public static class BrushExtensions
{
static readonly int ApiLevel;

static BrushExtensions()
{
ApiLevel = (int)Forms.SdkInt;
}

public static void UpdateBackground(this AView view, Brush brush)
{
if (view == null)
Expand Down Expand Up @@ -191,13 +184,8 @@ public static bool UseGradients(this GradientDrawable gradientDrawable)
if (!Forms.IsNougatOrNewer)
return false;

if (ApiLevel >= 24)
{
var colors = gradientDrawable.GetColors();
return colors != null && colors.Length > 1;
}

return false;
var colors = gradientDrawable.GetColors();
return colors != null && colors.Length > 1;
}

public static bool UseGradients(this GradientStrokeDrawable gradientDrawable)
Expand Down
3 changes: 0 additions & 3 deletions Xamarin.Forms.Platform.Android/FastRenderers/FrameRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@
using System.ComponentModel;
using Android.Content;
using Android.Graphics;
using Android.Graphics.Drawables;
using Android.Graphics.Drawables.Shapes;
using Android.Views;
using AndroidX.Core.View;
using AndroidX.CardView.Widget;
using AndroidX.CardView.Widget;
using AndroidX.Core.View;
using AColor = Android.Graphics.Color;
using AView = Android.Views.View;

Expand Down

0 comments on commit e3d2993

Please sign in to comment.