From eb57f446332277680d5e278f5c8b879a2374e0a1 Mon Sep 17 00:00:00 2001 From: Vladimir Enchev Date: Mon, 2 Nov 2015 10:54:22 +0200 Subject: [PATCH] handlers fixed --- ui/styling/stylers.android.ts | 47 +++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/ui/styling/stylers.android.ts b/ui/styling/stylers.android.ts index 5fcbccb14..13676682c 100644 --- a/ui/styling/stylers.android.ts +++ b/ui/styling/stylers.android.ts @@ -13,6 +13,14 @@ var btn; global.moduleMerge(stylersCommon, exports); +var ignorePropertyHandler = new stylersCommon.StylePropertyChangedHandler( + (view, val) => { + // empty + }, + (view, val) => { + // empty + }); + var _defaultBackgrounds = new Map(); function onBackgroundOrBorderPropertyChanged(v: view.View) { @@ -600,15 +608,14 @@ export class ProgressStyler implements definition.stylers.Styler { ProgressStyler.setColorProperty, ProgressStyler.resetColorProperty), "Progress"); - var borderHandler = new stylersCommon.StylePropertyChangedHandler( + style.registerHandler(style.backgroundColorProperty, new stylersCommon.StylePropertyChangedHandler( ProgressStyler.setBackgroundAndBorderProperty, - ProgressStyler.resetBackgroundAndBorderProperty); + ProgressStyler.resetBackgroundAndBorderProperty), "Progress"); - style.registerHandler(style.backgroundColorProperty, borderHandler, "Progress"); - style.registerHandler(style.borderWidthProperty, borderHandler, "Progress"); - style.registerHandler(style.borderColorProperty, borderHandler, "Progress"); - style.registerHandler(style.borderRadiusProperty, borderHandler, "Progress"); - style.registerHandler(style.backgroundInternalProperty, borderHandler, "Progress"); + style.registerHandler(style.borderWidthProperty, ignorePropertyHandler, "Progress"); + style.registerHandler(style.borderColorProperty, ignorePropertyHandler, "Progress"); + style.registerHandler(style.borderRadiusProperty, ignorePropertyHandler, "Progress"); + style.registerHandler(style.backgroundInternalProperty, ignorePropertyHandler, "Progress"); } } @@ -638,15 +645,14 @@ export class SliderStyler implements definition.stylers.Styler { SliderStyler.setColorProperty, SliderStyler.resetColorProperty), "Slider"); - var borderHandler = new stylersCommon.StylePropertyChangedHandler( + style.registerHandler(style.backgroundColorProperty, new stylersCommon.StylePropertyChangedHandler( SliderStyler.setBackgroundAndBorderProperty, - SliderStyler.resetBackgroundAndBorderProperty); + SliderStyler.resetBackgroundAndBorderProperty), "Slider"); - style.registerHandler(style.backgroundColorProperty, borderHandler, "Slider"); - style.registerHandler(style.borderWidthProperty, borderHandler, "Slider"); - style.registerHandler(style.borderColorProperty, borderHandler, "Slider"); - style.registerHandler(style.borderRadiusProperty, borderHandler, "Slider"); - style.registerHandler(style.backgroundInternalProperty, borderHandler, "Slider"); + style.registerHandler(style.borderWidthProperty, ignorePropertyHandler, "Slider"); + style.registerHandler(style.borderColorProperty, ignorePropertyHandler, "Slider"); + style.registerHandler(style.borderRadiusProperty, ignorePropertyHandler, "Slider"); + style.registerHandler(style.backgroundInternalProperty, ignorePropertyHandler, "Slider"); } } @@ -684,15 +690,14 @@ export class SwitchStyler implements definition.stylers.Styler { SwitchStyler.setColorProperty, SwitchStyler.resetColorProperty), "Switch"); - var borderHandler = new stylersCommon.StylePropertyChangedHandler( + style.registerHandler(style.backgroundColorProperty, new stylersCommon.StylePropertyChangedHandler( SwitchStyler.setBackgroundAndBorderProperty, - SwitchStyler.resetBackgroundAndBorderProperty); + SwitchStyler.resetBackgroundAndBorderProperty), "Switch"); - style.registerHandler(style.backgroundColorProperty, borderHandler, "Switch"); - style.registerHandler(style.borderWidthProperty, borderHandler, "Switch"); - style.registerHandler(style.borderColorProperty, borderHandler, "Switch"); - style.registerHandler(style.borderRadiusProperty, borderHandler, "Switch"); - style.registerHandler(style.backgroundInternalProperty, borderHandler, "Switch"); + style.registerHandler(style.borderWidthProperty, ignorePropertyHandler, "Switch"); + style.registerHandler(style.borderColorProperty, ignorePropertyHandler, "Switch"); + style.registerHandler(style.borderRadiusProperty, ignorePropertyHandler, "Switch"); + style.registerHandler(style.backgroundInternalProperty, ignorePropertyHandler, "Switch"); } }