mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 19:26:42 +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)
34 lines
1.1 KiB
TypeScript
34 lines
1.1 KiB
TypeScript
import common = require("./progress-common");
|
|
import dependencyObservable = require("ui/core/dependency-observable");
|
|
import proxy = require("ui/core/proxy");
|
|
|
|
function onValuePropertyChanged(data: dependencyObservable.PropertyChangeData) {
|
|
var progress = <Progress>data.object;
|
|
progress.ios.progress = data.newValue / progress.maxValue;
|
|
}
|
|
|
|
function onMaxValuePropertyChanged(data: dependencyObservable.PropertyChangeData) {
|
|
var progress = <Progress>data.object;
|
|
progress.ios.progress = progress.value / data.newValue;
|
|
}
|
|
|
|
// register the setNativeValue callbacks
|
|
(<proxy.PropertyMetadata>common.Progress.valueProperty.metadata).onSetNativeValue = onValuePropertyChanged;
|
|
(<proxy.PropertyMetadata>common.Progress.maxValueProperty.metadata).onSetNativeValue = onMaxValuePropertyChanged;
|
|
|
|
global.moduleMerge(common, exports);
|
|
|
|
export class Progress extends common.Progress {
|
|
private _ios: UIProgressView;
|
|
|
|
constructor() {
|
|
super();
|
|
|
|
this._ios = new UIProgressView();
|
|
}
|
|
|
|
get ios(): UIProgressView {
|
|
return this._ios;
|
|
}
|
|
}
|