File Bubble
CometChatFileBubble is the content view for a MediaMessage if the media sent is an file.
Methods
Methods | Type | Description |
---|---|---|
set(fileUrl: String) | String | Used to set the file url for the bubble |
set(title: String) | String | Used to set the file title |
set(subTitle: String) | String | Used to set the file subtitle |
set(style: FileBubbleStyle) | FileBubbleStyle | Used to set the customization of the file bubble |
FileBubbleStyle
BubbleStyle is the class containing methods to customize appearance of this bubble.
Methods | Type | Description |
---|---|---|
set(titleColor: UIColor) | UIColor | used to set title text color of the message |
set(titleFont: UIFont) | UIFont | used to set title text font of the message |
set(subtitleColor: UIColor) | UIColor | used to set sub title text color of the message |
set(subtitleFont: UIFont) | UIFont | used to set sub title font of the message |
set(iconTint: UIColor) | UIColor | used to provide color to the audio play icon |
set(background: UIColor) | UIColor | used to set background color |
set(borderColor: UIColor) | UIColor | used to set a border color |
set(borderWidth: CGFloat) | CGFloat | used to set border |
set(cornerRadius: CometChatCornerStyle) | CometChatCornerStyle | used to set border radius |
Usage
- Swift
//create file bubble style object
let fileBubbleStyle = FileBubbleStyle()
//modify style properties
fileBubbleStyle.set(background: .black)
fileBubbleStyle.set(borderWidth: 2.0)
fileBubbleStyle.set(borderColor: .black)
fileBubbleStyle.set(cornerRadius: CometChatCornerStyle(cornerRadius: 5.0))
fileBubbleStyle.set(titleColor: .red)
fileBubbleStyle.set(titleFont: UIFont.systemFont(ofSize: 12.0))
fileBubbleStyle.set(subtitleFont: UIFont.systemFont(ofSize: 10.0))
fileBubbleStyle.set(subtitleColor: .darkText)
fileBubbleStyle.set(iconTint: .darkGray)
//set style to the file bubble object
fileBubble.set(style: fileBubbleStyle)