mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 11:42:04 +08:00
stylers removed
This commit is contained in:
@ -1,6 +1,9 @@
|
||||
import common = require("./progress-common");
|
||||
import dependencyObservable = require("ui/core/dependency-observable");
|
||||
import proxy = require("ui/core/proxy");
|
||||
import styling = require("ui/styling");
|
||||
import style = require("ui/styling/style");
|
||||
import view = require("ui/core/view");
|
||||
|
||||
function onValuePropertyChanged(data: dependencyObservable.PropertyChangeData) {
|
||||
var progress = <Progress>data.object;
|
||||
@ -31,3 +34,50 @@ export class Progress extends common.Progress {
|
||||
return this._ios;
|
||||
}
|
||||
}
|
||||
|
||||
export class ProgressStyler implements style.Styler {
|
||||
//Text color methods
|
||||
private static setColorProperty(view: view.View, newValue: any) {
|
||||
var bar = <UIProgressView>view.ios;
|
||||
bar.progressTintColor = newValue;
|
||||
}
|
||||
|
||||
private static resetColorProperty(view: view.View, nativeValue: any) {
|
||||
var bar = <UIProgressView>view.ios;
|
||||
bar.progressTintColor = nativeValue;
|
||||
}
|
||||
|
||||
private static getNativeColorValue(view: view.View): any {
|
||||
var bar = <UIProgressView>view.ios;
|
||||
return bar.progressTintColor;
|
||||
}
|
||||
|
||||
private static setBackgroundColorProperty(view: view.View, newValue: any) {
|
||||
var bar = <UIProgressView>view.ios;
|
||||
bar.trackTintColor = newValue;
|
||||
}
|
||||
|
||||
private static resetBackgroundColorProperty(view: view.View, nativeValue: any) {
|
||||
var bar = <UIProgressView>view.ios;
|
||||
bar.trackTintColor = nativeValue;
|
||||
}
|
||||
|
||||
private static getBackgroundColorProperty(view: view.View): any {
|
||||
var bar = <UIProgressView>view.ios;
|
||||
return bar.trackTintColor;
|
||||
}
|
||||
|
||||
public static registerHandlers() {
|
||||
style.registerHandler(style.colorProperty, new style.StylePropertyChangedHandler(
|
||||
ProgressStyler.setColorProperty,
|
||||
ProgressStyler.resetColorProperty,
|
||||
ProgressStyler.getNativeColorValue), "Progress");
|
||||
|
||||
style.registerHandler(style.backgroundColorProperty, new style.StylePropertyChangedHandler(
|
||||
ProgressStyler.setBackgroundColorProperty,
|
||||
ProgressStyler.resetBackgroundColorProperty,
|
||||
ProgressStyler.getBackgroundColorProperty), "Progress");
|
||||
}
|
||||
}
|
||||
|
||||
ProgressStyler.registerHandlers();
|
||||
|
Reference in New Issue
Block a user