Skip to content
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
5 changes: 5 additions & 0 deletions ChatSDKCore/Classes/Session/BConfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions ChatSDKCore/Classes/Session/BConfiguration.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ @implementation BConfiguration

@synthesize messageColorMe;
@synthesize messageColorReply;
@synthesize chatTextViewPlaceholder;
@synthesize chatTextViewFont;
@synthesize rootPath;
@synthesize appBadgeEnabled;
@synthesize defaultUserNamePrefix;
Expand Down
13 changes: 13 additions & 0 deletions ChatSDKUI/Classes/Components/Chat View/BTextInputView.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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]];

Expand Down Expand Up @@ -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];
}

Expand Down Expand Up @@ -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]
Expand Down