mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 04:41:36 +08:00

- Use relative imports in place of most of our absolute ones. - Add "private" ambient modules for modules that we need to import using an absolute path (e.g. when app/.../test-something.ts needs to import ui/styling/style-scope)
32 lines
1.2 KiB
TypeScript
32 lines
1.2 KiB
TypeScript
import dependencyObservable = require("ui/core/dependency-observable");
|
|
import proxy = require("ui/core/proxy");
|
|
import common = require("./stack-layout-common");
|
|
import enums = require("ui/enums");
|
|
|
|
global.moduleMerge(common, exports);
|
|
|
|
export class StackLayout extends common.StackLayout {
|
|
|
|
static setNativeOrientationProperty(data: dependencyObservable.PropertyChangeData): void {
|
|
var stackLayout = <StackLayout>data.object;
|
|
var nativeView = stackLayout._nativeView;
|
|
nativeView.setOrientation(data.newValue === enums.Orientation.vertical ? org.nativescript.widgets.Orientation.vertical : org.nativescript.widgets.Orientation.horzontal);
|
|
}
|
|
|
|
private _layout: org.nativescript.widgets.StackLayout;
|
|
|
|
get android(): org.nativescript.widgets.StackLayout {
|
|
return this._layout;
|
|
}
|
|
|
|
get _nativeView(): org.nativescript.widgets.StackLayout {
|
|
return this._layout;
|
|
}
|
|
|
|
public _createUI() {
|
|
this._layout = new org.nativescript.widgets.StackLayout(this._context);
|
|
}
|
|
}
|
|
|
|
(<proxy.PropertyMetadata>common.StackLayout.orientationProperty.metadata).onSetNativeValue = StackLayout.setNativeOrientationProperty;
|