Always encode/decode CGFloat as double
MODIFY
components/TextFields/src/MDCTextInputControllerBase.m
components/TextFields/src/MDCTextInputControllerBase.m
@@ -256,9 +256,9 @@ static UITextFieldViewMode _underlineViewModeDefault = UITextFieldViewModeWhileE
[aDecoder decodeObjectOfClass:[UIColor class]
forKey:MDCTextInputControllerBaseTrailingUnderlineLabelTextColor];
_underlineHeightActive =
- [aDecoder decodeFloatForKey:MDCTextInputControllerBaseUnderlineHeightActiveKey];
+ (CGFloat)[aDecoder decodeDoubleForKey:MDCTextInputControllerBaseUnderlineHeightActiveKey];
_underlineHeightNormal =
- [aDecoder decodeFloatForKey:MDCTextInputControllerBaseUnderlineHeightNormalKey];
+ (CGFloat)[aDecoder decodeDoubleForKey:MDCTextInputControllerBaseUnderlineHeightNormalKey];
_underlineViewMode = (UITextFieldViewMode)
[aDecoder decodeIntegerForKey:MDCTextInputControllerBaseUnderlineViewModeKey];
@@ -336,9 +336,9 @@ static UITextFieldViewMode _underlineViewModeDefault = UITextFieldViewModeWhileE
forKey:MDCTextInputControllerBaseTrailingUnderlineLabelFontKey];
[aCoder encodeObject:self.trailingUnderlineLabelTextColor
forKey:MDCTextInputControllerBaseTrailingUnderlineLabelTextColor];
- [aCoder encodeFloat:(float)self.underlineHeightActive
+ [aCoder encodeDouble:(double)self.underlineHeightActive
forKey:MDCTextInputControllerBaseUnderlineHeightActiveKey];
- [aCoder encodeFloat:(float)self.underlineHeightNormal
+ [aCoder encodeDouble:(double)self.underlineHeightNormal
forKey:MDCTextInputControllerBaseUnderlineHeightNormalKey];
[aCoder encodeInteger:self.underlineViewMode
forKey:MDCTextInputControllerBaseUnderlineViewModeKey];

MODIFY
components/TextFields/src/MDCTextInputControllerLegacyDefault.m
components/TextFields/src/MDCTextInputControllerLegacyDefault.m
@@ -248,13 +248,13 @@ static UITextFieldViewMode _underlineViewModeDefault = UITextFieldViewModeWhileE
forKey:MDCTextInputControllerLegacyDefaultTrailingUnderlineLabelTextColor];
if ([aDecoder
containsValueForKey:MDCTextInputControllerLegacyDefaultUnderlineHeightActiveKey]) {
- _underlineHeightActive = (float)[aDecoder
- decodeFloatForKey:MDCTextInputControllerLegacyDefaultUnderlineHeightActiveKey];
+ _underlineHeightActive = (CGFloat)[aDecoder
+ decodeDoubleForKey:MDCTextInputControllerLegacyDefaultUnderlineHeightActiveKey];
}
if ([aDecoder
containsValueForKey:MDCTextInputControllerLegacyDefaultUnderlineHeightNormalKey]) {
- _underlineHeightActive = (float)[aDecoder
- decodeFloatForKey:MDCTextInputControllerLegacyDefaultUnderlineHeightNormalKey];
+ _underlineHeightActive = (CGFloat)[aDecoder
+ decodeDoubleForKey:MDCTextInputControllerLegacyDefaultUnderlineHeightNormalKey];
}
if ([aDecoder containsValueForKey:MDCTextInputControllerLegacyDefaultUnderlineViewModeKey]) {
_underlineViewMode = (UITextFieldViewMode)
@@ -314,9 +314,9 @@ static UITextFieldViewMode _underlineViewModeDefault = UITextFieldViewModeWhileE
forKey:MDCTextInputControllerLegacyDefaultTrailingUnderlineLabelFontKey];
[aCoder encodeObject:self.trailingUnderlineLabelTextColor
forKey:MDCTextInputControllerLegacyDefaultTrailingUnderlineLabelTextColor];
- [aCoder encodeFloat:(float)self.underlineHeightActive
+ [aCoder encodeDouble:(double)self.underlineHeightActive
forKey:MDCTextInputControllerLegacyDefaultUnderlineHeightActiveKey];
- [aCoder encodeFloat:(float)self.underlineHeightNormal
+ [aCoder encodeDouble:(double)self.underlineHeightNormal
forKey:MDCTextInputControllerLegacyDefaultUnderlineHeightNormalKey];
[aCoder encodeInteger:self.underlineViewMode
forKey:MDCTextInputControllerLegacyDefaultUnderlineViewModeKey];

MODIFY
components/TextFields/src/MDCTextInputUnderlineView.m
components/TextFields/src/MDCTextInputUnderlineView.m
@@ -57,7 +57,7 @@ static inline UIColor *MDCTextInputUnderlineColor() {
_disabledColor =
[coder decodeObjectOfClass:[UIColor class] forKey:MDCTextInputUnderlineDisabledColorKey];
_enabled = [coder decodeBoolForKey:MDCTextInputUnderlineEnabledKey];
- _lineHeight = (CGFloat)[coder decodeFloatForKey:MDCTextInputUnderlineLineHeightKey];
+ _lineHeight = (CGFloat)[coder decodeDoubleForKey:MDCTextInputUnderlineLineHeightKey];
}
return self;
}
@@ -79,7 +79,7 @@ static inline UIColor *MDCTextInputUnderlineColor() {
[coder encodeObject:self.color forKey:MDCTextInputUnderlineColorKey];
[coder encodeObject:self.disabledColor forKey:MDCTextInputUnderlineDisabledColorKey];
[coder encodeBool:self.enabled forKey:MDCTextInputUnderlineEnabledKey];
- [coder encodeFloat:(float)self.lineHeight forKey:MDCTextInputUnderlineLineHeightKey];
+ [coder encodeDouble:(double)self.lineHeight forKey:MDCTextInputUnderlineLineHeightKey];
}
- (instancetype)copyWithZone:(__unused NSZone *)zone {

MODIFY
components/TextFields/src/private/MDCPaddedLabel.m
components/TextFields/src/private/MDCPaddedLabel.m
@@ -23,14 +23,14 @@ static NSString *const MDCPaddedLabelHorizontalPaddingKey = @"MDCPaddedLabelHori
- (instancetype)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithCoder:aDecoder];
if (self) {
- _horizontalPadding = (CGFloat)[aDecoder decodeFloatForKey:MDCPaddedLabelHorizontalPaddingKey];
+ _horizontalPadding = (CGFloat)[aDecoder decodeDoubleForKey:MDCPaddedLabelHorizontalPaddingKey];
}
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder {
[super encodeWithCoder:aCoder];
- [aCoder encodeFloat:(float)_horizontalPadding forKey:MDCPaddedLabelHorizontalPaddingKey];
+ [aCoder encodeDouble:(double)_horizontalPadding forKey:MDCPaddedLabelHorizontalPaddingKey];
}
#pragma mark - Setters

Always encode/decode CGFloat as double (#3033)