diff --git a/ChatSDKCore/Classes/Defines/BCoreDefines.h b/ChatSDKCore/Classes/Defines/BCoreDefines.h index cb6e9479..4fb21f96 100755 --- a/ChatSDKCore/Classes/Defines/BCoreDefines.h +++ b/ChatSDKCore/Classes/Defines/BCoreDefines.h @@ -16,6 +16,8 @@ #define bTypingTimeout 5.0 #define bLocationDefaultArea 1000 +#define bDefaultChatBgColor @"ffffff" + #define bDefaultMessageColorMe @"abcff4" #define bDefaultMessageColorReply @"d7d4d3" diff --git a/ChatSDKCore/Classes/Session/BConfiguration.h b/ChatSDKCore/Classes/Session/BConfiguration.h index 8d6a31dc..d3bae6d8 100755 --- a/ChatSDKCore/Classes/Session/BConfiguration.h +++ b/ChatSDKCore/Classes/Session/BConfiguration.h @@ -31,6 +31,10 @@ typedef enum { // Should we ask the user to allow notifications when the app initially loads up? @property (nonatomic, readwrite) BOOL shouldAskForNotificationsPermission; + +/// Custom background color of BChatViewController's main view. +@property (nonatomic, readwrite) NSString * chatBgColor; + // Background color of messages: hex value like "FFFFFF" @property (nonatomic, readwrite) NSString * messageColorMe; diff --git a/ChatSDKCore/Classes/Session/BConfiguration.m b/ChatSDKCore/Classes/Session/BConfiguration.m index bf9d3fb7..7c66e20c 100755 --- a/ChatSDKCore/Classes/Session/BConfiguration.m +++ b/ChatSDKCore/Classes/Session/BConfiguration.m @@ -11,6 +11,7 @@ @implementation BConfiguration +@synthesize chatBgColor; @synthesize messageColorMe; @synthesize messageColorReply; @synthesize rootPath; diff --git a/ChatSDKUI/Classes/Components/Chat View/BChatViewController.m b/ChatSDKUI/Classes/Components/Chat View/BChatViewController.m index e485c4eb..c49df9fd 100755 --- a/ChatSDKUI/Classes/Components/Chat View/BChatViewController.m +++ b/ChatSDKUI/Classes/Components/Chat View/BChatViewController.m @@ -30,6 +30,11 @@ -(instancetype) initWithThread: (id) thread -(void) viewDidLoad { [super viewDidLoad]; + self.view.backgroundColor = [BCoreUtilities colorWithHexString:bDefaultChatBgColor]; + if(BChatSDK.config.chatBgColor) { + self.view.backgroundColor = [BCoreUtilities colorWithHexString:BChatSDK.config.chatBgColor]; + } + [_sendBarView setMaxLines:BChatSDK.config.textInputViewMaxLines]; [_sendBarView setMaxCharacters:BChatSDK.config.textInputViewMaxCharacters]; diff --git a/ChatSDKUI/Classes/Components/SDK/ElmChatViewController.m b/ChatSDKUI/Classes/Components/SDK/ElmChatViewController.m index 78717148..d565075e 100755 --- a/ChatSDKUI/Classes/Components/SDK/ElmChatViewController.m +++ b/ChatSDKUI/Classes/Components/SDK/ElmChatViewController.m @@ -46,6 +46,10 @@ -(instancetype) initWithDelegate: (id) delegate_ _tapRecognizer.enabled = NO; [self.view addGestureRecognizer:_tapRecognizer]; + if (BChatSDK.config.chatBgColor) { + self.tableView.backgroundColor = [BCoreUtilities colorWithHexString:BChatSDK.config.chatBgColor]; + } + // When a user taps the title bar we want to know to show the options screen if (BChatSDK.config.userChatInfoEnabled) { UITapGestureRecognizer * titleTapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(navigationBarTapped)];