forked from NativeScript/NativeScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogress.android.ts
More file actions
41 lines (32 loc) · 1.35 KB
/
progress.android.ts
File metadata and controls
41 lines (32 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import common = require("ui/progress/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;
if (!progress.android) {
return;
}
progress.android.setProgress(data.newValue);
}
function onMaxValuePropertyChanged(data: dependencyObservable.PropertyChangeData) {
var progress = <Progress>data.object;
if (!progress.android) {
return;
}
progress.android.setMax(data.newValue);
}
// register the setNativeValue callbacks
(<proxy.PropertyMetadata>common.Progress.valueProperty.metadata).onSetNativeValue = onValuePropertyChanged;
(<proxy.PropertyMetadata>common.Progress.maxValueProperty.metadata).onSetNativeValue = onMaxValuePropertyChanged;
// merge the exports of the common file with the exports of this file
declare var exports;
require("utils/module-merge").merge(common, exports);
export class Progress extends common.Progress {
private _android: android.widget.ProgressBar;
public _createUI() {
this._android = new android.widget.ProgressBar(this._context, null, (<any>android).R.attr.progressBarStyleHorizontal);
}
get android(): android.widget.ProgressBar {
return this._android;
}
}