|
7 | 7 | *************************************************************************************/
|
8 | 8 |
|
9 | 9 | var common = require("./fab-common");
|
10 |
| - var color = require("color"); |
| 10 | +var style = require("ui/styling/style"); |
| 11 | +var utils = require("utils/utils"); |
| 12 | +var color = require("color"); |
11 | 13 | var ImageSource = require("image-source");
|
12 | 14 |
|
13 | 15 | require("utils/module-merge").merge(common, module.exports);
|
|
51 | 53 |
|
52 | 54 | exports.Fab = FloatingActionButton;
|
53 | 55 |
|
| 56 | + |
| 57 | +/* SETUP CSS */ |
| 58 | +var FloatingActionButtonStyler = (function () { |
| 59 | + function FloatingActionButtonStyler() { |
| 60 | + } |
| 61 | + // BACKGROUND COLOR |
| 62 | + FloatingActionButtonStyler.setBackgroundColorProperty = function (view, newValue) { |
| 63 | + debugger; |
| 64 | + var fab = view.android; |
| 65 | + fab.setBackgroundTintList(android.content.res.ColorStateList.valueOf(newValue)); |
| 66 | + }; |
| 67 | + FloatingActionButtonStyler.resetBackgroundColorProperty = function (view, nativeValue) { |
| 68 | + debugger; |
| 69 | + var fab = view.android; |
| 70 | + fab.setBackgroundTintList(android.content.res.ColorStateList.valueOf(nativeValue)); |
| 71 | + }; |
| 72 | + FloatingActionButtonStyler.getNativeBackgroundColorValue = function (view) { |
| 73 | + debugger; |
| 74 | + var fab = view.android; |
| 75 | + return fab.getBackgroundTintList(); |
| 76 | + }; |
| 77 | + |
| 78 | + FloatingActionButtonStyler.registerHandlers = function () { |
| 79 | + style.registerHandler(style.backgroundColorProperty, new style.StylePropertyChangedHandler(FloatingActionButtonStyler.setBackgroundColorProperty, FloatingActionButtonStyler.resetBackgroundColorProperty, FloatingActionButtonStyler.getNativeBackgroundColorValue), "FloatingActionButton"); |
| 80 | + style.registerHandler(style.backgroundInternalProperty, style.ignorePropertyHandler, "FloatingActionButton"); |
| 81 | + }; |
| 82 | + return FloatingActionButtonStyler; |
| 83 | +})(); |
| 84 | +exports.FloatingActionButtonStyler = FloatingActionButtonStyler; |
| 85 | +FloatingActionButtonStyler.registerHandlers(); |
| 86 | + |
54 | 87 | /* SETUP PROPERTIES */
|
55 | 88 | //Background Color
|
56 | 89 | function onBackColorPropertyChanged(data) {
|
|
0 commit comments