diff --git a/android/widgets/src/main/java/org/nativescript/widgets/BorderDrawable.java b/android/widgets/src/main/java/org/nativescript/widgets/BorderDrawable.java index 3608a195d..4ee7b122c 100644 --- a/android/widgets/src/main/java/org/nativescript/widgets/BorderDrawable.java +++ b/android/widgets/src/main/java/org/nativescript/widgets/BorderDrawable.java @@ -6,7 +6,6 @@ import android.graphics.Bitmap; import android.graphics.BitmapShader; import android.graphics.Canvas; import android.graphics.Color; -import android.graphics.LinearGradient; import android.graphics.Matrix; import android.graphics.Paint; import android.graphics.Path; @@ -50,7 +49,6 @@ public class BorderDrawable extends ColorDrawable implements BitmapOwner { private int backgroundColor; private String backgroundImage; private Bitmap backgroundBitmap; - private LinearGradientDefinition backgroundGradient; private String backgroundRepeat; private String backgroundPosition; private CSSValue[] backgroundPositionParsedCSSValues; @@ -151,8 +149,6 @@ public class BorderDrawable extends ColorDrawable implements BitmapOwner { return backgroundBitmap; } - public LinearGradientDefinition getBackgroundGradient() { return backgroundGradient; } - public String getBackgroundRepeat() { return backgroundRepeat; } @@ -227,7 +223,6 @@ public class BorderDrawable extends ColorDrawable implements BitmapOwner { int backgroundColor, String backgroundImageUri, Bitmap backgroundBitmap, - LinearGradientDefinition backgroundGradient, Context context, String backgroundRepeat, String backgroundPosition, @@ -255,7 +250,6 @@ public class BorderDrawable extends ColorDrawable implements BitmapOwner { this.backgroundColor = backgroundColor; this.backgroundImage = backgroundImageUri; this.backgroundBitmap = backgroundBitmap; - this.backgroundGradient = backgroundGradient; this.backgroundRepeat = backgroundRepeat; this.backgroundPosition = backgroundPosition; this.backgroundPositionParsedCSSValues = backgroundPositionParsedCSSValues; @@ -367,24 +361,6 @@ public class BorderDrawable extends ColorDrawable implements BitmapOwner { } } - if (this.backgroundGradient != null) { - LinearGradientDefinition def = this.backgroundGradient; - Paint backgroundGradientPaint = new Paint(); - LinearGradient shader = new LinearGradient( - def.getStartX() * width, def.getStartY() * height, - def.getEndX() * width, def.getEndY() * height, - def.getColors(), def.getStops(), Shader.TileMode.MIRROR); - backgroundGradientPaint.setAntiAlias(true); - backgroundGradientPaint.setFilterBitmap(true); - backgroundGradientPaint.setShader(shader); - - if (this.clipPath != null && !this.clipPath.isEmpty()) { - drawClipPath(this.clipPath, canvas, backgroundGradientPaint, backgroundBoundsF, this.density); - } else { - canvas.drawPath(backgroundPath, backgroundGradientPaint); - } - } - // draw border if (this.clipPath != null && !this.clipPath.isEmpty()) { float borderWidth = this.getUniformBorderWidth(); @@ -410,7 +386,7 @@ public class BorderDrawable extends ColorDrawable implements BitmapOwner { float[] borderOuterRadii = { borderTopLeftRadius, borderTopLeftRadius, borderTopRightRadius, borderTopRightRadius, - borderBottomRightRadius, borderBottomRightRadius, + borderBottomRightRadius, borderBottomRightRadius, borderBottomLeftRadius, borderBottomLeftRadius }; borderPath.addRoundRect(borderOuterRect, borderOuterRadii, Path.Direction.CW); diff --git a/android/widgets/src/main/java/org/nativescript/widgets/LinearGradientDefinition.java b/android/widgets/src/main/java/org/nativescript/widgets/LinearGradientDefinition.java deleted file mode 100644 index 46d818680..000000000 --- a/android/widgets/src/main/java/org/nativescript/widgets/LinearGradientDefinition.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.nativescript.widgets; - -/** - * Created by Vultix on 3/12/2018. - */ -public class LinearGradientDefinition { - private float startX; - private float startY; - private float endX; - private float endY; - private int[] colors; - private float[] stops; - - public float getStartX() { return startX; } - public float getStartY() { return startY; } - public float getEndX() { return endX; } - public float getEndY() { return endY; } - public int[] getColors() { return colors; } - public float[] getStops() { return stops; } - - public LinearGradientDefinition(float startX, float startY, float endX, float endY, int[] colors, float[] stops) { - this.startX = startX; - this.startY = startY; - this.endX = endX; - this.endY = endY; - this.colors = colors; - this.stops = stops; - } -}