diff --git a/ChatSDKCore/Classes/Session/BConfiguration.h b/ChatSDKCore/Classes/Session/BConfiguration.h index 8d6a31dc..a48d5843 100755 --- a/ChatSDKCore/Classes/Session/BConfiguration.h +++ b/ChatSDKCore/Classes/Session/BConfiguration.h @@ -36,6 +36,11 @@ typedef enum { @property (nonatomic, readwrite) NSString * messageColorMe; @property (nonatomic, readwrite) NSString * messageColorReply; +/// Custom placeholder for chat screen's textview. +@property (nonatomic, readwrite) NSString * chatTextViewPlaceholder; +/// Custom font for chat screen's textview. +@property (nonatomic, readwrite) UIFont * chatTextViewFont; + // The Firebase root path. Data will be added to Firebase root/rootPath... // this allows you to run multiple chat instances on one Firebase database @property (nonatomic, readwrite) NSString * rootPath; diff --git a/ChatSDKCore/Classes/Session/BConfiguration.m b/ChatSDKCore/Classes/Session/BConfiguration.m index bf9d3fb7..d5fce14e 100755 --- a/ChatSDKCore/Classes/Session/BConfiguration.m +++ b/ChatSDKCore/Classes/Session/BConfiguration.m @@ -13,6 +13,8 @@ @implementation BConfiguration @synthesize messageColorMe; @synthesize messageColorReply; +@synthesize chatTextViewPlaceholder; +@synthesize chatTextViewFont; @synthesize rootPath; @synthesize appBadgeEnabled; @synthesize defaultUserNamePrefix; diff --git a/ChatSDKUI/Classes/Components/Chat View/BTextInputView.m b/ChatSDKUI/Classes/Components/Chat View/BTextInputView.m index ea2a4a4c..eb8a6767 100755 --- a/ChatSDKUI/Classes/Components/Chat View/BTextInputView.m +++ b/ChatSDKUI/Classes/Components/Chat View/BTextInputView.m @@ -36,6 +36,10 @@ -(instancetype) initWithFrame:(CGRect)frame { // self.barTintColor = [UIColor colorWithRed:1 green:1 blue:1 alpha:0.7]; self.backgroundColor = [UIColor whiteColor]; + if(BChatSDK.config.chatTextViewFont) { + _placeholderLabel.font = BChatSDK.config.chatTextViewFont; + } + // Decide how many lines the message should have minLines = bMinLines; maxLines = bMaxLines; @@ -125,6 +129,9 @@ -(instancetype) initWithFrame:(CGRect)frame { [_placeholderLabel setTextColor:_placeholderColor]; [_placeholderLabel setText:[NSBundle t:bWriteSomething]]; + if(BChatSDK.config.chatTextViewPlaceholder) { + [_placeholderLabel setText:BChatSDK.config.chatTextViewPlaceholder]; + } [self setFont:[UIFont systemFontOfSize:bFontSize]]; @@ -270,6 +277,9 @@ -(void) stopRecording { [[BAudioManager sharedManager] finishRecording]; [_sendBarDelegate.view hideAllToasts]; [_placeholderLabel setText:[NSBundle t:bWriteSomething]]; + if(BChatSDK.config.chatTextViewPlaceholder) { + [_placeholderLabel setText:BChatSDK.config.chatTextViewPlaceholder]; + } [self cancelRecordingToastTimer]; } @@ -305,6 +315,9 @@ -(void) cancelRecordingToastTimer { - (void)sendButtonCancelled { [_sendBarDelegate.view hideAllToasts]; [_placeholderLabel setText:[NSBundle t:bWriteSomething]]; + if(BChatSDK.config.chatTextViewPlaceholder) { + [_placeholderLabel setText:BChatSDK.config.chatTextViewPlaceholder]; + } CSToastStyle * style = [[CSToastStyle alloc] initWithDefaultStyle]; style.backgroundColor = [UIColor redColor]; [_sendBarDelegate.view makeToast:[NSBundle t:bCancelled]