Stabilizing layout tests

This commit is contained in:
hshristov
2015-11-10 17:17:42 +02:00
committed by Hristo Hristov
parent 1757eb7092
commit c2cb4a8f61
11 changed files with 209 additions and 200 deletions

View File

@ -18,24 +18,27 @@ export module layout {
export function getDisplayDensity(): number {
return 1;
}
export function toDevicePixels(value: number): number {
return value * getDisplayDensity();
}
export function toDeviceIndependentPixels(value: number): number {
return value / getDisplayDensity();
}
}
export module ios {
export module collections {
export function jsArrayToNSArray(str: string[]): any {
var arr = new NSMutableArray();
if ("undefined" !== typeof str) {
for (var element in str) {
arr.addObject(str[element]);
}
}
return arr;
export function jsArrayToNSArray(str: string[]): NSArray {
return NSArray.arrayWithArray(<any>str);
}
export function nsArrayToJSArray(a: any): string[] {
export function nsArrayToJSArray(a: NSArray): Array<Object> {
var arr = [];
if ("undefined" !== typeof a) {
for (var i = 0; i < a.count; i++) {
let count = a.count;
for (let i = 0; i < count; i++) {
arr.push(a.objectAtIndex(i));
}
}