diff --git a/CrossPlatformModules.csproj b/CrossPlatformModules.csproj
index 0baa7d804..a9ef953d7 100644
--- a/CrossPlatformModules.csproj
+++ b/CrossPlatformModules.csproj
@@ -214,6 +214,9 @@
+
+ background.xml
+
@@ -673,6 +676,7 @@
+
@@ -700,6 +704,7 @@
+
@@ -709,6 +714,7 @@
+
@@ -1669,7 +1675,7 @@
False
-
+
\ No newline at end of file
diff --git a/apps/tests/ui/button/button-tests-native.android.ts b/apps/tests/ui/button/button-tests-native.android.ts
index 39e0d705d..c63dc07f0 100644
--- a/apps/tests/ui/button/button-tests-native.android.ts
+++ b/apps/tests/ui/button/button-tests-native.android.ts
@@ -2,6 +2,7 @@
import colorModule = require("color");
import utilsModule = require("utils/utils");
import enums = require("ui/enums");
+import background = require("ui/styling/background");
export function getNativeText(button: buttonModule.Button): string {
return button.android.getText();
@@ -17,7 +18,14 @@ export function getNativeColor(button: buttonModule.Button): colorModule.Color {
}
export function getNativeBackgroundColor(button: buttonModule.Button): colorModule.Color {
- return new colorModule.Color((button.android.getBackground()).backgroundColor);
+ var bkg = button.android.getBackground();
+ var color;
+ if (bkg instanceof background.ad.BorderDrawable) {
+ return (bkg).background.color;
+ }
+ else {
+ return new colorModule.Color(bkg.backgroundColor)
+ }
}
export function getNativeTextAlignment(button: buttonModule.Button): string {
diff --git a/apps/tests/ui/text-field/text-field-tests-native.android.ts b/apps/tests/ui/text-field/text-field-tests-native.android.ts
index d90197585..d719dbe3f 100644
--- a/apps/tests/ui/text-field/text-field-tests-native.android.ts
+++ b/apps/tests/ui/text-field/text-field-tests-native.android.ts
@@ -2,6 +2,7 @@
import colorModule = require("color");
import utilsModule = require("utils/utils");
import enums = require("ui/enums");
+import background = require("ui/styling/background");
export function getNativeText(textField: textFieldModule.TextField): string {
return textField.android.getText().toString();
@@ -26,7 +27,14 @@ export function getNativeColor(textField: textFieldModule.TextField): colorModul
}
export function getNativeBackgroundColor(textField: textFieldModule.TextField): colorModule.Color {
- return new colorModule.Color((textField.android.getBackground()).backgroundColor);
+ var bkg = textField.android.getBackground();
+ var color;
+ if (bkg instanceof background.ad.BorderDrawable) {
+ return (bkg).background.color;
+ }
+ else {
+ return new colorModule.Color(bkg.backgroundColor)
+ }
}
export function getNativeTextAlignment(textField: textFieldModule.TextField): string {
diff --git a/apps/tests/ui/text-view/text-view-tests-native.android.ts b/apps/tests/ui/text-view/text-view-tests-native.android.ts
index f0e989a52..ecca78ad6 100644
--- a/apps/tests/ui/text-view/text-view-tests-native.android.ts
+++ b/apps/tests/ui/text-view/text-view-tests-native.android.ts
@@ -2,6 +2,7 @@
import colorModule = require("color");
import utilsModule = require("utils/utils");
import enums = require("ui/enums");
+import background = require("ui/styling/background");
export function getNativeText(textView: textViewModule.TextView): string {
return textView.android.getText().toString();
@@ -30,7 +31,14 @@ export function getNativeColor(textView: textViewModule.TextView): colorModule.C
}
export function getNativeBackgroundColor(textView: textViewModule.TextView): colorModule.Color {
- return new colorModule.Color((textView.android.getBackground()).backgroundColor);
+ var bkg = textView.android.getBackground();
+ var color;
+ if (bkg instanceof background.ad.BorderDrawable) {
+ return (bkg).background.color;
+ }
+ else {
+ return new colorModule.Color(bkg.backgroundColor)
+ }
}
export function getNativeTextAlignment(textView: textViewModule.TextView): string {
diff --git a/apps/ui-tests-app/pages/background.ts b/apps/ui-tests-app/pages/background.ts
new file mode 100644
index 000000000..d3fc95ba5
--- /dev/null
+++ b/apps/ui-tests-app/pages/background.ts
@@ -0,0 +1,10 @@
+import view = require("ui/core/view");
+export function applyTap(args) {
+ var el = view.getViewById(view.getAncestor(args.object, "Page"), "test-element");
+ (el).style = args.object.tag;
+}
+
+export function resetTap(args) {
+ var el = view.getViewById(view.getAncestor(args.object, "Page"), "test-element");
+ (el).style = "";
+}
\ No newline at end of file
diff --git a/apps/ui-tests-app/pages/background.xml b/apps/ui-tests-app/pages/background.xml
new file mode 100644
index 000000000..5699dc180
--- /dev/null
+++ b/apps/ui-tests-app/pages/background.xml
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/apps/ui-tests-app/pages/test2.png b/apps/ui-tests-app/pages/test2.png
new file mode 100644
index 000000000..fa059ba75
Binary files /dev/null and b/apps/ui-tests-app/pages/test2.png differ
diff --git a/ui/styling/background.android.ts b/ui/styling/background.android.ts
index 8a94db038..b784583b3 100644
--- a/ui/styling/background.android.ts
+++ b/ui/styling/background.android.ts
@@ -61,8 +61,6 @@ export module ad {
}
public draw(canvas: android.graphics.Canvas): void {
- //super.draw(canvas);
- console.log("BorderDrawable.draw()");
var bounds = this.getBounds();
var boundsF = new android.graphics.RectF(bounds);
var boundsWidth = bounds.width();