From 36e4d9238490e33d179d164d46f8d36f80ac584e Mon Sep 17 00:00:00 2001 From: Alexander Pauly Date: Thu, 23 Jun 2016 20:38:52 +0200 Subject: [PATCH 1/2] Support alpha channel for the background view --- Pod/Classes/TSMessageView.m | 1 + 1 file changed, 1 insertion(+) diff --git a/Pod/Classes/TSMessageView.m b/Pod/Classes/TSMessageView.m index 03893b7c..55401a75 100755 --- a/Pod/Classes/TSMessageView.m +++ b/Pod/Classes/TSMessageView.m @@ -269,6 +269,7 @@ - (id)initWithTitle:(NSString *)title _backgroundBlurView = [[TSBlurView alloc] init]; self.backgroundBlurView.autoresizingMask = (UIViewAutoresizingFlexibleWidth); self.backgroundBlurView.blurTintColor = [UIColor colorWithHexString:current[@"backgroundColor"]]; + self.backgroundBlurView.alpha = CGColorGetAlpha(self.backgroundBlurView.blurTintColor.CGColor); [self addSubview:self.backgroundBlurView]; } From d8c3518578a236b3273a3f7832ab73ef7d4f9950 Mon Sep 17 00:00:00 2001 From: Alexander Pauly Date: Thu, 23 Jun 2016 20:54:10 +0200 Subject: [PATCH 2/2] Allow customizing the minimal padding --- Pod/Classes/TSMessageView.m | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Pod/Classes/TSMessageView.m b/Pod/Classes/TSMessageView.m index 55401a75..62425f1c 100755 --- a/Pod/Classes/TSMessageView.m +++ b/Pod/Classes/TSMessageView.m @@ -48,6 +48,7 @@ @interface TSMessageView () @property (nonatomic, assign) CGFloat textSpaceLeft; @property (nonatomic, assign) CGFloat textSpaceRight; +@property (nonatomic, assign) CGFloat minimumPadding; @property (copy) void (^callback)(); @property (copy) void (^buttonCallback)(); @@ -178,7 +179,8 @@ + (void)addNotificationDesignFromFile:(NSString *)filename - (CGFloat)padding { // Adds 10 padding to to cover navigation bar - return self.messagePosition == TSMessageNotificationPositionNavBarOverlay ? TSMessageViewMinimumPadding + 10.0f : TSMessageViewMinimumPadding; + return self.messagePosition == TSMessageNotificationPositionNavBarOverlay ? self.minimumPadding + 10.0f + : self.minimumPadding; } - (id)initWithTitle:(NSString *)title @@ -207,7 +209,6 @@ - (id)initWithTitle:(NSString *)title self.buttonCallback = buttonCallback; CGFloat screenWidth = self.viewController.view.bounds.size.width; - CGFloat padding = [self padding]; NSDictionary *current; NSString *currentString; @@ -241,6 +242,13 @@ - (id)initWithTitle:(NSString *)title current = [notificationDesign valueForKey:currentString]; + if (current[@"minimumPadding"] != nil) { + self.minimumPadding = [current[@"minimumPadding"] floatValue]; + } else { + self.minimumPadding = TSMessageViewMinimumPadding; + } + + CGFloat padding = [self padding]; if (!image && [[current valueForKey:@"imageName"] length]) {