summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2018-07-13 12:18:40 -0400
committerJoel Fischer <joeljfischer@gmail.com>2018-07-13 12:18:40 -0400
commitc482fe3f06c41e0f899fa674f0a72790830f40ea (patch)
treef04cc256142be8428d147d427fe2373c481319eb
parent56a9c5ae6e6826f3c1dd44b4bfda076bb0d11b76 (diff)
downloadsdl_ios-bugfix/issue_1000_softbuttons_disappear_HMI_none.tar.gz
Fix an issue with directly setting text and graphicsbugfix/issue_1000_softbuttons_disappear_HMI_none
-rw-r--r--SmartDeviceLink/SDLTextAndGraphicManager.m60
-rw-r--r--SmartDeviceLinkTests/DevAPISpecs/SDLTextAndGraphicManagerSpec.m4
2 files changed, 26 insertions, 38 deletions
diff --git a/SmartDeviceLink/SDLTextAndGraphicManager.m b/SmartDeviceLink/SDLTextAndGraphicManager.m
index 4bd3b19fd..64a3a5ffb 100644
--- a/SmartDeviceLink/SDLTextAndGraphicManager.m
+++ b/SmartDeviceLink/SDLTextAndGraphicManager.m
@@ -522,110 +522,98 @@ NS_ASSUME_NONNULL_BEGIN
- (void)setTextField1:(nullable NSString *)textField1 {
_textField1 = textField1;
+ _isDirty = YES;
if (!self.isBatchingUpdates) {
// If we aren't batching, send the update immediately, if we are, set ourselves as dirty (so we know we should send an update after the batch ends)
- [self sdl_updateWithCompletionHandler:nil];
- } else {
- _isDirty = YES;
+ [self updateWithCompletionHandler:nil];
}
}
- (void)setTextField2:(nullable NSString *)textField2 {
_textField2 = textField2;
+ _isDirty = YES;
if (!self.isBatchingUpdates) {
- [self sdl_updateWithCompletionHandler:nil];
- } else {
- _isDirty = YES;
+ [self updateWithCompletionHandler:nil];
}
}
- (void)setTextField3:(nullable NSString *)textField3 {
_textField3 = textField3;
+ _isDirty = YES;
if (!self.isBatchingUpdates) {
- [self sdl_updateWithCompletionHandler:nil];
- } else {
- _isDirty = YES;
+ [self updateWithCompletionHandler:nil];
}
}
- (void)setTextField4:(nullable NSString *)textField4 {
_textField4 = textField4;
+ _isDirty = YES;
if (!self.isBatchingUpdates) {
- [self sdl_updateWithCompletionHandler:nil];
- } else {
- _isDirty = YES;
+ [self updateWithCompletionHandler:nil];
}
}
- (void)setMediaTrackTextField:(nullable NSString *)mediaTrackTextField {
_mediaTrackTextField = mediaTrackTextField;
+ _isDirty = YES;
if (!self.isBatchingUpdates) {
- [self sdl_updateWithCompletionHandler:nil];
- } else {
- _isDirty = YES;
+ [self updateWithCompletionHandler:nil];
}
}
- (void)setPrimaryGraphic:(nullable SDLArtwork *)primaryGraphic {
_primaryGraphic = primaryGraphic;
+ _isDirty = YES;
if (!self.isBatchingUpdates) {
- [self sdl_updateWithCompletionHandler:nil];
- } else {
- _isDirty = YES;
+ [self updateWithCompletionHandler:nil];
}
}
- (void)setSecondaryGraphic:(nullable SDLArtwork *)secondaryGraphic {
_secondaryGraphic = secondaryGraphic;
+ _isDirty = YES;
if (!self.isBatchingUpdates) {
- [self sdl_updateWithCompletionHandler:nil];
- } else {
- _isDirty = YES;
+ [self updateWithCompletionHandler:nil];
}
}
- (void)setAlignment:(nullable SDLTextAlignment)alignment {
_alignment = alignment ? alignment : SDLTextAlignmentCenter;
+ _isDirty = YES;
if (!self.isBatchingUpdates) {
- [self sdl_updateWithCompletionHandler:nil];
- } else {
- _isDirty = YES;
+ [self updateWithCompletionHandler:nil];
}
}
- (void)setTextField1Type:(nullable SDLMetadataType)textField1Type {
_textField1Type = textField1Type;
+ _isDirty = YES;
if (!self.isBatchingUpdates) {
- [self sdl_updateWithCompletionHandler:nil];
- } else {
- _isDirty = YES;
+ [self updateWithCompletionHandler:nil];
}
}
- (void)setTextField2Type:(nullable SDLMetadataType)textField2Type {
_textField2Type = textField2Type;
+ _isDirty = YES;
if (!self.isBatchingUpdates) {
- [self sdl_updateWithCompletionHandler:nil];
- } else {
- _isDirty = YES;
+ [self updateWithCompletionHandler:nil];
}
}
- (void)setTextField3Type:(nullable SDLMetadataType)textField3Type {
_textField3Type = textField3Type;
+ _isDirty = YES;
if (!self.isBatchingUpdates) {
- [self sdl_updateWithCompletionHandler:nil];
- } else {
- _isDirty = YES;
+ [self updateWithCompletionHandler:nil];
}
}
- (void)setTextField4Type:(nullable SDLMetadataType)textField4Type {
_textField4Type = textField4Type;
+ _isDirty = YES;
if (!self.isBatchingUpdates) {
- [self sdl_updateWithCompletionHandler:nil];
- } else {
- _isDirty = YES;
+ [self updateWithCompletionHandler:nil];
}
}
diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLTextAndGraphicManagerSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLTextAndGraphicManagerSpec.m
index 5005483d0..ef5b18623 100644
--- a/SmartDeviceLinkTests/DevAPISpecs/SDLTextAndGraphicManagerSpec.m
+++ b/SmartDeviceLinkTests/DevAPISpecs/SDLTextAndGraphicManagerSpec.m
@@ -94,7 +94,7 @@ describe(@"text and graphic manager", ^{
expect(testManager.textField1).to(equal(testString));
expect(testManager.inProgressUpdate).to(beNil());
- expect(testManager.isDirty).to(beFalse());
+ expect(testManager.isDirty).to(beTrue());
});
});
@@ -108,7 +108,7 @@ describe(@"text and graphic manager", ^{
expect(testManager.textField1).to(equal(testString));
expect(testManager.inProgressUpdate).to(beNil());
- expect(testManager.isDirty).to(beFalse());
+ expect(testManager.isDirty).to(beTrue());
});
});