From 138cf02594195015714d053dac02f22def0b6e5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erg=C3=BCn=20KO=C3=87AK?= Date: Fri, 20 Jan 2017 11:50:02 +0100 Subject: [PATCH 1/2] Accessibility Helper --- Pod/Classes/TSMessageView.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Pod/Classes/TSMessageView.m b/Pod/Classes/TSMessageView.m index 75a32b1d..1c580134 100755 --- a/Pod/Classes/TSMessageView.m +++ b/Pod/Classes/TSMessageView.m @@ -276,6 +276,7 @@ - (id)initWithTitle:(NSString *)title // Set up title label _titleLabel = [[UILabel alloc] init]; + [self.titleLabel setAccessibilityIdentifier:@"notificationTitle"]; [self.titleLabel setText:title]; [self.titleLabel setTextColor:fontColor]; [self.titleLabel setBackgroundColor:[UIColor clearColor]]; @@ -298,6 +299,7 @@ - (id)initWithTitle:(NSString *)title if ([subtitle length]) { _contentLabel = [[UILabel alloc] init]; + [self.contentLabel setAccessibilityIdentifier:@"notificationMessage"]; [self.contentLabel setText:subtitle]; UIColor *contentTextColor = [UIColor colorWithHexString:[current valueForKey:@"contentTextColor"]]; From 9d1845a55997c8502dc01089e81558d11c701770 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ergu=CC=88n=20Koc=CC=A7ak?= Date: Thu, 26 Jan 2017 11:47:39 +0100 Subject: [PATCH 2/2] Added background alpha support with config --- Pod/Assets/TSMessagesDefaultDesign.json | 12 ++++++++---- Pod/Classes/TSMessageView.m | 2 ++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Pod/Assets/TSMessagesDefaultDesign.json b/Pod/Assets/TSMessagesDefaultDesign.json index 9036fe2e..164951f2 100755 --- a/Pod/Assets/TSMessagesDefaultDesign.json +++ b/Pod/Assets/TSMessagesDefaultDesign.json @@ -16,7 +16,8 @@ "shadowOffsetY": -1, "textColor": "#FFFFFF", "titleFontSize": 14, - "backgroundColor": "#76CF67" + "backgroundColor": "#76CF67", + "backgroundAlpha": 1.0 }, "message": { "backgroundImageName": "NotificationBackgroundMessage.png", @@ -35,7 +36,8 @@ "shadowOffsetY": 1, "textColor": "#727C83", "titleFontSize": 14, - "backgroundColor": "#D4DDDF" + "backgroundColor": "#D4DDDF", + "backgroundAlpha": 1.0 }, "warning": { "backgroundImageName": "NotificationBackgroundWarning.png", @@ -54,7 +56,8 @@ "shadowOffsetY": 1, "textColor": "#484638", "titleFontSize": 14, - "backgroundColor": "#DAC43C" + "backgroundColor": "#DAC43C", + "backgroundAlpha": 1.0 }, "error": { "backgroundImageName": "NotificationBackgroundError.png", @@ -73,6 +76,7 @@ "shadowOffsetY": -1, "textColor": "#FFFFFF", "titleFontSize": 14, - "backgroundColor": "#DD3B41" + "backgroundColor": "#DD3B41", + "backgroundAlpha": 1.0 } } \ No newline at end of file diff --git a/Pod/Classes/TSMessageView.m b/Pod/Classes/TSMessageView.m index e75bfe16..3c840759 100755 --- a/Pod/Classes/TSMessageView.m +++ b/Pod/Classes/TSMessageView.m @@ -261,12 +261,14 @@ - (id)initWithTitle:(NSString *)title _backgroundImageView = [[UIImageView alloc] initWithImage:backgroundImage]; self.backgroundImageView.autoresizingMask = (UIViewAutoresizingFlexibleWidth); + self.backgroundImageView.alpha = [current[@"backgroundAlpha"] doubleValue]; [self addSubview:self.backgroundImageView]; } else { // On iOS 7 and above use a blur layer instead (not yet finished) _backgroundBlurView = [[TSBlurView alloc] init]; + _backgroundBlurView.alpha = [current[@"backgroundAlpha"] doubleValue]; self.backgroundBlurView.autoresizingMask = (UIViewAutoresizingFlexibleWidth); self.backgroundBlurView.blurTintColor = [UIColor colorWithHexString:current[@"backgroundColor"]]; [self addSubview:self.backgroundBlurView];