Skip to content

Allow adding of shadow on message bubble #427

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions ChatSDKCore/Classes/Session/BConfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ typedef enum {

// Should we ask the user to allow notifications when the app initially loads up?
@property (nonatomic, readwrite) BOOL shouldAskForNotificationsPermission;

/// Add a shadow to the message bubble using a default shadow configuration.
@property (nonatomic, readwrite) BOOL addShadowOnMessageBubble;

// Background color of messages: hex value like "FFFFFF"
@property (nonatomic, readwrite) NSString * messageColorMe;
Expand Down
1 change: 1 addition & 0 deletions ChatSDKCore/Classes/Session/BConfiguration.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

@implementation BConfiguration

@synthesize addShadowOnMessageBubble;
@synthesize messageColorMe;
@synthesize messageColorReply;
@synthesize rootPath;
Expand Down
10 changes: 10 additions & 0 deletions ChatSDKUI/Classes/Components/Message Cells/BTextMessageCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@ -(instancetype) initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSStr

// textView.contentInset = UIEdgeInsetsMake(-9.0, -5.0, 0.0, 0.0);

if(BChatSDK.config.addShadowOnMessageBubble) {
if(BChatSDK.config.addShadowOnMessageBubble == YES) {
self.bubbleImageView.layer.shadowColor = UIColor.blackColor.CGColor;
self.bubbleImageView.layer.shadowOffset = CGSizeMake(0, 1.0);
self.bubbleImageView.layer.shadowRadius = 1.0;
self.bubbleImageView.layer.shadowOpacity = 0.2;
self.bubbleImageView.layer.cornerRadius = 10.0;
}
}

[self.bubbleImageView addSubview:textView];

}
Expand Down