mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 11:01:21 +08:00
Fix TypeScript 1.8 compile errors. Get rid of "ui" imports.
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
import {Page} from "ui";
|
import {Page} from "ui/page";
|
||||||
import {EventData as ObservableEventData} from "data/observable";
|
import {EventData as ObservableEventData} from "data/observable";
|
||||||
|
|
||||||
// Event handler for Page "navigatedTo" event attached in details-page.xml
|
// Event handler for Page "navigatedTo" event attached in details-page.xml
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
import {EventData as ObservableEventData} from "data/observable";
|
import {EventData as ObservableEventData} from "data/observable";
|
||||||
import {Page, ItemEventData, topmost as topmostFrame, ItemEventData as ListViewItemEventData} from "ui";
|
import {Page} from "ui/page";
|
||||||
|
import {ItemEventData as ListViewItemEventData} from "ui/list-view";
|
||||||
|
import {topmost as topmostFrame} from "ui/frame";
|
||||||
import {AppViewModel} from "./reddit-app-view-model";
|
import {AppViewModel} from "./reddit-app-view-model";
|
||||||
|
|
||||||
var appViewModel = new AppViewModel();
|
var appViewModel = new AppViewModel();
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
import application = require("application");
|
import * as application from "application";
|
||||||
import navPageModule = require("../nav-page");
|
import {NavPage} from "../nav-page";
|
||||||
|
import {Page} from "ui/page";
|
||||||
|
import * as trace from "trace";
|
||||||
|
|
||||||
import trace = require("trace");
|
|
||||||
trace.enable();
|
trace.enable();
|
||||||
trace.setCategories(trace.categories.concat(
|
trace.setCategories(trace.categories.concat(
|
||||||
trace.categories.NativeLifecycle,
|
trace.categories.NativeLifecycle,
|
||||||
@ -11,18 +12,14 @@ trace.setCategories(trace.categories.concat(
|
|||||||
));
|
));
|
||||||
|
|
||||||
application.mainEntry = {
|
application.mainEntry = {
|
||||||
create: function () {
|
create: () => new NavPage({
|
||||||
return new navPageModule.NavPage({
|
index: 0,
|
||||||
index: 0,
|
backStackVisible: true,
|
||||||
backStackVisible: true,
|
clearHistory: false,
|
||||||
clearHistory: false,
|
animated: true,
|
||||||
animated: true,
|
transition: 0,
|
||||||
transition: 0,
|
curve: 0,
|
||||||
curve: 0,
|
duration: 0,
|
||||||
duration: 0,
|
})
|
||||||
});
|
|
||||||
}
|
|
||||||
//backstackVisible: false,
|
|
||||||
//clearHistory: true
|
|
||||||
};
|
};
|
||||||
application.start();
|
application.start();
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import {Page, ListPicker} from "ui";
|
import {Page} from "ui/page";
|
||||||
|
import {ListPicker} from "ui/list-picker";
|
||||||
|
|
||||||
var closeCallback: Function;
|
var closeCallback: Function;
|
||||||
var page: Page;
|
var page: Page;
|
||||||
|
@ -1,7 +1,17 @@
|
|||||||
import definition = require("controls-page");
|
import definition = require("controls-page");
|
||||||
import {View, Page, topmost as topmostFrame, NavigationTransition, Orientation, AnimationCurve, StackLayout, Button, Label, TextField, Switch, ListPicker, Slider} from "ui";
|
import {View} from "ui/core/view";
|
||||||
|
import {Page} from "ui/page";
|
||||||
|
import {topmost as topmostFrame, NavigationTransition} from "ui/frame";
|
||||||
|
import {Orientation, AnimationCurve} from "ui/enums";
|
||||||
|
import {StackLayout} from "ui/layouts/stack-layout";
|
||||||
|
import {Button} from "ui/button";
|
||||||
|
import {Label} from "ui/label";
|
||||||
|
import {TextField} from "ui/text-field";
|
||||||
|
import {Switch} from "ui/switch";
|
||||||
|
import {ListPicker} from "ui/list-picker";
|
||||||
|
import {Slider} from "ui/slider";
|
||||||
import {Color} from "color";
|
import {Color} from "color";
|
||||||
import platform = require("platform");
|
import * as platform from "platform";
|
||||||
|
|
||||||
var availableTransitions = ["default", "custom", "flip", "flipRight", "flipLeft", "slide", "slideLeft", "slideRight", "slideTop", "slideBottom", "fade"];
|
var availableTransitions = ["default", "custom", "flip", "flipRight", "flipLeft", "slide", "slideLeft", "slideRight", "slideTop", "slideBottom", "fade"];
|
||||||
if (platform.device.os === platform.platformNames.ios) {
|
if (platform.device.os === platform.platformNames.ios) {
|
||||||
|
@ -1,15 +1,12 @@
|
|||||||
import TKUnit = require("../TKUnit");
|
import * as TKUnit from "../TKUnit";
|
||||||
import platform = require("platform");
|
import {Page} from "ui/page";
|
||||||
import {Frame, Page, topmost as topmostFrame, NavigationEntry, NavigationTransition, AnimationCurve, WrapLayout, Button} from "ui";
|
import {topmost as topmostFrame} from "ui/frame";
|
||||||
import color = require("color");
|
import {Color} from "color";
|
||||||
import helper = require("../ui/helper");
|
|
||||||
import utils = require("utils/utils");
|
|
||||||
import trace = require("trace");
|
|
||||||
|
|
||||||
// Creates a random colorful page full of meaningless stuff.
|
// Creates a random colorful page full of meaningless stuff.
|
||||||
var pageFactory = function(): Page {
|
var pageFactory = function(): Page {
|
||||||
var page = new Page();
|
var page = new Page();
|
||||||
page.style.backgroundColor = new color.Color(255, Math.round(Math.random() * 255), Math.round(Math.random() * 255), Math.round(Math.random() * 255));
|
page.style.backgroundColor = new Color(255, Math.round(Math.random() * 255), Math.round(Math.random() * 255), Math.round(Math.random() * 255));
|
||||||
return page;
|
return page;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -112,4 +109,4 @@ export var test_ClearHistory = function () {
|
|||||||
|
|
||||||
topmostFrame().navigate({ create: mainPageFactory });
|
topmostFrame().navigate({ create: mainPageFactory });
|
||||||
TKUnit.waitUntilReady(() => { return topmostFrame().currentPage === mainTestPage; });
|
TKUnit.waitUntilReady(() => { return topmostFrame().currentPage === mainTestPage; });
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
import TKUnit = require("../TKUnit");
|
import * as TKUnit from "../TKUnit";
|
||||||
import platform = require("platform");
|
import * as helper from "../ui/helper";
|
||||||
import transitionModule = require("ui/transition");
|
import * as platform from "platform";
|
||||||
import color = require("color");
|
import * as trace from "trace";
|
||||||
import helper = require("../ui/helper");
|
import {Color} from "color";
|
||||||
import utils = require("utils/utils");
|
import {GC} from "utils/utils";
|
||||||
import trace = require("trace");
|
import {NavigationEntry, NavigationTransition} from "ui/frame";
|
||||||
import {Frame, Page, topmost as topmostFrame, NavigationEntry, NavigationTransition, AnimationCurve, WrapLayout, Button} from "ui";
|
import {Page} from "ui/page";
|
||||||
|
import {AnimationCurve} from "ui/enums"
|
||||||
|
|
||||||
function _testTransition(navigationTransition: NavigationTransition) {
|
function _testTransition(navigationTransition: NavigationTransition) {
|
||||||
var testId = `Transition[${JSON.stringify(navigationTransition)}]`;
|
var testId = `Transition[${JSON.stringify(navigationTransition)}]`;
|
||||||
@ -14,7 +15,7 @@ function _testTransition(navigationTransition: NavigationTransition) {
|
|||||||
create: function (): Page {
|
create: function (): Page {
|
||||||
var page = new Page();
|
var page = new Page();
|
||||||
page.id = testId;
|
page.id = testId;
|
||||||
page.style.backgroundColor = new color.Color(255, Math.round(Math.random() * 255), Math.round(Math.random() * 255), Math.round(Math.random() * 255));
|
page.style.backgroundColor = new Color(255, Math.round(Math.random() * 255), Math.round(Math.random() * 255), Math.round(Math.random() * 255));
|
||||||
return page;
|
return page;
|
||||||
},
|
},
|
||||||
animated: true,
|
animated: true,
|
||||||
@ -25,7 +26,7 @@ function _testTransition(navigationTransition: NavigationTransition) {
|
|||||||
TKUnit.wait(0.100);
|
TKUnit.wait(0.100);
|
||||||
helper.goBack();
|
helper.goBack();
|
||||||
TKUnit.wait(0.100);
|
TKUnit.wait(0.100);
|
||||||
utils.GC();
|
GC();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extremely slow. Run only if needed.
|
// Extremely slow. Run only if needed.
|
||||||
@ -33,7 +34,7 @@ export var test_Transitions = function () {
|
|||||||
helper.navigate(() => {
|
helper.navigate(() => {
|
||||||
var page = new Page();
|
var page = new Page();
|
||||||
page.id = "TransitionsTestPage_MAIN"
|
page.id = "TransitionsTestPage_MAIN"
|
||||||
page.style.backgroundColor = new color.Color(255, Math.round(Math.random() * 255), Math.round(Math.random() * 255), Math.round(Math.random() * 255));
|
page.style.backgroundColor = new Color(255, Math.round(Math.random() * 255), Math.round(Math.random() * 255), Math.round(Math.random() * 255));
|
||||||
return page;
|
return page;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -27,19 +27,15 @@ export function getNativeTextAlignment(button: buttonModule.Button): string {
|
|||||||
switch (button.ios.titleLabel.textAlignment) {
|
switch (button.ios.titleLabel.textAlignment) {
|
||||||
case NSTextAlignment.NSTextAlignmentLeft:
|
case NSTextAlignment.NSTextAlignmentLeft:
|
||||||
return enums.TextAlignment.left;
|
return enums.TextAlignment.left;
|
||||||
break;
|
|
||||||
case NSTextAlignment.NSTextAlignmentCenter:
|
case NSTextAlignment.NSTextAlignmentCenter:
|
||||||
return enums.TextAlignment.center;
|
return enums.TextAlignment.center;
|
||||||
break;
|
|
||||||
case NSTextAlignment.NSTextAlignmentRight:
|
case NSTextAlignment.NSTextAlignmentRight:
|
||||||
return enums.TextAlignment.right;
|
return enums.TextAlignment.right;
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
return "unexpected value";
|
return "unexpected value";
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function performNativeClick(button: buttonModule.Button): void {
|
export function performNativeClick(button: buttonModule.Button): void {
|
||||||
button.ios.sendActionsForControlEvents(UIControlEvents.UIControlEventTouchUpInside);
|
button.ios.sendActionsForControlEvents(UIControlEvents.UIControlEventTouchUpInside);
|
||||||
}
|
}
|
||||||
|
@ -7,16 +7,12 @@ export function getNativeTextAlignment(label: labelModule.Label): string {
|
|||||||
switch (label.ios.textAlignment) {
|
switch (label.ios.textAlignment) {
|
||||||
case NSTextAlignment.NSTextAlignmentLeft:
|
case NSTextAlignment.NSTextAlignmentLeft:
|
||||||
return enums.TextAlignment.left;
|
return enums.TextAlignment.left;
|
||||||
break;
|
|
||||||
case NSTextAlignment.NSTextAlignmentCenter:
|
case NSTextAlignment.NSTextAlignmentCenter:
|
||||||
return enums.TextAlignment.center;
|
return enums.TextAlignment.center;
|
||||||
break;
|
|
||||||
case NSTextAlignment.NSTextAlignmentRight:
|
case NSTextAlignment.NSTextAlignmentRight:
|
||||||
return enums.TextAlignment.right;
|
return enums.TextAlignment.right;
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
return "unexpected value";
|
return "unexpected value";
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,18 +1,20 @@
|
|||||||
import TKUnit = require("../../TKUnit");
|
import * as TKUnit from "../../TKUnit";
|
||||||
import helper = require("../helper");
|
import * as helper from "../helper";
|
||||||
import viewModule = require("ui/core/view");
|
import {View} from "ui/core/view";
|
||||||
import observable = require("data/observable");
|
import {Button} from "ui/button";
|
||||||
import color = require("color");
|
import {Page} from "ui/page";
|
||||||
import platform = require("platform");
|
import {ScrollView} from "ui/scroll-view";
|
||||||
|
import {TabView, TabViewItem} from "ui/tab-view";
|
||||||
|
import {LayoutBase} from "ui/layouts/layout-base"
|
||||||
|
import {StackLayout} from "ui/layouts/stack-layout"
|
||||||
|
import {GridLayout} from "ui/layouts/grid-layout"
|
||||||
import {ProxyViewContainer} from "ui/proxy-view-container";
|
import {ProxyViewContainer} from "ui/proxy-view-container";
|
||||||
import {View, Button, LayoutBase, StackLayout, GridLayout, Page, ScrollView, TabView, TabViewItem} from "ui";
|
|
||||||
|
|
||||||
export function test_add_children_to_attached_proxy() {
|
export function test_add_children_to_attached_proxy() {
|
||||||
var outer = new StackLayout();
|
var outer = new StackLayout();
|
||||||
var proxy = new ProxyViewContainer();
|
var proxy = new ProxyViewContainer();
|
||||||
|
|
||||||
function testAction(views: Array<viewModule.View>) {
|
function testAction(views: Array<View>) {
|
||||||
outer.addChild(createBtn("1"));
|
outer.addChild(createBtn("1"));
|
||||||
outer.addChild(proxy);
|
outer.addChild(proxy);
|
||||||
proxy.addChild(createBtn("2"));
|
proxy.addChild(createBtn("2"));
|
||||||
@ -31,7 +33,7 @@ export function test_children_immediately_registered_in_parent_grid_layout() {
|
|||||||
var outer = new GridLayout();
|
var outer = new GridLayout();
|
||||||
var proxy = new ProxyViewContainer();
|
var proxy = new ProxyViewContainer();
|
||||||
|
|
||||||
function testAction(views: Array<viewModule.View>) {
|
function testAction(views: Array<View>) {
|
||||||
outer.addChild(proxy);
|
outer.addChild(proxy);
|
||||||
proxy.addChild(createBtn("1"));
|
proxy.addChild(createBtn("1"));
|
||||||
|
|
||||||
@ -45,7 +47,7 @@ export function test_children_registered_in_parent_grid_layout_on_attach() {
|
|||||||
var outer = new GridLayout();
|
var outer = new GridLayout();
|
||||||
var proxy = new ProxyViewContainer();
|
var proxy = new ProxyViewContainer();
|
||||||
|
|
||||||
function testAction(views: Array<viewModule.View>) {
|
function testAction(views: Array<View>) {
|
||||||
proxy.addChild(createBtn("1"));
|
proxy.addChild(createBtn("1"));
|
||||||
outer.addChild(proxy);
|
outer.addChild(proxy);
|
||||||
|
|
||||||
@ -59,7 +61,7 @@ export function test_add_children_to_detached_proxy() {
|
|||||||
var outer = new StackLayout();
|
var outer = new StackLayout();
|
||||||
var proxy = new ProxyViewContainer();
|
var proxy = new ProxyViewContainer();
|
||||||
|
|
||||||
function testAction(views: Array<viewModule.View>) {
|
function testAction(views: Array<View>) {
|
||||||
outer.addChild(createBtn("1"));
|
outer.addChild(createBtn("1"));
|
||||||
|
|
||||||
proxy.addChild(createBtn("2"));
|
proxy.addChild(createBtn("2"));
|
||||||
@ -88,7 +90,7 @@ export function test_remove_proxy() {
|
|||||||
|
|
||||||
outer.addChild(createBtn("5"));
|
outer.addChild(createBtn("5"));
|
||||||
|
|
||||||
function testAction(views: Array<viewModule.View>) {
|
function testAction(views: Array<View>) {
|
||||||
assertNativeChildren(outer, ["1", "2", "3", "4", "5"]);
|
assertNativeChildren(outer, ["1", "2", "3", "4", "5"]);
|
||||||
outer.removeChild(proxy);
|
outer.removeChild(proxy);
|
||||||
assertNativeChildren(outer, ["1", "5"]);
|
assertNativeChildren(outer, ["1", "5"]);
|
||||||
@ -111,7 +113,7 @@ export function test_remove_child_of_attached_proxy() {
|
|||||||
|
|
||||||
outer.addChild(createBtn("5"));
|
outer.addChild(createBtn("5"));
|
||||||
|
|
||||||
function testAction(views: Array<viewModule.View>) {
|
function testAction(views: Array<View>) {
|
||||||
assertNativeChildren(outer, ["1", "2", "3", "4", "5"]);
|
assertNativeChildren(outer, ["1", "2", "3", "4", "5"]);
|
||||||
proxy.removeChild(testBtn);
|
proxy.removeChild(testBtn);
|
||||||
assertNativeChildren(outer, ["1", "2", "4", "5"]);
|
assertNativeChildren(outer, ["1", "2", "4", "5"]);
|
||||||
@ -132,7 +134,7 @@ export function test_insert_inside_porxy() {
|
|||||||
|
|
||||||
outer.addChild(createBtn("5"));
|
outer.addChild(createBtn("5"));
|
||||||
|
|
||||||
function testAction(views: Array<viewModule.View>) {
|
function testAction(views: Array<View>) {
|
||||||
assertNativeChildren(outer, ["1", "2", "4", "5"]);
|
assertNativeChildren(outer, ["1", "2", "4", "5"]);
|
||||||
proxy.insertChild(createBtn("3"), 1);
|
proxy.insertChild(createBtn("3"), 1);
|
||||||
assertNativeChildren(outer, ["1", "2", "3", "4", "5"]);
|
assertNativeChildren(outer, ["1", "2", "3", "4", "5"]);
|
||||||
@ -152,7 +154,7 @@ export function test_insert_after_porxy() {
|
|||||||
proxy.addChild(createBtn("3"));
|
proxy.addChild(createBtn("3"));
|
||||||
proxy.addChild(createBtn("4"));
|
proxy.addChild(createBtn("4"));
|
||||||
|
|
||||||
function testAction(views: Array<viewModule.View>) {
|
function testAction(views: Array<View>) {
|
||||||
assertNativeChildren(outer, ["1", "2", "3", "4"]);
|
assertNativeChildren(outer, ["1", "2", "3", "4"]);
|
||||||
outer.insertChild(createBtn("5"), 2);
|
outer.insertChild(createBtn("5"), 2);
|
||||||
assertNativeChildren(outer, ["1", "2", "3", "4", "5"]);
|
assertNativeChildren(outer, ["1", "2", "3", "4", "5"]);
|
||||||
@ -170,7 +172,7 @@ export function test_proxy_does_not_stop_request_layout_bubble() {
|
|||||||
var btn = createBtn("2");
|
var btn = createBtn("2");
|
||||||
proxy.addChild(btn);
|
proxy.addChild(btn);
|
||||||
|
|
||||||
function testAction(views: Array<viewModule.View>) {
|
function testAction(views: Array<View>) {
|
||||||
assertNativeChildren(outer, ["1", "2"]);
|
assertNativeChildren(outer, ["1", "2"]);
|
||||||
waitUntilElementLayoutIsValid(outer);
|
waitUntilElementLayoutIsValid(outer);
|
||||||
TKUnit.assert(outer.isLayoutValid, "outer container isLayoutValid should be true");
|
TKUnit.assert(outer.isLayoutValid, "outer container isLayoutValid should be true");
|
||||||
@ -185,7 +187,7 @@ export function test_proxy_iniside_page() {
|
|||||||
var proxy = new ProxyViewContainer();
|
var proxy = new ProxyViewContainer();
|
||||||
proxy.addChild(createBtn("1"));
|
proxy.addChild(createBtn("1"));
|
||||||
|
|
||||||
function testAction(views: Array<viewModule.View>) {
|
function testAction(views: Array<View>) {
|
||||||
var page = <Page>views[1];
|
var page = <Page>views[1];
|
||||||
waitUntilElementLayoutIsValid(page);
|
waitUntilElementLayoutIsValid(page);
|
||||||
};
|
};
|
||||||
@ -200,7 +202,7 @@ export function test_proxy_iniside_scroll_view() {
|
|||||||
var proxy = new ProxyViewContainer();
|
var proxy = new ProxyViewContainer();
|
||||||
proxy.addChild(createBtn("1"));
|
proxy.addChild(createBtn("1"));
|
||||||
|
|
||||||
function testAction(views: Array<viewModule.View>) {
|
function testAction(views: Array<View>) {
|
||||||
var page = <Page>views[1];
|
var page = <Page>views[1];
|
||||||
waitUntilElementLayoutIsValid(page);
|
waitUntilElementLayoutIsValid(page);
|
||||||
};
|
};
|
||||||
@ -215,7 +217,7 @@ export function test_proxy_iniside_border() {
|
|||||||
var proxy = new ProxyViewContainer();
|
var proxy = new ProxyViewContainer();
|
||||||
proxy.addChild(createBtn("1"));
|
proxy.addChild(createBtn("1"));
|
||||||
|
|
||||||
function testAction(views: Array<viewModule.View>) {
|
function testAction(views: Array<View>) {
|
||||||
var page = <Page>views[1];
|
var page = <Page>views[1];
|
||||||
waitUntilElementLayoutIsValid(page);
|
waitUntilElementLayoutIsValid(page);
|
||||||
};
|
};
|
||||||
@ -233,7 +235,7 @@ export function test_proxy_iniside_border() {
|
|||||||
// items.push(new TabViewItem({ title: "tab with proxy", view: proxy }));
|
// items.push(new TabViewItem({ title: "tab with proxy", view: proxy }));
|
||||||
// tab.items = items;
|
// tab.items = items;
|
||||||
|
|
||||||
// function testAction(views: Array<viewModule.View>) {
|
// function testAction(views: Array<View>) {
|
||||||
// var page = <Page>views[1];
|
// var page = <Page>views[1];
|
||||||
// waitUntilElementLayoutIsValid(page);
|
// waitUntilElementLayoutIsValid(page);
|
||||||
// };
|
// };
|
||||||
@ -243,7 +245,7 @@ export function test_proxy_iniside_border() {
|
|||||||
|
|
||||||
// TODO: Proxy as a direct child to of ActionBar is not supported. Not sure if we want to support it.
|
// TODO: Proxy as a direct child to of ActionBar is not supported. Not sure if we want to support it.
|
||||||
//export function test_proxy_iniside_actionBar() {
|
//export function test_proxy_iniside_actionBar() {
|
||||||
// function testAction(views: Array<viewModule.View>) {
|
// function testAction(views: Array<View>) {
|
||||||
// var page = <Page>views[1];
|
// var page = <Page>views[1];
|
||||||
// var proxy = new ProxyViewContainer();
|
// var proxy = new ProxyViewContainer();
|
||||||
// proxy.addChild(createBtn("1"));
|
// proxy.addChild(createBtn("1"));
|
||||||
|
@ -67,8 +67,7 @@ var _clickHandlerFactory = function (index: number) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function testWhenNavigatingBackToANonCachedPageContainingATabViewWithAListViewTheListViewIsThere() {
|
export function testWhenNavigatingBackToANonCachedPageContainingATabViewWithAListViewTheListViewIsThere() {
|
||||||
return;
|
/*
|
||||||
|
|
||||||
var topFrame = frameModule.topmost();
|
var topFrame = frameModule.topmost();
|
||||||
var oldChache;
|
var oldChache;
|
||||||
|
|
||||||
@ -126,6 +125,7 @@ export function testWhenNavigatingBackToANonCachedPageContainingATabViewWithALis
|
|||||||
var listView = mainPage.getViewById<ListView>("ListView");
|
var listView = mainPage.getViewById<ListView>("ListView");
|
||||||
|
|
||||||
TKUnit.assert(listView !== undefined, "ListView should be created when navigating back to the main page.");
|
TKUnit.assert(listView !== undefined, "ListView should be created when navigating back to the main page.");
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
export function testLoadedAndUnloadedAreFired_WhenNavigatingAwayAndBack_NoPageCaching() {
|
export function testLoadedAndUnloadedAreFired_WhenNavigatingAwayAndBack_NoPageCaching() {
|
||||||
@ -224,4 +224,4 @@ function _clickTheFirstButtonInTheListViewNatively(tabView: TabView) {
|
|||||||
else {
|
else {
|
||||||
(<UIButton>(<UITableView>tabView.ios.viewControllers[0].view.subviews[0]).cellForRowAtIndexPath(NSIndexPath.indexPathForItemInSection(0, 0)).contentView.subviews[0]).sendActionsForControlEvents(UIControlEvents.UIControlEventTouchUpInside);
|
(<UIButton>(<UITableView>tabView.ios.viewControllers[0].view.subviews[0]).cellForRowAtIndexPath(NSIndexPath.indexPathForItemInSection(0, 0)).contentView.subviews[0]).sendActionsForControlEvents(UIControlEvents.UIControlEventTouchUpInside);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,16 +31,12 @@ export function getNativeTextAlignment(textField: textFieldModule.TextField): st
|
|||||||
switch (textField.ios.textAlignment) {
|
switch (textField.ios.textAlignment) {
|
||||||
case NSTextAlignment.NSTextAlignmentLeft:
|
case NSTextAlignment.NSTextAlignmentLeft:
|
||||||
return enums.TextAlignment.left;
|
return enums.TextAlignment.left;
|
||||||
break;
|
|
||||||
case NSTextAlignment.NSTextAlignmentCenter:
|
case NSTextAlignment.NSTextAlignmentCenter:
|
||||||
return enums.TextAlignment.center;
|
return enums.TextAlignment.center;
|
||||||
break;
|
|
||||||
case NSTextAlignment.NSTextAlignmentRight:
|
case NSTextAlignment.NSTextAlignmentRight:
|
||||||
return enums.TextAlignment.right;
|
return enums.TextAlignment.right;
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
return "unexpected value";
|
return "unexpected value";
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -49,4 +45,4 @@ export function typeTextNatively(textField: textFieldModule.TextField, text: str
|
|||||||
|
|
||||||
// Setting the text will not trigger the delegate method, so we have to do it by hand.
|
// Setting the text will not trigger the delegate method, so we have to do it by hand.
|
||||||
textField.ios.delegate.textFieldDidEndEditing(textField.ios);
|
textField.ios.delegate.textFieldDidEndEditing(textField.ios);
|
||||||
}
|
}
|
||||||
|
@ -36,16 +36,12 @@ export function getNativeTextAlignment(textView: textViewModule.TextView): strin
|
|||||||
switch (textView.ios.textAlignment) {
|
switch (textView.ios.textAlignment) {
|
||||||
case NSTextAlignment.NSTextAlignmentLeft:
|
case NSTextAlignment.NSTextAlignmentLeft:
|
||||||
return enums.TextAlignment.left;
|
return enums.TextAlignment.left;
|
||||||
break;
|
|
||||||
case NSTextAlignment.NSTextAlignmentCenter:
|
case NSTextAlignment.NSTextAlignmentCenter:
|
||||||
return enums.TextAlignment.center;
|
return enums.TextAlignment.center;
|
||||||
break;
|
|
||||||
case NSTextAlignment.NSTextAlignmentRight:
|
case NSTextAlignment.NSTextAlignmentRight:
|
||||||
return enums.TextAlignment.right;
|
return enums.TextAlignment.right;
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
return "unexpected value";
|
return "unexpected value";
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,4 +50,4 @@ export function typeTextNatively(textView: textViewModule.TextView, text: string
|
|||||||
|
|
||||||
// Setting the text will not trigger the delegate method, so we have to do it by hand.
|
// Setting the text will not trigger the delegate method, so we have to do it by hand.
|
||||||
textView.ios.delegate.textViewDidEndEditing(textView.ios);
|
textView.ios.delegate.textViewDidEndEditing(textView.ios);
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
import { Page, View, TextView } from "ui";
|
import {View} from "ui/core/view";
|
||||||
|
import {Page} from "ui/page";
|
||||||
|
import {TextView} from "ui/text-view";
|
||||||
import gestures = require("ui/gestures");
|
import gestures = require("ui/gestures");
|
||||||
|
|
||||||
export function onTouch(args: gestures.TouchGestureEventData) {
|
export function onTouch(args: gestures.TouchGestureEventData) {
|
||||||
|
@ -264,7 +264,6 @@ export class Animation extends common.Animation implements definition.Animation
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
throw new Error("Cannot animate " + propertyAnimation.property);
|
throw new Error("Cannot animate " + propertyAnimation.property);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var i = 0;
|
var i = 0;
|
||||||
|
@ -57,7 +57,6 @@ export class EditableTextBase extends common.EditableTextBase {
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new Error("Invalid updateTextTrigger: " + owner.updateTextTrigger);
|
throw new Error("Invalid updateTextTrigger: " + owner.updateTextTrigger);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -228,7 +228,6 @@ class CssCompositeSelector extends CssSelector {
|
|||||||
}
|
}
|
||||||
if (!result) {
|
if (!result) {
|
||||||
break;
|
break;
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
@ -282,11 +281,9 @@ function matchesAttr(attrExpression: string, view: view.View): boolean {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return !types.isNullOrUndefined(view[attrName]) && attrCheckRegex.test(view[attrName]+"");
|
return !types.isNullOrUndefined(view[attrName]) && attrCheckRegex.test(view[attrName]+"");
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
return !types.isNullOrUndefined(view[attrExpression]);
|
return !types.isNullOrUndefined(view[attrExpression]);
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export class CssVisualStateSelector extends CssSelector {
|
export class CssVisualStateSelector extends CssSelector {
|
||||||
|
Reference in New Issue
Block a user