Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions Pod/Classes/TSMessageView.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ @interface TSMessageView () <UIGestureRecognizerDelegate>

@property (nonatomic, assign) CGFloat textSpaceLeft;
@property (nonatomic, assign) CGFloat textSpaceRight;
@property (nonatomic, assign) CGFloat minimumPadding;

@property (copy) void (^callback)();
@property (copy) void (^buttonCallback)();
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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])
{
Expand Down Expand Up @@ -269,6 +277,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];
}

Expand Down