Merge pull request #3130 from NativeScript/issue-3113

Fix: Transparent border rendered as black
This commit is contained in:
Rossen Hristov
2016-11-21 13:08:27 +02:00
committed by GitHub
7 changed files with 49 additions and 28 deletions

View File

@ -0,0 +1,13 @@
#button1 {
border-color: rgba(0, 0, 0, 0);
border-width: 3;
}
#button2 {
border-color: rgba(0, 0, 0, 0.5);
border-width: 3;
}
#button3 {
border-width: 3;
}

View File

@ -0,0 +1,7 @@
<Page xmlns="http://schemas.nativescript.org/tns.xsd">
<StackLayout>
<Button id="button1" text="transparent"/>
<Button id="button2" text="semi-transparent"/>
<Button id="button3" text="no-color"/>
</StackLayout>
</Page>

View File

@ -16,6 +16,7 @@ export function pageLoaded(args: EventData) {
examples.set("2942", "issues/issue-2942");
examples.set("3007", "issues/issue-3007");
examples.set("2661", "issues/issue-2661");
examples.set("3113", "issues/issue-3113");
let viewModel = new SubMainPageViewModel(wrapLayout, examples);
page.bindingContext = viewModel;

View File

@ -6,14 +6,14 @@
"nativescript": {
"id": "org.nativescript.apps",
"tns-ios": {
"version": "2.3.0"
"version": "2.4.0"
},
"tns-android": {
"version": "2.3.0"
"version": "2.4.0"
}
},
"dependencies": {
"tns-core-modules": "2.1.0"
"tns-core-modules": "2.4.0"
},
"devDependencies": {
"tns-platform-declarations": "*",

View File

@ -306,27 +306,27 @@ export class TabViewTest extends testModule.UITest<tabViewModule.TabView> {
// TKUnit.assertTrue(viewsWithoutParent > viewsWithParent, `Most of the views should be recycled: viewsWithoutParent = ${viewsWithoutParent}; viewsWithParent = ${viewsWithParent};`);
// }
public testAndroidOffscreenTabLimit_KeepAllAlive = function () {
let tabView = this.testView;
if (!tabView.android){
return;
}
// public testAndroidOffscreenTabLimit_KeepAllAlive = function () {
// let tabView = this.testView;
// if (!tabView.android){
// return;
// }
tabView.androidOffscreenTabLimit = 20;
// tabView.androidOffscreenTabLimit = 20;
tabView.items = this._createItems(20);
this.waitUntilTestElementIsLoaded();
for (let index = 0, length = tabView.items.length; index < length; index++){
tabViewTestsNative.selectNativeTab(tabView, index);
TKUnit.waitUntilReady(function () {
return tabView.selectedIndex === index;
}, helper.ASYNC);
}
// tabView.items = this._createItems(20);
// this.waitUntilTestElementIsLoaded();
// for (let index = 0, length = tabView.items.length; index < length; index++){
// tabViewTestsNative.selectNativeTab(tabView, index);
// TKUnit.waitUntilReady(function () {
// return tabView.selectedIndex === index;
// }, helper.ASYNC);
// }
for (let i = 0, length = tabView.items.length; i < length; i++){
TKUnit.assertNotNull(tabView.items[i].view.parent, `tabView.items[${i}].view should have a parent!`);
}
}
// for (let i = 0, length = tabView.items.length; i < length; i++){
// TKUnit.assertNotNull(tabView.items[i].view.parent, `tabView.items[${i}].view should have a parent!`);
// }
// }
/*
public testBindingIsRefreshedWhenTabViewItemIsUnselectedAndThenSelectedAgain() {

View File

@ -6,14 +6,14 @@
"nativescript": {
"id": "org.nativescript.tests",
"tns-ios": {
"version": "2.3.0"
"version": "2.4.0"
},
"tns-android": {
"version": "2.3.0"
"version": "2.4.0"
}
},
"dependencies": {
"tns-core-modules": "2.3.0"
"tns-core-modules": "2.4.0"
},
"devDependencies": {
"tns-platform-declarations": "*",

View File

@ -154,10 +154,10 @@ function refreshBorderDrawable(view: view.View, borderDrawable: org.nativescript
borderDrawable.refresh(
(background.borderTopColor && background.borderTopColor.android) ? background.borderTopColor.android : 0,
(background.borderRightColor && background.borderRightColor.android) ? background.borderRightColor.android : 0,
(background.borderBottomColor && background.borderBottomColor.android) ? background.borderBottomColor.android : 0,
(background.borderLeftColor && background.borderLeftColor.android) ? background.borderLeftColor.android : 0,
(!types.isNullOrUndefined(background.borderTopColor) && !types.isNullOrUndefined(background.borderTopColor.android)) ? background.borderTopColor.android : android.graphics.Color.BLACK,
(!types.isNullOrUndefined(background.borderRightColor) && !types.isNullOrUndefined(background.borderRightColor.android)) ? background.borderRightColor.android : android.graphics.Color.BLACK,
(!types.isNullOrUndefined(background.borderBottomColor) && !types.isNullOrUndefined(background.borderBottomColor.android)) ? background.borderBottomColor.android : android.graphics.Color.BLACK,
(!types.isNullOrUndefined(background.borderLeftColor) && !types.isNullOrUndefined(background.borderLeftColor.android)) ? background.borderLeftColor.android : android.graphics.Color.BLACK,
background.borderTopWidth,
background.borderRightWidth,