-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBaseMaterialGreyCyanMobileTheme.as
5012 lines (4216 loc) · 197 KB
/
BaseMaterialGreyCyanMobileTheme.as
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Copyright 2015-2018 Marcel Piestansky
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
package feathers.themes {
import feathers.controls.Alert;
import feathers.controls.AutoComplete;
import feathers.controls.Button;
import feathers.controls.ButtonGroup;
import feathers.controls.ButtonState;
import feathers.controls.Callout;
import feathers.controls.Check;
import feathers.controls.DataGrid;
import feathers.controls.DateTimeSpinner;
import feathers.controls.Drawers;
import feathers.controls.GroupedList;
import feathers.controls.Header;
import feathers.controls.ImageLoader;
import feathers.controls.Label;
import feathers.controls.LayoutGroup;
import feathers.controls.List;
import feathers.controls.NumericStepper;
import feathers.controls.PageIndicator;
import feathers.controls.Panel;
import feathers.controls.PanelScreen;
import feathers.controls.PickerList;
import feathers.controls.ProgressBar;
import feathers.controls.Radio;
import feathers.controls.ScrollContainer;
import feathers.controls.ScrollPolicy;
import feathers.controls.ScrollText;
import feathers.controls.Scroller;
import feathers.controls.SimpleScrollBar;
import feathers.controls.Slider;
import feathers.controls.SpinnerList;
import feathers.controls.StepperButtonLayoutMode;
import feathers.controls.TabBar;
import feathers.controls.TabNavigator;
import feathers.controls.TextArea;
import feathers.controls.TextCallout;
import feathers.controls.TextInput;
import feathers.controls.TextInputState;
import feathers.controls.ToggleButton;
import feathers.controls.ToggleSwitch;
import feathers.controls.TrackLayoutMode;
import feathers.controls.Tree;
import feathers.controls.popups.DropDownPopUpContentManager;
import feathers.controls.popups.VerticalCenteredPopUpContentManager;
import feathers.controls.renderers.BaseDefaultItemRenderer;
import feathers.controls.renderers.DefaultDataGridCellRenderer;
import feathers.controls.renderers.DefaultDataGridHeaderRenderer;
import feathers.controls.renderers.DefaultGroupedListHeaderOrFooterRenderer;
import feathers.controls.renderers.DefaultGroupedListItemRenderer;
import feathers.controls.renderers.DefaultListItemRenderer;
import feathers.controls.renderers.DefaultTreeItemRenderer;
import feathers.controls.supportClasses.GroupedListDataViewPort;
import feathers.controls.supportClasses.ListDataViewPort;
import feathers.controls.text.StageTextTextEditor;
import feathers.controls.text.StageTextTextEditorViewPort;
import feathers.controls.text.TextBlockTextEditor;
import feathers.controls.text.TextBlockTextRenderer;
import feathers.core.FeathersControl;
import feathers.core.PopUpManager;
import feathers.layout.Direction;
import feathers.layout.HorizontalAlign;
import feathers.layout.HorizontalLayout;
import feathers.layout.RelativePosition;
import feathers.layout.VerticalAlign;
import feathers.media.FullScreenToggleButton;
import feathers.media.MuteToggleButton;
import feathers.media.PlayPauseToggleButton;
import feathers.media.SeekSlider;
import feathers.media.TimeLabel;
import feathers.media.VolumeSlider;
import feathers.skins.ImageSkin;
import feathers.system.DeviceCapabilities;
import feathers.text.FontStylesSet;
import flash.geom.Rectangle;
import starling.animation.Transitions;
import starling.display.Quad;
import starling.text.TextFormat;
import starling.core.Starling;
import starling.display.DisplayObject;
import starling.display.Image;
import starling.textures.Texture;
import starling.textures.TextureAtlas;
import starling.utils.Align;
/**
* Base class for "Material GreyCyan" mobile theme for Feathers. This class
* handles all the component skinning but does not load the theme assets therefore
* this class should not be used directly.
*
* <p>To use the theme with embedded assets, use either <code>MaterialGreyCyanMobileTheme</code> or <code>MaterialGreyCyanMobileThemeWithIcons</code>.<p>
* <p>To use the theme with assets loaded at runtime, choose either <code>MaterialGreyCyanMobileThemeWithAssetManager</code> or <code>MaterialGreyCyanMobileThemeWithAssetManagerAndIcons</code>
*/
public class BaseMaterialGreyCyanMobileTheme extends StyleNameFunctionTheme {
[Embed(source="/../assets/fonts/Roboto-Regular.ttf", fontFamily="Roboto", fontWeight="normal", mimeType="application/x-font", embedAsCFF="true")]
private static const ROBOTO_REGULAR:Class;
[Embed(source="/../assets/fonts/Roboto-Bold.ttf", fontFamily="Roboto", fontWeight="bold", mimeType="application/x-font", embedAsCFF="true")]
private static const ROBOTO_BOLD:Class;
public static const FONT_NAME:String = "Roboto";
/* Colors */
protected static const COLOR_UI_LIGHT:uint = 0xFFFFFF;
protected static const COLOR_UI_LIGHT_DISABLED:uint = 0xAAAAAA;
protected static const COLOR_UI_DARK:uint = 0x666666;
protected static const COLOR_UI_EXTRA_DARK:uint = 0;
protected static const COLOR_UI_DARK_DISABLED:uint = 0xAAAAAA;
protected static const COLOR_ACCENT:uint = 0x26C6DA;
protected static const COLOR_ACCENT_DARK:uint = 0x0097A7;
protected static const COLOR_ACCENT_DARK_50:uint = 0x99D5DC; // ACCENT_DARK with 50% opacity
protected static const COLOR_ACCENT_LIGHT:uint = 0xE8F9FB;
protected static const COLOR_BACKGROUND_LIGHT:uint = 0xFFFFFF;
protected static const ALPHA_MODAL_OVERLAY:Number = 0.8;
/* Scale 9 Grids */
protected static const BUTTON_SCALE9_GRID:Rectangle = new Rectangle( 8, 7, 1, 2 );
protected static const BUTTON_QUIET_SCALE9_GRID:Rectangle = new Rectangle( 2, 2, 1, 32 );
protected static const BUTTON_BACK_SCALE9_GRID:Rectangle = new Rectangle( 19.5, 5, 2, 29 );
protected static const BUTTON_FORWARD_SCALE9_GRID:Rectangle = new Rectangle( 4, 5, 1, 29 );
protected static const BUTTON_CALL_TO_ACTION_SCALE9_GRID:Rectangle = new Rectangle( 24.5, 23, 1, 1 );
protected static const TOGGLE_SWITCH_THUMB_SCALE9_GRID:Rectangle = new Rectangle( 11.5, 11.5, 1, 1 );
protected static const SLIDER_THUMB_SCALE9_GRID:Rectangle = new Rectangle( 12, 12, 1, 1 );
protected static const PROGRESS_BAR_SCALE9_GRID:Rectangle = new Rectangle( 1, 1, 2, 2 );
protected static const SLIDER_HORIZONTAL_SCALE9_GRID:Rectangle = new Rectangle( 0.5, 1, 2, 0.5 );
protected static const SLIDER_VERTICAL_SCALE9_GRID:Rectangle = new Rectangle( 1, 0.5, 0.5, 2 );
protected static const SEEK_SLIDER_SCALE9_GRID:Rectangle = new Rectangle( 0.5, 0.5, 1, 1 );
protected static const BACKGROUND_SCALE9_GRID:Rectangle = new Rectangle( 1, 1, 1, 1 );
protected static const HEADER_SHADOW_SCALE9_GRID:Rectangle = new Rectangle( 2, 10, 1, 58.5 );
protected static const INPUT_SCALE9_GRID:Rectangle = new Rectangle( 3, 3, 4, 44 );
protected static const TOGGLE_SWITCH_TRACK_SCALE9_GRID:Rectangle = new Rectangle( 6.5, 6.5, 22, 1 );
protected static const TAB_SCALE9_GRID:Rectangle = new Rectangle( 4, 10, 2, 11 );
protected static const TAB_SELECTION_SKIN_SCALE9_GRID:Rectangle = new Rectangle( 1, 1, 1, 1 );
protected static const BACKGROUND_POPUP_SCALE9_GRID:Rectangle = new Rectangle( 10, 10, 4, 11 );
protected static const ITEM_RENDERER_SCALE9_GRID:Rectangle = new Rectangle( 4, 4, 2, 42 );
protected static const DROP_DOWN_LIST_BACKGROUND_SCALE9_GRID:Rectangle = new Rectangle( 7, 7, 5, 11 );
protected static const SPINNER_LIST_OVERLAY_SCALE9_GRID:Rectangle = new Rectangle( 4, 4, 2, 42 );
protected static const DATE_TIME_SPINNER_BACKGROUND_SCALE9_GRID:Rectangle = new Rectangle( 2, 2, 6, 6 );
protected static const VERTICAL_SCROLL_BAR_SCALE9_GRID:Rectangle = new Rectangle( 0, 5, 3, 13 );
protected static const HORIZONTAL_SCROLL_BAR_SCALE9_GRID:Rectangle = new Rectangle( 5, 0, 13, 3 );
/* Dimensions */
protected static var mSmallPaddingSize:int;
protected static var mRegularPaddingSize:int;
protected static var mTrackSize:int;
protected static var mControlSize:int;
protected static var mSmallerControlSize:int;
protected static var mLargeControlSize:int;
protected static var mWideControlSize:int;
protected static var mHeaderSize:int;
protected static var mHeaderShadowSize:int;
/* Fonts */
protected static var mSmallFontSize:int;
protected static var mRegularFontSize:int;
protected static var mLargeFontSize:int;
protected static var mExtraLargeFontSize:int;
protected static var mLightRegularTF:TextFormat;
protected static var mLightRegularSmallTF:TextFormat;
protected static var mLightRegularSmallDisabledTF:TextFormat;
protected static var mDarkRegularTF:TextFormat;
protected static var mDarkRegularDisabledTF:TextFormat;
protected static var mDarkRegularSmallTF:TextFormat;
protected static var mDarkRegularSmallDisabledTF:TextFormat;
protected static var mDarkBoldTF:TextFormat;
protected static var mDarkBoldLargeTF:TextFormat;
protected static var mDarkBoldLargeDisabledTF:TextFormat;
protected static var mAccentBoldTF:TextFormat;
protected static var mAccentRegularTF:TextFormat;
protected static var mAccentRegularDarkTF:TextFormat;
protected static var mAccentRegularDisabledTF:TextFormat;
protected static var mAccentRegularDarkDisabledTF:TextFormat;
protected static var mTabUpTF:TextFormat;
/**
* The texture atlas that contains skins for this theme. This base class
* does not initialize this member variable. Subclasses are expected to
* load the assets somehow and set the <code>atlas</code> member
* variable before calling <code>initialize()</code>.
*/
protected static var mAtlas:TextureAtlas;
/* Textures */
protected static var mButtonPrimaryUpTexture:Texture;
protected static var mButtonPrimaryDownTexture:Texture;
protected static var mButtonPrimaryDisabledTexture:Texture;
protected static var mButtonPrimaryQuietDownTexture:Texture;
protected static var mButtonAccentUpTexture:Texture;
protected static var mButtonAccentDownTexture:Texture;
protected static var mButtonAccentDisabledTexture:Texture;
protected static var mButtonAccentQuietDownTexture:Texture;
protected static var mButtonBackUpTexture:Texture;
protected static var mButtonBackDownTexture:Texture;
protected static var mButtonBackDisabledTexture:Texture;
protected static var mButtonForwardUpTexture:Texture;
protected static var mButtonForwardDownTexture:Texture;
protected static var mButtonForwardDisabledTexture:Texture;
protected static var mButtonCallToActionPrimaryUpTexture:Texture;
protected static var mButtonCallToActionPrimaryDownTexture:Texture;
protected static var mButtonCallToActionPrimaryDisabledTexture:Texture;
protected static var mButtonCallToActionAccentUpTexture:Texture;
protected static var mButtonCallToActionAccentDownTexture:Texture;
protected static var mButtonCallToActionAccentDisabledTexture:Texture;
protected static var mButtonSelectedUpTexture:Texture;
protected static var mButtonSelectedDisabledTexture:Texture;
protected static var mButtonHeaderQuietDownTexture:Texture;
protected static var mToggleSwitchThumbOnTexture:Texture;
protected static var mToggleSwitchThumbOffTexture:Texture;
protected static var mToggleSwitchThumbDisabledTexture:Texture;
protected static var mSliderHorizontalFillTexture:Texture;
protected static var mSliderHorizontalBackgroundTexture:Texture;
protected static var mSliderHorizontalBackgroundDisabledTexture:Texture;
protected static var mSliderVerticalFillTexture:Texture;
protected static var mSliderVerticalBackgroundTexture:Texture;
protected static var mSliderVerticalBackgroundDisabledTexture:Texture;
protected static var mCheckUpIconTexture:Texture;
protected static var mCheckSelectedUpIconTexture:Texture;
protected static var mCheckDownIconTexture:Texture;
protected static var mCheckDisabledIconTexture:Texture;
protected static var mCheckSelectedDownIconTexture:Texture;
protected static var mCheckSelectedDisabledIconTexture:Texture;
protected static var mRadioUpIconTexture:Texture;
protected static var mRadioSelectedUpIconTexture:Texture;
protected static var mRadioDownIconTexture:Texture;
protected static var mRadioDisabledIconTexture:Texture;
protected static var mRadioSelectedDownIconTexture:Texture;
protected static var mRadioSelectedDisabledIconTexture:Texture;
protected static var mProgressBarFillTexture:Texture;
protected static var mProgressBarBackgroundTexture:Texture;
protected static var mProgressBarBackgroundDisabledTexture:Texture;
protected static var mHeaderBackgroundTexture:Texture;
protected static var mBackgroundToolbarTexture:Texture;
protected static var mHeaderShadowBackgroundTexture:Texture;
protected static var mVerticalScrollBarTexture:Texture;
protected static var mHorizontalScrollBarTexture:Texture;
protected static var mTabUpTexture:Texture;
protected static var mTabDownTexture:Texture;
protected static var mTabInvertedUpTexture:Texture;
protected static var mTabInvertedDownTexture:Texture;
protected static var mTextInputUpTexture:Texture;
protected static var mTextInputFocusedTexture:Texture;
protected static var mSearchIconUpTexture:Texture;
protected static var mSearchIconFocusedTexture:Texture;
protected static var mBackgroundPopUpTexture:Texture;
protected static var mBackgroundPlainTexture:Texture;
protected static var mBackgroundDrawersTexture:Texture;
protected static var mCalloutUpArrowTexture:Texture;
protected static var mCalloutRightArrowTexture:Texture;
protected static var mCalloutDownArrowTexture:Texture;
protected static var mCalloutLeftArrowTexture:Texture;
protected static var mToggleSwitchTrackOnTexture:Texture;
protected static var mToggleSwitchTrackOffTexture:Texture;
protected static var mToggleSwitchTrackDisabledTexture:Texture;
protected static var mListItemRendererUpTexture:Texture;
protected static var mListItemRendererDownTexture:Texture;
protected static var mListItemRendererSelectedTexture:Texture;
protected static var mDropDownListItemRendererDownTexture:Texture;
protected static var mDropDownListItemRendererSelectedTexture:Texture;
protected static var mGroupedListHeaderTexture:Texture;
protected static var mPickerListButtonIcon:Texture;
protected static var mPickerListButtonDisabledIcon:Texture;
protected static var mDropDownListBackgroundTexture:Texture;
protected static var mSpinnerListSelectionOverlayTexture:Texture;
protected static var mDateTimeSpinnerBackgroundTexture:Texture;
protected static var mPageIndicatorNormalTexture:Texture;
protected static var mPageIndicatorSelectedTexture:Texture;
protected static var mTreeDisclosureOpenIconTexture:Texture;
protected static var mTreeDisclosureClosedIconTexture:Texture;
protected static var mDataGridHeaderSortAscendingIconTexture:Texture;
protected static var mDataGridHeaderSortDescendingIconTexture:Texture;
/* Media controls */
protected static var mPlayIconTexture:Texture;
protected static var mPauseIconTexture:Texture;
protected static var mVolumeUpIconTexture:Texture;
protected static var mVolumeDownIconTexture:Texture;
protected static var mVolumeSliderMinTrackTexture:Texture;
protected static var mVolumeSliderMaxTrackTexture:Texture;
protected static var mFullScreenEnterIconTexture:Texture;
protected static var mFullScreenExitIconTexture:Texture;
protected static var mSeekSliderFillTexture:Texture;
protected static var mSeekSliderBackgroundTexture:Texture;
/* Public name list */
public static const THEME_STYLE_NAME_BUTTON_ACCENT:String = "material-grey-cyan-mobile-button-accent";
public static const THEME_STYLE_NAME_BUTTON_ACCENT_QUIET:String = "material-grey-cyan-mobile-button-accent-quiet";
public static const THEME_STYLE_NAME_BUTTON_HEADER_QUIET:String = "material-grey-cyan-mobile-button-header-quiet";
public static const THEME_STYLE_NAME_BUTTON_HEADER_QUIET_ICON_ONLY:String = "material-grey-cyan-mobile-button-header-quiet-icon-only";
public static const THEME_STYLE_NAME_CALL_TO_ACTION_BUTTON_ACCENT:String = "material-grey-cyan-mobile-call-to-action-button-accent";
public static const THEME_STYLE_NAME_PANEL_WITHOUT_PADDING:String = "material-grey-cyan-mobile-panel-without-padding";
public static const THEME_STYLE_NAME_HEADER_WITH_SHADOW:String = "material-grey-cyan-mobile-header-with-shadow";
public static const THEME_STYLE_NAME_TAB_BAR_SHADOW_BOTTOM:String = "material-grey-cyan-mobile-tab-bar-shadow-bottom";
public static const THEME_STYLE_NAME_TAB_BAR_WITH_ICONS:String = "material-grey-cyan-mobile-tab-bar-with-icons";
public static const THEME_STYLE_NAME_TAB_NAVIGATOR_WITH_ICONS:String = "material-grey-cyan-mobile-tab-navigator-with-icons";
public static const THEME_STYLE_NAME_TAB_NAVIGATOR_SHADOW_BOTTOM:String = "material-grey-cyan-mobile-tab-navigator-shadow-bottom";
/* Protected name list */
protected static const THEME_STYLE_NAME_TAB_NAVIGATOR_TAB_BAR_WITH_ICONS_SHADOW_BOTTOM:String = "material-grey-cyan-mobile-tab-navigator-tab-bar-with-icons-shadow-bottom";
protected static const THEME_STYLE_NAME_ACCENT_QUIET_BUTTON_LABEL:String = "material-grey-cyan-mobile-accent-quiet-button-label";
protected static const THEME_STYLE_NAME_TAB_SHADOW_BOTTOM:String = "material-grey-cyan-mobile-tab-shadow-bottom";
protected static const THEME_STYLE_NAME_TAB_WITH_ICON:String = "material-grey-cyan-mobile-tab-with-icon";
protected static const THEME_STYLE_NAME_TAB_SHADOW_BOTTOM_WITH_ICON:String = "material-grey-cyan-mobile-tab-shadow-bottom-with-icon";
protected static const THEME_STYLE_NAME_VERTICAL_SIMPLE_SCROLL_BAR_THUMB:String = "material-grey-cyan-mobile-vertical-simple-scroll-bar-thumb";
protected static const THEME_STYLE_NAME_HORIZONTAL_SIMPLE_SCROLL_BAR_THUMB:String = "material-grey-cyan-mobile-horizontal-simple-scroll-bar-thumb";
protected static const THEME_STYLE_NAME_HORIZONTAL_SLIDER_MINIMUM_TRACK:String = "material-grey-cyan-mobile-horizontal-slider-minimum-track";
protected static const THEME_STYLE_NAME_HORIZONTAL_SLIDER_MAXIMUM_TRACK:String = "material-grey-cyan-mobile-horizontal-slider-maximum-track";
protected static const THEME_STYLE_NAME_VERTICAL_SLIDER_MINIMUM_TRACK:String = "material-grey-cyan-mobile-vertical-slider-minimum-track";
protected static const THEME_STYLE_NAME_VERTICAL_SLIDER_MAXIMUM_TRACK:String = "material-grey-cyan-mobile-vertical-slider-maximum-track";
protected static const THEME_STYLE_NAME_ALERT_BUTTON_GROUP_BUTTON:String = "material-grey-cyan-mobile-alert-button-group-button";
protected static const THEME_STYLE_NAME_ALERT_HEADER:String = "material-grey-cyan-mobile-alert-header";
protected static const THEME_STYLE_NAME_GROUPED_LIST_LAST_ITEM_RENDERER:String = "material-grey-cyan-mobile-grouped-list-last-item-renderer";
protected static const THEME_STYLE_NAME_DROP_DOWN_LIST_ITEM_RENDERER:String = "material-grey-cyan-mobile-picker-list-item-renderer";
protected static const THEME_STYLE_NAME_SPINNER_LIST_ITEM_RENDERER:String = "material-grey-cyan-mobile-spinner-list-item-renderer";
protected static const THEME_STYLE_NAME_DATE_TIME_SPINNER_LIST_ITEM_RENDERER:String = "material-grey-cyan-mobile-date-time-spinner-list-item-renderer";
public function BaseMaterialGreyCyanMobileTheme() {
super();
}
/**
*
*
* Initializers
*
*
*/
/**
* Initializes the theme. Expected to be called by subclasses after the
* assets have been loaded and the skin texture atlas has been created.
*/
protected function initialize():void {
initializeDimensions();
initializeFonts();
initializeTextures();
initializeGlobals();
initializeStage();
initializeStyleProviders();
}
protected function initializeStage():void {
Starling.current.stage.color = COLOR_BACKGROUND_LIGHT;
Starling.current.nativeStage.color = COLOR_BACKGROUND_LIGHT;
}
protected function initializeDimensions():void {
mSmallPaddingSize = 10;
mRegularPaddingSize = 20;
mTrackSize = 4;
mSmallerControlSize = 37.5;
mControlSize = 39;
mLargeControlSize = 50;
mWideControlSize = 60;
mHeaderSize = 50;
mHeaderShadowSize = 58.5;
}
protected function initializeTextures():void {
/* Animation related textures */
RadialEffectPool.mRadialEffectTexture =
PrimaryRadialEffectPool.mRadialEffectTexture = mAtlas.getTexture( "radial-effect" )
AccentRadialEffectPool.mRadialEffectTexture = mAtlas.getTexture( "radial-effect-accent" );
ToggleRadialEffectPool.mRadialEffectOnTexture = mAtlas.getTexture( "radial-effect-toggle-on" );
ToggleRadialEffectPool.mRadialEffectOffTexture = mAtlas.getTexture( "radial-effect-toggle-off" );
/* Background */
mBackgroundPlainTexture = mAtlas.getTexture( "background-plain" );
mBackgroundPopUpTexture = mAtlas.getTexture( "background-shadow" );
mBackgroundToolbarTexture = mAtlas.getTexture( "toolbar-background-translucent" );
mBackgroundDrawersTexture = mAtlas.getTexture( "background-drawers" );
mDropDownListBackgroundTexture = mAtlas.getTexture( "picker-list-list-background" );
mDateTimeSpinnerBackgroundTexture = mAtlas.getTexture( "date-time-spinner-background" );
/* Button */
mButtonPrimaryUpTexture = mAtlas.getTexture( "button-primary-up" );
mButtonPrimaryDownTexture = mAtlas.getTexture( "button-primary-down" );
mButtonPrimaryDisabledTexture = mAtlas.getTexture( "button-primary-disabled" );
mButtonPrimaryQuietDownTexture = mAtlas.getTexture( "button-primary-quiet-down" );
mButtonAccentUpTexture = mAtlas.getTexture( "button-accent-up" );
mButtonAccentDownTexture = mAtlas.getTexture( "button-accent-down" );
mButtonAccentDisabledTexture = mAtlas.getTexture( "button-accent-disabled" );
mButtonAccentQuietDownTexture = mAtlas.getTexture( "button-accent-quiet-down" );
mButtonSelectedUpTexture = mAtlas.getTexture( "button-selected-up" );
mButtonSelectedDisabledTexture = mAtlas.getTexture( "button-selected-disabled" );
mButtonHeaderQuietDownTexture = mAtlas.getTexture( "button-header-quiet-down" );
mButtonCallToActionPrimaryUpTexture = mAtlas.getTexture( "button-call-to-action-primary-up" );
mButtonCallToActionPrimaryDownTexture = mAtlas.getTexture( "button-call-to-action-primary-down" );
mButtonCallToActionPrimaryDisabledTexture = mAtlas.getTexture( "button-call-to-action-primary-disabled" );
mButtonCallToActionAccentUpTexture = mAtlas.getTexture( "button-call-to-action-accent-up" );
mButtonCallToActionAccentDownTexture = mAtlas.getTexture( "button-call-to-action-accent-down" );
mButtonCallToActionAccentDisabledTexture = mAtlas.getTexture( "button-call-to-action-accent-disabled" );
mButtonBackUpTexture = mAtlas.getTexture( "button-back-up" );
mButtonBackDownTexture = mAtlas.getTexture( "button-back-down" );
mButtonBackDisabledTexture = mAtlas.getTexture( "button-back-disabled" );
mButtonForwardUpTexture = mAtlas.getTexture( "button-forward-up" );
mButtonForwardDownTexture = mAtlas.getTexture( "button-forward-down" );
mButtonForwardDisabledTexture = mAtlas.getTexture( "button-forward-disabled" );
/* Callout */
mCalloutUpArrowTexture = mAtlas.getTexture( "callout-arrow-up" );
mCalloutRightArrowTexture = mAtlas.getTexture( "callout-arrow-right" );
mCalloutDownArrowTexture = mAtlas.getTexture( "callout-arrow-down" );
mCalloutLeftArrowTexture = mAtlas.getTexture( "callout-arrow-left" );
/* Check */
mCheckUpIconTexture = mAtlas.getTexture( "check-up-icon" );
mCheckDownIconTexture = mAtlas.getTexture( "check-down-icon" );
mCheckDisabledIconTexture = mAtlas.getTexture( "check-disabled-icon" );
mCheckSelectedUpIconTexture = mAtlas.getTexture( "check-selected-up-icon" );
mCheckSelectedDownIconTexture = mAtlas.getTexture( "check-selected-down-icon" );
mCheckSelectedDisabledIconTexture = mAtlas.getTexture( "check-selected-disabled-icon" );
/* Data grid */
mDataGridHeaderSortAscendingIconTexture = mAtlas.getTexture( "data-grid-header-sort-ascending" );
mDataGridHeaderSortDescendingIconTexture = mAtlas.getTexture( "data-grid-header-sort-descending" );
/* Dropdown List */
mDropDownListItemRendererDownTexture = mAtlas.getTexture( "list-drop-down-item-down" );
mDropDownListItemRendererSelectedTexture = mAtlas.getTexture( "list-drop-down-item-selected" );
// Drop down list up texture is provided by mBackgroundPlainTexture
/* Header */
mHeaderBackgroundTexture = mAtlas.getTexture( "background-header" );
mHeaderShadowBackgroundTexture = mAtlas.getTexture( "background-header-shadow" );
/* List / GroupedList / Item renderers */
mListItemRendererUpTexture = mAtlas.getTexture( "list-item-up" );
mListItemRendererDownTexture = mAtlas.getTexture( "list-item-down" );
mListItemRendererSelectedTexture = mAtlas.getTexture( "list-item-selected" );
mGroupedListHeaderTexture = mAtlas.getTexture( "grouped-list-header" );
/* Page indicator */
mPageIndicatorNormalTexture = mAtlas.getTexture( "toggle-switch-thumb-off" );
mPageIndicatorSelectedTexture = mAtlas.getTexture( "toggle-switch-thumb-on" );
PageIndicatorRadialAnimationManager.mSelectedSymbolTexture = mPageIndicatorSelectedTexture;
/* Picker list */
mPickerListButtonIcon = mAtlas.getTexture( "picker-list-button-icon" );
mPickerListButtonDisabledIcon = mAtlas.getTexture( "picker-list-button-disabled-icon" );
/* ProgressBar */
mProgressBarFillTexture = mAtlas.getTexture( "progress-bar-fill" );
mProgressBarBackgroundTexture = mAtlas.getTexture( "progress-bar-background" );
mProgressBarBackgroundDisabledTexture = mAtlas.getTexture( "progress-bar-background-disabled" );
/* Slider */
mSliderHorizontalFillTexture = mAtlas.getTexture( "slider-fill-horizontal" );
mSliderHorizontalBackgroundTexture = mAtlas.getTexture( "slider-background-horizontal" );
mSliderHorizontalBackgroundDisabledTexture = mAtlas.getTexture( "slider-background-disabled-horizontal" );
mSliderVerticalFillTexture = mAtlas.getTexture( "slider-fill-vertical" );
mSliderVerticalBackgroundTexture = mAtlas.getTexture( "slider-background-vertical" );
mSliderVerticalBackgroundDisabledTexture = mAtlas.getTexture( "slider-background-disabled-vertical" );
AnimatedSliderThumb.mUpTexture = mAtlas.getTexture( "slider-thumb-up" );
AnimatedSliderThumb.mDownTexture = mAtlas.getTexture( "slider-thumb-down" );
AnimatedSliderThumb.mDisabledTexture = mAtlas.getTexture( "slider-thumb-disabled" );
AnimatedSliderThumb.mThumbScale9Grid = SLIDER_THUMB_SCALE9_GRID;
/* Radio */
mRadioUpIconTexture = mAtlas.getTexture( "radio-up-icon" );
mRadioDownIconTexture = mAtlas.getTexture( "radio-down-icon" );
mRadioDisabledIconTexture = mAtlas.getTexture( "radio-disabled-icon" );
mRadioSelectedUpIconTexture = mAtlas.getTexture( "radio-selected-up-icon" );
mRadioSelectedDownIconTexture = mAtlas.getTexture( "radio-selected-down-icon" );
mRadioSelectedDisabledIconTexture = mAtlas.getTexture( "radio-selected-disabled-icon" );
/* Scroll bar */
mVerticalScrollBarTexture = mAtlas.getTexture( "scroll-bar-vertical" );
mHorizontalScrollBarTexture = mAtlas.getTexture( "scroll-bar-horizontal" );
/* Spinner list */
mSpinnerListSelectionOverlayTexture = mAtlas.getTexture( "spinner-list-selection-overlay" );
/* TabBar */
mTabUpTexture = mAtlas.getTexture( "tab-up" );
mTabDownTexture = mAtlas.getTexture( "tab-down" );
mTabInvertedUpTexture = mAtlas.getTexture( "tab-inverted-up" );
mTabInvertedDownTexture = mAtlas.getTexture( "tab-inverted-down" );
/* Text & search inputs */
mTextInputUpTexture = mAtlas.getTexture( "text-input-up" );
mTextInputFocusedTexture = mAtlas.getTexture( "text-input-focused" );
mSearchIconUpTexture = mAtlas.getTexture( "search-input-icon-up" );
mSearchIconFocusedTexture = mAtlas.getTexture( "search-input-icon-focused" );
/* ToggleSwitch */
mToggleSwitchTrackOnTexture = mAtlas.getTexture( "toggle-switch-track-on" );
mToggleSwitchTrackOffTexture = mAtlas.getTexture( "toggle-switch-track-off" );
mToggleSwitchTrackDisabledTexture = mAtlas.getTexture( "toggle-switch-track-disabled" );
mToggleSwitchThumbOnTexture = mAtlas.getTexture( "toggle-switch-thumb-on" );
mToggleSwitchThumbOffTexture = mAtlas.getTexture( "toggle-switch-thumb-off" );
mToggleSwitchThumbDisabledTexture = mAtlas.getTexture( "toggle-switch-thumb-disabled" );
/* Tree */
mTreeDisclosureOpenIconTexture = mAtlas.getTexture( "tree-disclosure-open-icon" );
mTreeDisclosureClosedIconTexture = mAtlas.getTexture( "tree-disclosure-closed-icon" );
/* Media controls */
mPlayIconTexture = mAtlas.getTexture( "play-button-icon" );
mPauseIconTexture = mAtlas.getTexture( "pause-button-icon" );
mFullScreenEnterIconTexture = mAtlas.getTexture( "full-screen-enter-icon" );
mFullScreenExitIconTexture = mAtlas.getTexture( "full-screen-exit-icon" );
mVolumeUpIconTexture = mAtlas.getTexture( "volume-up-icon" );
mVolumeDownIconTexture = mAtlas.getTexture( "volume-down-icon" );
mVolumeSliderMinTrackTexture = mAtlas.getTexture( "volume-slider-min-track" );
mVolumeSliderMaxTrackTexture = mAtlas.getTexture( "volume-slider-max-track" );
AnimatedSeekSliderThumb.mUpTexture = mAtlas.getTexture( "seek-slider-thumb-up" );
AnimatedSeekSliderThumb.mDownTexture = mAtlas.getTexture( "seek-slider-thumb-down" );
AnimatedSeekSliderThumb.mDisabledTexture = mAtlas.getTexture( "seek-slider-thumb-down" );
mSeekSliderFillTexture = mAtlas.getTexture( "seek-slider-fill" );
mSeekSliderBackgroundTexture = mAtlas.getTexture( "seek-slider-background" );
}
protected function initializeFonts():void {
mSmallFontSize = 10;
mRegularFontSize = 14;
mLargeFontSize = 20;
mExtraLargeFontSize = 25;
/* UI */
mLightRegularTF = getTextFormat( mRegularFontSize, COLOR_UI_LIGHT );
mLightRegularSmallTF = getTextFormat( mSmallFontSize, COLOR_UI_LIGHT );
mLightRegularSmallDisabledTF = getTextFormat( mSmallFontSize, COLOR_UI_LIGHT_DISABLED );
mDarkRegularTF = getTextFormat( mRegularFontSize, COLOR_UI_DARK );
mDarkRegularDisabledTF = getTextFormat( mRegularFontSize, COLOR_UI_DARK_DISABLED );
mDarkRegularSmallTF = getTextFormat( mSmallFontSize, COLOR_UI_DARK );
mDarkRegularSmallDisabledTF = getTextFormat( mSmallFontSize, COLOR_UI_DARK_DISABLED );
mDarkBoldTF = getTextFormat( mRegularFontSize, COLOR_UI_EXTRA_DARK, true );
mDarkBoldLargeTF = getTextFormat( mLargeFontSize, COLOR_UI_EXTRA_DARK, true );
mDarkBoldLargeDisabledTF = getTextFormat( mLargeFontSize, COLOR_UI_DARK_DISABLED, true );
mAccentBoldTF = getTextFormat( mRegularFontSize, COLOR_ACCENT, true );
mAccentRegularTF = getTextFormat( mRegularFontSize, COLOR_ACCENT );
mAccentRegularDarkTF = getTextFormat( mRegularFontSize, COLOR_ACCENT_DARK );
mAccentRegularDisabledTF = getTextFormat( mRegularFontSize, COLOR_ACCENT_LIGHT );
mAccentRegularDarkDisabledTF = getTextFormat( mRegularFontSize, COLOR_ACCENT_DARK_50 );
mTabUpTF = getTextFormat( mRegularFontSize, 0x757575 );
}
protected function initializeGlobals():void {
FeathersControl.defaultTextEditorFactory = textEditorFactory;
FeathersControl.defaultTextRendererFactory = textRendererFactory;
PopUpManager.overlayFactory = popUpOverlayFactory;
}
protected function initializeStyleProviders():void {
/* Alert */
getStyleProviderForClass( Alert ).defaultStyleFunction = setAlertStyles;
getStyleProviderForClass( ButtonGroup ).setFunctionForStyleName( Alert.DEFAULT_CHILD_STYLE_NAME_BUTTON_GROUP, setAlertButtonGroupStyles );
getStyleProviderForClass( Button ).setFunctionForStyleName( THEME_STYLE_NAME_ALERT_BUTTON_GROUP_BUTTON, setAlertButtonGroupButtonStyles );
getStyleProviderForClass( Header ).setFunctionForStyleName( THEME_STYLE_NAME_ALERT_HEADER, setAlertHeaderStyles );
/* AutoComplete */
getStyleProviderForClass( AutoComplete ).defaultStyleFunction = setTextInputStyles;
getStyleProviderForClass( AutoComplete ).setFunctionForStyleName( TextInput.ALTERNATE_STYLE_NAME_SEARCH_TEXT_INPUT, setSearchTextInputStyles );
getStyleProviderForClass( List ).setFunctionForStyleName( AutoComplete.DEFAULT_CHILD_STYLE_NAME_LIST, setAutoCompleteListStyles );
/* Buttons */
getStyleProviderForClass( Button ).defaultStyleFunction = setButtonStyles;
getStyleProviderForClass( Button ).setFunctionForStyleName( Button.ALTERNATE_STYLE_NAME_QUIET_BUTTON, setPrimaryQuietButtonStyles );
getStyleProviderForClass( Button ).setFunctionForStyleName( THEME_STYLE_NAME_BUTTON_ACCENT_QUIET, setAccentQuietButtonStyles );
getStyleProviderForClass( Button ).setFunctionForStyleName( THEME_STYLE_NAME_BUTTON_HEADER_QUIET, setHeaderQuietButtonStyles );
getStyleProviderForClass( Button ).setFunctionForStyleName( THEME_STYLE_NAME_BUTTON_HEADER_QUIET_ICON_ONLY, setHeaderQuietButtonIconOnlyStyles );
getStyleProviderForClass( Button ).setFunctionForStyleName( THEME_STYLE_NAME_BUTTON_ACCENT, setAccentButtonStyles );
getStyleProviderForClass( Button ).setFunctionForStyleName( THEME_STYLE_NAME_CALL_TO_ACTION_BUTTON_ACCENT, setCallToActionAccentButtonStyles );
getStyleProviderForClass( Button ).setFunctionForStyleName( Button.ALTERNATE_STYLE_NAME_CALL_TO_ACTION_BUTTON, setCallToActionPrimaryButtonStyles );
getStyleProviderForClass( Button ).setFunctionForStyleName( Button.ALTERNATE_STYLE_NAME_BACK_BUTTON, setBackButtonStyles );
getStyleProviderForClass( Button ).setFunctionForStyleName( Button.ALTERNATE_STYLE_NAME_FORWARD_BUTTON, setForwardButtonStyles );
getStyleProviderForClass( ToggleButton ).defaultStyleFunction = setButtonStyles;
getStyleProviderForClass( ToggleButton ).setFunctionForStyleName( Button.ALTERNATE_STYLE_NAME_QUIET_BUTTON, setPrimaryQuietButtonStyles );
getStyleProviderForClass( ToggleButton ).setFunctionForStyleName( THEME_STYLE_NAME_BUTTON_ACCENT_QUIET, setAccentQuietButtonStyles );
/* ButtonGroup */
getStyleProviderForClass( ButtonGroup ).defaultStyleFunction = setButtonGroupStyles;
getStyleProviderForClass( Button ).setFunctionForStyleName( ButtonGroup.DEFAULT_CHILD_STYLE_NAME_BUTTON, setButtonStyles );
getStyleProviderForClass( ToggleButton ).setFunctionForStyleName( ButtonGroup.DEFAULT_CHILD_STYLE_NAME_BUTTON, setButtonStyles );
/* Callout */
getStyleProviderForClass( Callout ).defaultStyleFunction = setCalloutStyles;
/* Check */
getStyleProviderForClass( Check ).defaultStyleFunction = setCheckStyles;
/* DataGrid */
getStyleProviderForClass( DataGrid ).defaultStyleFunction = setDataGridStyles;
getStyleProviderForClass( DefaultDataGridCellRenderer ).defaultStyleFunction = setDataGridCellRendererStyles;
getStyleProviderForClass( DefaultDataGridHeaderRenderer ).defaultStyleFunction = setDataGridHeaderStyles;
/* DateTimeSpinner */
getStyleProviderForClass( DateTimeSpinner ).defaultStyleFunction = setDateTimeSpinnerStyles;
getStyleProviderForClass( SpinnerList ).setFunctionForStyleName( DateTimeSpinner.DEFAULT_CHILD_STYLE_NAME_LIST, setDateTimeSpinnerListStyles );
getStyleProviderForClass( DefaultListItemRenderer ).setFunctionForStyleName( THEME_STYLE_NAME_DATE_TIME_SPINNER_LIST_ITEM_RENDERER, setDateTimeSpinnerListItemRendererStyles );
/* Drawers */
getStyleProviderForClass( Drawers ).defaultStyleFunction = setDrawersStyles;
/* GroupedList*/
getStyleProviderForClass( GroupedList ).defaultStyleFunction = setGroupedListStyles;
/* Header */
getStyleProviderForClass( Header ).defaultStyleFunction = setHeaderStyles;
/* Label */
getStyleProviderForClass( Label ).defaultStyleFunction = setLabelStyles;
getStyleProviderForClass( Label ).setFunctionForStyleName( Label.ALTERNATE_STYLE_NAME_HEADING, setHeadingLabelStyles );
getStyleProviderForClass( Label ).setFunctionForStyleName( Label.ALTERNATE_STYLE_NAME_DETAIL, setDetailLabelStyles );
/* LayoutGroup */
getStyleProviderForClass( LayoutGroup ).setFunctionForStyleName( LayoutGroup.ALTERNATE_STYLE_NAME_TOOLBAR, setLayoutGroupToolbarStyles );
/* List / Item renderers */
getStyleProviderForClass( List ).defaultStyleFunction = setListStyles;
getStyleProviderForClass( DefaultListItemRenderer ).defaultStyleFunction = setItemRendererStyles;
getStyleProviderForClass( DefaultGroupedListItemRenderer ).defaultStyleFunction = setItemRendererStyles;
getStyleProviderForClass( DefaultListItemRenderer ).setFunctionForStyleName( THEME_STYLE_NAME_DROP_DOWN_LIST_ITEM_RENDERER, setPickerListItemRendererStyles );
/* GroupedList header / footer */
getStyleProviderForClass( DefaultGroupedListHeaderOrFooterRenderer ).defaultStyleFunction = setGroupedListHeaderRendererStyles;
getStyleProviderForClass( DefaultGroupedListHeaderOrFooterRenderer ).setFunctionForStyleName( GroupedList.DEFAULT_CHILD_STYLE_NAME_FOOTER_RENDERER, setGroupedListFooterRendererStyles );
/* Numeric stepper */
getStyleProviderForClass( NumericStepper ).defaultStyleFunction = setNumericStepperStyles;
getStyleProviderForClass( TextInput ).setFunctionForStyleName( NumericStepper.DEFAULT_CHILD_STYLE_NAME_TEXT_INPUT, setNumericStepperTextInputStyles );
getStyleProviderForClass( Button ).setFunctionForStyleName( NumericStepper.DEFAULT_CHILD_STYLE_NAME_DECREMENT_BUTTON, setNumericStepperButtonStyles );
getStyleProviderForClass( Button ).setFunctionForStyleName( NumericStepper.DEFAULT_CHILD_STYLE_NAME_INCREMENT_BUTTON, setNumericStepperButtonStyles );
/* Page indicator */
getStyleProviderForClass( PageIndicator ).defaultStyleFunction = setPageIndicatorStyles;
/* Panel */
getStyleProviderForClass( Panel ).defaultStyleFunction = setPanelWithPaddingStyles;
getStyleProviderForClass( Panel ).setFunctionForStyleName( THEME_STYLE_NAME_HEADER_WITH_SHADOW, setPanelWithShadowStyles );
getStyleProviderForClass( Panel ).setFunctionForStyleName( THEME_STYLE_NAME_PANEL_WITHOUT_PADDING, setBasePanelStyles );
getStyleProviderForClass( Header ).setFunctionForStyleName( Panel.DEFAULT_CHILD_STYLE_NAME_HEADER, setHeaderWithoutBackgroundStyles );
/* Panel screen */
getStyleProviderForClass( PanelScreen ).defaultStyleFunction = setPanelWithPaddingStyles;
getStyleProviderForClass( PanelScreen ).setFunctionForStyleName( THEME_STYLE_NAME_PANEL_WITHOUT_PADDING, setBasePanelStyles );
getStyleProviderForClass( PanelScreen ).setFunctionForStyleName( THEME_STYLE_NAME_HEADER_WITH_SHADOW, setPanelWithShadowStyles );
getStyleProviderForClass( Header ).setFunctionForStyleName( PanelScreen.DEFAULT_CHILD_STYLE_NAME_HEADER, setPanelScreenHeaderStyles );
getStyleProviderForClass( Header ).setFunctionForStyleName( THEME_STYLE_NAME_HEADER_WITH_SHADOW, setPanelScreenHeaderWithShadowStyles );
/* Picker list */
getStyleProviderForClass( List ).setFunctionForStyleName( PickerList.DEFAULT_CHILD_STYLE_NAME_LIST, setPickerListListStyles );
getStyleProviderForClass( PickerList ).defaultStyleFunction = setPickerListStyles;
getStyleProviderForClass( Button ).setFunctionForStyleName( PickerList.DEFAULT_CHILD_STYLE_NAME_BUTTON, setPickerListButtonStyles );
/* Progress bar */
getStyleProviderForClass( ProgressBar ).defaultStyleFunction = setProgressBarStyles;
/* Radio */
getStyleProviderForClass( Radio ).defaultStyleFunction = setRadioStyles;
/* Scroll container */
getStyleProviderForClass( ScrollContainer ).defaultStyleFunction = setScrollContainerStyles;
getStyleProviderForClass( ScrollContainer ).setFunctionForStyleName( ScrollContainer.ALTERNATE_STYLE_NAME_TOOLBAR, setToolbarScrollContainerStyles );
/* Scroll text */
getStyleProviderForClass( ScrollText ).defaultStyleFunction = setScrollTextStyles;
/* Simple scroll bar */
getStyleProviderForClass( SimpleScrollBar ).defaultStyleFunction = setSimpleScrollBarStyles;
getStyleProviderForClass( Button ).setFunctionForStyleName( THEME_STYLE_NAME_VERTICAL_SIMPLE_SCROLL_BAR_THUMB, setVerticalSimpleScrollBarThumbStyles );
getStyleProviderForClass( Button ).setFunctionForStyleName( THEME_STYLE_NAME_HORIZONTAL_SIMPLE_SCROLL_BAR_THUMB, setHorizontalSimpleScrollBarThumbStyles );
/* Slider */
getStyleProviderForClass( Slider ).defaultStyleFunction = setSliderStyles;
getStyleProviderForClass( Button ).setFunctionForStyleName( Slider.DEFAULT_CHILD_STYLE_NAME_THUMB, setSliderThumbStyles );
getStyleProviderForClass( Button ).setFunctionForStyleName( THEME_STYLE_NAME_HORIZONTAL_SLIDER_MINIMUM_TRACK, setHorizontalSliderMinimumTrackStyles );
getStyleProviderForClass( Button ).setFunctionForStyleName( THEME_STYLE_NAME_HORIZONTAL_SLIDER_MAXIMUM_TRACK, setHorizontalSliderMaximumTrackStyles );
getStyleProviderForClass( Button ).setFunctionForStyleName( THEME_STYLE_NAME_VERTICAL_SLIDER_MINIMUM_TRACK, setVerticalSliderMinimumTrackStyles );
getStyleProviderForClass( Button ).setFunctionForStyleName( THEME_STYLE_NAME_VERTICAL_SLIDER_MAXIMUM_TRACK, setVerticalSliderMaximumTrackStyles );
/* Spinner list */
getStyleProviderForClass( SpinnerList ).defaultStyleFunction = setSpinnerListStyles;
getStyleProviderForClass( DefaultListItemRenderer ).setFunctionForStyleName( THEME_STYLE_NAME_SPINNER_LIST_ITEM_RENDERER, setSpinnerListItemRendererStyles );
/* Tab bar */
getStyleProviderForClass( TabBar ).defaultStyleFunction = setTabBarStyles;
getStyleProviderForClass( ToggleButton ).setFunctionForStyleName( TabBar.DEFAULT_CHILD_STYLE_NAME_TAB, setTabStyles );
getStyleProviderForClass( TabBar ).setFunctionForStyleName( THEME_STYLE_NAME_TAB_BAR_SHADOW_BOTTOM, setInvertedTabBarStyles );
getStyleProviderForClass( TabBar ).setFunctionForStyleName( THEME_STYLE_NAME_TAB_BAR_WITH_ICONS, setTabBarWithIconsStyles );
getStyleProviderForClass( ToggleButton ).setFunctionForStyleName( THEME_STYLE_NAME_TAB_SHADOW_BOTTOM, setInvertedTabStyles );
getStyleProviderForClass( ToggleButton ).setFunctionForStyleName( THEME_STYLE_NAME_TAB_WITH_ICON, setTabWithIconStyles );
getStyleProviderForClass( ToggleButton ).setFunctionForStyleName( THEME_STYLE_NAME_TAB_SHADOW_BOTTOM_WITH_ICON, setInvertedTabWithIconStyles );
/* Tab navigator */
getStyleProviderForClass( TabNavigator ).setFunctionForStyleName( THEME_STYLE_NAME_TAB_NAVIGATOR_WITH_ICONS, setTabNavigatorWithIconsStyles );
getStyleProviderForClass( TabNavigator ).setFunctionForStyleName( THEME_STYLE_NAME_TAB_NAVIGATOR_SHADOW_BOTTOM, setInvertedTabNavigatorStyles );
getStyleProviderForClass( TabBar ).setFunctionForStyleName( THEME_STYLE_NAME_TAB_NAVIGATOR_TAB_BAR_WITH_ICONS_SHADOW_BOTTOM, setCombinedNavigatorTabBarStyles );
/* Text input */
getStyleProviderForClass( TextInput ).defaultStyleFunction = setTextInputStyles;
getStyleProviderForClass( TextInput ).setFunctionForStyleName( TextInput.ALTERNATE_STYLE_NAME_SEARCH_TEXT_INPUT, setSearchTextInputStyles );
/* Text area */
getStyleProviderForClass( TextArea ).defaultStyleFunction = setTextAreaStyles;
/* Text callout */
getStyleProviderForClass( TextCallout ).defaultStyleFunction = setTextCalloutStyles;
/* Toggle switch */
getStyleProviderForClass( Button ).setFunctionForStyleName( ToggleSwitch.DEFAULT_CHILD_STYLE_NAME_ON_TRACK, setToggleSwitchOnTrackStyles );
getStyleProviderForClass( Button ).setFunctionForStyleName( ToggleSwitch.DEFAULT_CHILD_STYLE_NAME_OFF_TRACK, setToggleSwitchOffTrackStyles );
getStyleProviderForClass( Button ).setFunctionForStyleName( ToggleSwitch.DEFAULT_CHILD_STYLE_NAME_THUMB, setToggleSwitchThumbStyles );
getStyleProviderForClass( ToggleButton ).setFunctionForStyleName( ToggleSwitch.DEFAULT_CHILD_STYLE_NAME_THUMB, setToggleSwitchThumbStyles );
getStyleProviderForClass( ToggleSwitch ).defaultStyleFunction = setToggleSwitchStyles;
/* Tree */
getStyleProviderForClass( Tree ).defaultStyleFunction = setTreeStyles;
getStyleProviderForClass( DefaultTreeItemRenderer ).defaultStyleFunction = setTreeItemRendererStyles;
/**
* Media controls
*/
/* Seek slider */
getStyleProviderForClass( SeekSlider ).defaultStyleFunction = setSeekSliderStyles;
getStyleProviderForClass( Button ).setFunctionForStyleName( SeekSlider.DEFAULT_CHILD_STYLE_NAME_THUMB, setSeekSliderThumbStyles );
getStyleProviderForClass( Button ).setFunctionForStyleName( SeekSlider.DEFAULT_CHILD_STYLE_NAME_MINIMUM_TRACK, setSeekSliderMinimumTrackStyles );
getStyleProviderForClass( Button ).setFunctionForStyleName( SeekSlider.DEFAULT_CHILD_STYLE_NAME_MAXIMUM_TRACK, setSeekSliderMaximumTrackStyles );
/* Play pause button */
getStyleProviderForClass( PlayPauseToggleButton ).defaultStyleFunction = setPlayPauseToggleButtonStyles;
/* Mute button */
getStyleProviderForClass( MuteToggleButton ).defaultStyleFunction = setMuteToggleButtonStyles;
/* Volume slider */
getStyleProviderForClass( VolumeSlider ).defaultStyleFunction = setVolumeSliderStyles;
getStyleProviderForClass( Button ).setFunctionForStyleName( VolumeSlider.DEFAULT_CHILD_STYLE_NAME_THUMB, setVolumeSliderThumbStyles );
getStyleProviderForClass( Button ).setFunctionForStyleName( VolumeSlider.DEFAULT_CHILD_STYLE_NAME_MINIMUM_TRACK, setVolumeSliderMinimumTrackStyles );
getStyleProviderForClass( Button ).setFunctionForStyleName( VolumeSlider.DEFAULT_CHILD_STYLE_NAME_MAXIMUM_TRACK, setVolumeSliderMaximumTrackStyles );
/* Full screen button */
getStyleProviderForClass( FullScreenToggleButton ).defaultStyleFunction = setFullScreenToggleButtonStyles;
/* Time label */
getStyleProviderForClass( TimeLabel ).defaultStyleFunction = setTimeLabelStyles;
}
protected function getTextFormat( size:int, color:uint, isBold:Boolean = false, horizontalAlign:String = Align.LEFT, verticalAlign:String = Align.TOP ):TextFormat {
var format:TextFormat = new TextFormat( FONT_NAME, size, color, horizontalAlign, verticalAlign );
format.bold = isBold;
return format;
}
/**
*
*
* Styles
*
*
*/
/**
* Alert
*/
protected function setAlertStyles( alert:Alert ):void {
setScrollerStyles( alert );
const backgroundSkin:Image = new Image( mBackgroundPopUpTexture );
backgroundSkin.scale9Grid = BACKGROUND_POPUP_SCALE9_GRID;
alert.backgroundSkin = backgroundSkin;
alert.customHeaderStyleName = THEME_STYLE_NAME_ALERT_HEADER;
alert.padding = alert.gap = mRegularPaddingSize;
alert.maxWidth = 300;
alert.maxHeight = 300;
var format:TextFormat = new TextFormat();
format.copyFrom( mDarkRegularTF );
format.leading = mRegularFontSize * 0.8;
alert.fontStyles = format;
}
protected function setAlertButtonGroupStyles( group:ButtonGroup ):void {
group.direction = Direction.HORIZONTAL;
group.horizontalAlign = HorizontalAlign.RIGHT;
group.verticalAlign = VerticalAlign.JUSTIFY;
group.distributeButtonSizes = false;
group.gap = mSmallPaddingSize >> 1;
group.padding = mRegularPaddingSize;
group.paddingTop = 0;
group.customButtonStyleName = THEME_STYLE_NAME_ALERT_BUTTON_GROUP_BUTTON;
}
protected function setAlertButtonGroupButtonStyles( button:Button ):void {
setPrimaryQuietButtonStyles( button );
FadeImageSkin( button.defaultSkin ).minHeight = mControlSize;
button.defaultSkin.height = mControlSize;
button.paddingTop = 12.5;
button.paddingBottom = 7.5;
button.paddingLeft = button.paddingRight = mSmallPaddingSize;
}
protected function setAlertHeaderStyles( header:Header ):void {
setHeaderWithoutBackgroundStyles( header );
header.paddingTop = mRegularPaddingSize;
}
/**
* Auto complete
*/
protected function setAutoCompleteListStyles( list:List ):void {
setScrollerStyles( list );
list.maxHeight = 250;
list.paddingLeft = 5;
list.paddingTop = 3.5;
list.paddingRight = 4.5;
list.paddingBottom = 5;
const backgroundSkin:Image = new Image( mDropDownListBackgroundTexture );
backgroundSkin.scale9Grid = DROP_DOWN_LIST_BACKGROUND_SCALE9_GRID;
list.backgroundSkin = backgroundSkin;
list.verticalScrollPolicy = ScrollPolicy.ON;
list.customItemRendererStyleName = THEME_STYLE_NAME_DROP_DOWN_LIST_ITEM_RENDERER;
}
/**
* Buttons
*/
protected function setButtonStyles( button:Button ):void {
var skin:FadeImageSkin = new FadeImageSkin( mButtonPrimaryUpTexture );
skin.setTextureForState( ButtonState.DOWN, mButtonPrimaryDownTexture );
skin.setTextureForState( ButtonState.DISABLED, mButtonPrimaryDisabledTexture );
skin.width = skin.height = mControlSize;
/* Set ToggleButton styles as well */
if( button is ToggleButton ) {
skin.selectedTexture = mButtonSelectedUpTexture;
skin.setTextureForState( ButtonState.DISABLED_AND_SELECTED, mButtonSelectedDisabledTexture );
}
skin.scale9Grid = BUTTON_SCALE9_GRID;
button.defaultSkin = skin;
setBaseButtonStyles( button );
ButtonRadialAnimationManager.getInstance().add( button );
tintButtonIcon( button, COLOR_UI_DARK );
}
protected function setPrimaryQuietButtonStyles( button:Button ):void {
setBaseButtonStyles( button );
var skin:FadeImageSkin = new FadeImageSkin(null);
skin.setTextureForState( ButtonState.DOWN, mButtonPrimaryQuietDownTexture );
skin.scale9Grid = BUTTON_QUIET_SCALE9_GRID;
skin.minWidth = skin.minHeight = mSmallerControlSize;
skin.width = skin.height = mSmallerControlSize;
button.defaultSkin = skin;
button.paddingTop = 4;
tintButtonIcon( button, COLOR_UI_DARK );
PrimaryQuietButtonRadialAnimationManager.getInstance().add( button );
}
protected function setAccentQuietButtonStyles( button:Button ):void {
setBaseButtonStyles( button );
var skin:FadeImageSkin = new FadeImageSkin(null);
skin.setTextureForState( ButtonState.DOWN, mButtonAccentQuietDownTexture );
skin.scale9Grid = BUTTON_QUIET_SCALE9_GRID;
skin.minWidth = skin.minHeight = mSmallerControlSize;
skin.width = skin.height = mSmallerControlSize;
button.defaultSkin = skin;
button.paddingTop = 4;
tintButtonIcon( button, COLOR_ACCENT_DARK );
button.fontStyles = mAccentRegularDarkTF.clone();
button.disabledFontStyles = mAccentRegularDarkDisabledTF.clone();
AccentQuietButtonRadialAnimationManager.getInstance().add( button );
}
protected function setHeaderQuietButtonStyles( button:Button ):void {
setBaseButtonStyles( button );
var skin:FadeImageSkin = new FadeImageSkin(null);
skin.setTextureForState( ButtonState.DOWN, mButtonHeaderQuietDownTexture );
skin.scale9Grid = BUTTON_QUIET_SCALE9_GRID;
skin.minHeight = mSmallerControlSize;
skin.fadeOutTransition = Transitions.EASE_OUT;
button.defaultSkin = skin;
button.paddingTop = 4;
QuietButtonRadialAnimationManager.getInstance().add( button );
}
protected function setHeaderQuietButtonIconOnlyStyles( button:Button ):void {
var isMediaButton:Boolean = button is ToggleButton;
setBaseButtonStyles( button, isMediaButton ? 0.75 : 1 );
var skin:FadeImageSkin = new FadeImageSkin(null);
skin.setTextureForState( ButtonState.DOWN, mAtlas.getTexture( "radial-effect" ) );
skin.setTextureForState( ButtonState.DOWN_AND_SELECTED, mAtlas.getTexture( "radial-effect" ) );
skin.minHeight = skin.minWidth = 48;
skin.fadeOutTransition = Transitions.EASE_OUT;
button.defaultSkin = skin;
button.paddingTop = 0;
/* Use small padding for icon-only button */
button.paddingLeft = button.paddingRight = mSmallPaddingSize;
button.hasLabelTextRenderer = false;
HeaderIconOnlyButtonRadialAnimationManager.getInstance().add( button );
tintButtonIcon( button, COLOR_UI_DARK );
}
protected function setAccentButtonStyles( button:Button ):void {
var skin:FadeImageSkin = new FadeImageSkin( mButtonAccentUpTexture );
skin.setTextureForState( ButtonState.DOWN, mButtonAccentDownTexture );
skin.setTextureForState( ButtonState.DISABLED, mButtonAccentDisabledTexture );
skin.width = skin.height = mControlSize;
skin.scale9Grid = BUTTON_SCALE9_GRID;
button.defaultSkin = skin;
setBaseButtonStyles( button );
tintButtonIcon( button, COLOR_UI_LIGHT );
button.fontStyles = mLightRegularTF.clone();
button.disabledFontStyles = mAccentRegularDisabledTF.clone();
ButtonRadialAnimationManager.getInstance().add( button );
}
protected function setCallToActionPrimaryButtonStyles( button:Button ):void {
var skin:FadeImageSkin = new FadeImageSkin( mButtonCallToActionPrimaryUpTexture );
skin.setTextureForState( ButtonState.DOWN, mButtonCallToActionPrimaryDownTexture );
skin.setTextureForState( ButtonState.DISABLED, mButtonCallToActionPrimaryDisabledTexture );
skin.width = skin.height = mLargeControlSize;
skin.scale9Grid = BUTTON_CALL_TO_ACTION_SCALE9_GRID;
button.defaultSkin = skin;
setBaseButtonStyles( button, 1.0 );
setBaseCallToActionButtonStyles( button );
tintButtonIcon( button, COLOR_UI_DARK );
}
protected function setCallToActionAccentButtonStyles( button:Button ):void {
var skin:FadeImageSkin = new FadeImageSkin( mButtonCallToActionAccentUpTexture );
skin.setTextureForState( ButtonState.DOWN, mButtonCallToActionAccentDownTexture );
skin.setTextureForState( ButtonState.DISABLED, mButtonCallToActionAccentDisabledTexture );
skin.width = skin.height = mLargeControlSize;
skin.scale9Grid = BUTTON_CALL_TO_ACTION_SCALE9_GRID;
button.defaultSkin = skin;
setBaseButtonStyles( button, 1.0 );
setBaseCallToActionButtonStyles( button );
tintButtonIcon( button, COLOR_UI_LIGHT );
}
protected function setBackButtonStyles( button:Button ):void {
var skin:FadeImageSkin = new FadeImageSkin( mButtonBackUpTexture );