mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
NativeView recycled for android
This commit is contained in:
@@ -69,13 +69,10 @@ application.on(application.lowMemoryEvent, function (args: application.Applicati
|
||||
});
|
||||
|
||||
application.on(application.uncaughtErrorEvent, function (args: application.UnhandledErrorEventData) {
|
||||
if (args.android) {
|
||||
// For Android applications, args.android is NativeScriptError.
|
||||
console.log("### NativeScriptError: " + args.android);
|
||||
} else if (args.ios) {
|
||||
// For iOS applications, args.ios is NativeScriptError.
|
||||
console.log("### NativeScriptError: " + args.ios);
|
||||
}
|
||||
console.log("### NativeScriptError: " + args.error);
|
||||
console.log("### nativeException: " + (<any>args.error).nativeException);
|
||||
console.log("### stackTace: " + (<any>args.error).stackTrace);
|
||||
console.log("### stack: " + args.error.stack);
|
||||
});
|
||||
|
||||
application.setCssFileName("ui-tests-app/app.css");
|
||||
|
||||
@@ -15,9 +15,7 @@ var oldExamples: Map<string, string> = new Map<string, string>();
|
||||
|
||||
export function pageLoaded(args: EventData) {
|
||||
let page = <Page>args.object;
|
||||
let view = require("ui/core/view");
|
||||
let wrapLayout = <WrapLayout>view.getViewById(page, "wrapLayoutWithExamples");
|
||||
|
||||
let wrapLayout = page.getViewById<WrapLayout>("wrapLayoutWithExamples");
|
||||
examples.set("action-bar", "action-bar/main-page");
|
||||
examples.set("bindings", "bindings/main-page");
|
||||
examples.set("css", "css/main-page");
|
||||
@@ -46,8 +44,8 @@ export function pageLoaded(args: EventData) {
|
||||
let viewModel = new MainPageViewModel(wrapLayout, examples);
|
||||
page.bindingContext = viewModel;
|
||||
|
||||
var parent = page.getViewById('parentLayout');
|
||||
var searchBar = page.getViewById('textView');
|
||||
var parent = page.getViewById('parentLayout');
|
||||
var searchBar = page.getViewById('textView');
|
||||
|
||||
if (parent.android) {
|
||||
parent.android.setFocusableInTouchMode(true);
|
||||
@@ -57,7 +55,7 @@ export function pageLoaded(args: EventData) {
|
||||
|
||||
refresh();
|
||||
}
|
||||
|
||||
|
||||
// should be removes
|
||||
export function refresh() {
|
||||
oldExamples.set("actStyle", "action-bar/all");
|
||||
@@ -217,7 +215,7 @@ export class MainPageViewModel extends observable.Observable {
|
||||
}
|
||||
|
||||
btn.style.color = new colorModule.Color(this.colors[count++ % 3]);
|
||||
btn.on(buttonModule.Button.tapEvent, function(eventData) {
|
||||
btn.on(buttonModule.Button.tapEvent, function (eventData) {
|
||||
let text = btn.text;
|
||||
this.loadExample(text);
|
||||
}, this);
|
||||
|
||||
Reference in New Issue
Block a user