Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/app/ui-tests-app/button/button-border.css
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Button {
}

#s10 {
border-width: 5 0; border-color: black;
border-width: 5 0; border-color: black; background-color: white;
}

#s11 {
Expand Down
8 changes: 4 additions & 4 deletions apps/app/ui-tests-app/css/pixels.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
<Label text="pixels" />
<StackLayout borderWidth="1px" borderColor="black" horizontalAlignment="left" verticalAlignment="top" orientation="horizontal" padding="1px">
<Label text="Label" borderWidth="1px" borderRadius="10px" borderColor="green" padding="1px" margin="1px" />
<Button text="Button" borderWidth="1px" borderRadius="10px" borderColor="green" padding="1px" margin="1px" />
<Button text="Button" borderWidth="1px" borderRadius="10px" borderColor="green" padding="1px" margin="1px" backgroundColor="orange" />
<TextView text="Text View" borderWidth="1px" borderRadius="10px" borderColor="green" padding="1px" margin="1px" />
<TextField text="Text Field" borderWidth="1px" borderRadius="10px" borderColor="green" padding="1px" margin="1px" />
<Image src="~/ui-tests-app/resources/images/gravatar.png" borderWidth="1px" borderRadius="10px" borderColor="green" padding="1px" margin="1px" />
</StackLayout>

<StackLayout borderWidth="2px" borderColor="green" orientation="horizontal" padding="2px">
<Label text="Label" borderWidth="5px" borderRadius="10px" borderColor="black" padding="5px" margin="5px" />
<Button text="Button" borderWidth="4px" borderRadius="10px" borderColor="black" padding="4px" margin="4px" />
<Button text="Button" borderWidth="4px" borderRadius="10px" borderColor="black" padding="4px" margin="4px" backgroundColor="orange" />
<TextView text="Text View" borderWidth="3px" borderRadius="10px" borderColor="black" padding="3px" margin="3px" />
<TextField text="Text Field" borderWidth="2px" borderRadius="10px" borderColor="black" padding="2px" margin="2px" />
</StackLayout>
Expand All @@ -32,15 +32,15 @@
<Label text="device independent pixels" />
<StackLayout borderWidth="1" borderColor="black" horizontalAlignment="left" verticalAlignment="top" orientation="horizontal" padding="1">
<Label text="Label" borderWidth="1" borderRadius="10" borderColor="green" padding="1" margin="1" />
<Button text="Button" borderWidth="1" borderRadius="10" borderColor="green" padding="1" margin="1" />
<Button text="Button" borderWidth="1" borderRadius="10" borderColor="green" padding="1" margin="1" backgroundColor="orange" />
<TextView text="Text View" borderWidth="1" borderRadius="10" borderColor="green" padding="1" margin="1" />
<TextField text="Text Field" borderWidth="1" borderRadius="10" borderColor="green" padding="1" margin="1" />
<Image src="~/ui-tests-app/resources/images/gravatar.png" borderWidth="1" borderRadius="10" borderColor="green" padding="1" margin="1" />
</StackLayout>

<StackLayout borderWidth="2" borderColor="green" orientation="horizontal" padding="2">
<Label text="Label" borderWidth="5" borderRadius="10" borderColor="black" padding="5" margin="5" />
<Button text="Button" borderWidth="4" borderRadius="10" borderColor="black" padding="4" margin="4" />
<Button text="Button" borderWidth="4" borderRadius="10" borderColor="black" padding="4" margin="4" backgroundColor="orange" />
<TextView text="Text View" borderWidth="3" borderRadius="10" borderColor="black" padding="3" margin="3" />
<TextField text="Text Field" borderWidth="2" borderRadius="10" borderColor="black" padding="2" margin="2" />
</StackLayout>
Expand Down
1 change: 1 addition & 0 deletions apps/app/ui-tests-app/flexbox/flexbox.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
.control Button {
border-width: 1 1 0 0;
border-color: gray;
background-color: white;
font-size: 9;
padding: 0;
height: 0;
Expand Down
5 changes: 4 additions & 1 deletion apps/app/ui-tests-app/issues/issue-3113.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
#button1 {
border-color: rgba(0, 0, 0, 0);
border-color: transparent;
border-width: 3;
background-color: white;
}

#button2 {
border-color: rgba(0, 0, 0, 0.5);
border-width: 3;
background-color: white;
}

#button3 {
border-width: 3;
background-color: white;
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import android.graphics.Color;
import android.graphics.LinearGradient;
import android.graphics.Matrix;
import android.graphics.Outline;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PointF;
Expand All @@ -16,6 +17,7 @@
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.Shader;
import android.support.annotation.NonNull;

import org.nativescript.widgets.image.BitmapOwner;
import org.nativescript.widgets.image.Fetcher;
Expand Down Expand Up @@ -804,6 +806,23 @@ public Drawable getDrawable() {
return drawable;
}

@Override
public void getOutline(@NonNull Outline outline) {
if (android.os.Build.VERSION.SDK_INT >= 21) {
Path backgroundPath = new Path();
float[] backgroundRadii = {
Math.max(0, borderTopLeftRadius), Math.max(0, borderTopLeftRadius),
Math.max(0, borderTopRightRadius), Math.max(0, borderTopRightRadius),
Math.max(0, borderBottomRightRadius), Math.max(0, borderBottomRightRadius),
Math.max(0, borderBottomLeftRadius), Math.max(0, borderBottomLeftRadius)
};
backgroundPath.addRoundRect(new RectF(getBounds()), backgroundRadii, Path.Direction.CW);
outline.setConvexPath(backgroundPath);
} else {
throw new IllegalStateException("Method supported on API 21 or higher");
}
}

private class BackgroundDrawParams {
private boolean repeatX = true;
private boolean repeatY = true;
Expand Down