Skip to content

Commit 36aac6e

Browse files
committed
[MDCSwitch] Created some missing getters for properties.
Reviewers: iangordon, #material_components_ios_owners, ajsecord Reviewed By: #material_components_ios_owners, ajsecord Projects: #material_components_ios_owners Differential Revision: http://codereview.cc/D83
1 parent cc295c1 commit 36aac6e

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

components/Switch/src/MDCSwitch.m

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,34 +99,54 @@ - (void)layoutSubviews {
9999
// TODO(iangordon): Handle BiDi layouts
100100
}
101101

102+
- (UIColor *)onTintColor {
103+
return _thumbTrack.primaryColor;
104+
}
105+
102106
- (void)setOnTintColor:(UIColor *)onTintColor {
103107
if (onTintColor == nil) {
104108
onTintColor = [[self class] defaultOnTintColor];
105109
}
106110
_thumbTrack.primaryColor = onTintColor;
107111
}
108112

113+
- (UIColor *)offThumbColor {
114+
return _thumbTrack.thumbOffColor;
115+
}
116+
109117
- (void)setOffThumbColor:(UIColor *)offThumbColor {
110118
if (offThumbColor == nil) {
111119
offThumbColor = [[self class] defaultOffThumbColor];
112120
}
113121
_thumbTrack.thumbOffColor = offThumbColor;
114122
}
115123

124+
- (UIColor *)disabledThumbColor {
125+
return _thumbTrack.thumbDisabledColor;
126+
}
127+
116128
- (void)setDisabledThumbColor:(UIColor *)disabledThumbColor {
117129
if (disabledThumbColor == nil) {
118130
disabledThumbColor = [MDCSwitch defaultDisabledThumbColor];
119131
}
120132
_thumbTrack.thumbDisabledColor = disabledThumbColor;
121133
}
122134

135+
- (UIColor *)offTrackColor {
136+
return _thumbTrack.trackOffColor;
137+
}
138+
123139
- (void)setOffTrackColor:(UIColor *)offTrackColor {
124140
if (offTrackColor == nil) {
125141
offTrackColor = [MDCSwitch defaultOffTrackColor];
126142
}
127143
_thumbTrack.trackOffColor = offTrackColor;
128144
}
129145

146+
- (UIColor *)disabledTrackColor {
147+
return _thumbTrack.trackDisabledColor;
148+
}
149+
130150
- (void)setDisabledTrackColor:(UIColor *)disabledTrackColor {
131151
if (disabledTrackColor == nil) {
132152
disabledTrackColor = [MDCSwitch defaultDisabledTrackColor];

0 commit comments

Comments
 (0)