@@ -15,11 +15,11 @@ public class GTChatMessageBoxNode: ASDisplayNode {
15
15
16
16
@objc lazy open var messageNode = GTChatMessageInputBoxNode ( )
17
17
open var messageBoxInsets : UIEdgeInsets = UIEdgeInsetsMake ( 10.0 , 10.0 , 10.0 , 10.0 )
18
- private var leftButtonGroups : [ GTChatMessageButtonNode ] = [ ]
19
- private var leftButtonGroupSpacing : CGFloat = 10.0
18
+ fileprivate var leftButtonGroups : [ GTChatMessageButtonNode ] = [ ]
19
+ fileprivate var leftButtonGroupSpacing : CGFloat = 10.0
20
20
21
- private var rightButtonGroups : [ GTChatMessageButtonNode ] = [ ]
22
- private var rightButtonGroupSpacing : CGFloat = 10.0
21
+ fileprivate var rightButtonGroups : [ GTChatMessageButtonNode ] = [ ]
22
+ fileprivate var rightButtonGroupSpacing : CGFloat = 10.0
23
23
24
24
fileprivate var minimumMessageBoxHeight : CGFloat = 50.0
25
25
fileprivate var maximumVisibleMessageNumberOfLines : Int = 6
@@ -37,26 +37,26 @@ public class GTChatMessageBoxNode: ASDisplayNode {
37
37
38
38
@discardableResult public func setupDefaultMessageBox( ) -> Node {
39
39
let cameraButton = GTChatMessageButtonNode ( )
40
- . setButtonSize ( . init( width: 24.0 , height: 24.0 ) )
41
- . setButtonImage ( #imageLiteral( resourceName: " photo " ) , color: . white, for: . normal)
42
- . setButtonImage ( #imageLiteral( resourceName: " photo " ) , color: UIColor . white. withAlphaComponent ( 0.5 ) , for: . disabled)
40
+ . setChatButtonSize ( . init( width: 24.0 , height: 24.0 ) )
41
+ . setChatButtonImage ( #imageLiteral( resourceName: " photo " ) , color: . white, for: . normal)
42
+ . setChatButtonImage ( #imageLiteral( resourceName: " photo " ) , color: UIColor . white. withAlphaComponent ( 0.5 ) , for: . disabled)
43
43
44
44
let sendButton = GTChatMessageButtonNode ( )
45
- . setButtonSize ( . init( width: 24.0 , height: 24.0 ) )
46
- . setButtonImage ( #imageLiteral( resourceName: " send " ) , color: . white, for: . normal)
47
- . setButtonImage ( #imageLiteral( resourceName: " send " ) , color: UIColor . white. withAlphaComponent ( 0.5 ) , for: . disabled)
45
+ . setChatButtonSize ( . init( width: 24.0 , height: 24.0 ) )
46
+ . setChatButtonImage ( #imageLiteral( resourceName: " send " ) , color: . white, for: . normal)
47
+ . setChatButtonImage ( #imageLiteral( resourceName: " send " ) , color: UIColor . white. withAlphaComponent ( 0.5 ) , for: . disabled)
48
48
49
- self . messageNode. setMessageContainerInsets ( UIEdgeInsetsMake ( 5.0 , 10.0 , 5.0 , 10.0 ) )
49
+ self . messageNode. setChatMessageContainerInsets ( UIEdgeInsetsMake ( 5.0 , 10.0 , 5.0 , 10.0 ) )
50
50
51
- self . setLeftButtons ( [ cameraButton] , spacing: 10.0 )
52
- . setRightButtons ( [ sendButton] , spacing: 10.0 )
53
- . setMessageBoxHeight ( 50.0 , maxiumNumberOfLine: 6 , isRounded: true )
51
+ self . setChatLeftButtons ( [ cameraButton] , spacing: 10.0 )
52
+ . setChatRightButtons ( [ sendButton] , spacing: 10.0 )
53
+ . setChatMessageBoxHeight ( 50.0 , maxiumNumberOfLine: 6 , isRounded: true )
54
54
return self
55
55
}
56
56
57
- @discardableResult public func setMessageBoxHeight ( _ minimumHeight: CGFloat ,
58
- maxiumNumberOfLine: Int ,
59
- isRounded: Bool ) -> Node {
57
+ @discardableResult public func setChatMessageBoxHeight ( _ minimumHeight: CGFloat ,
58
+ maxiumNumberOfLine: Int ,
59
+ isRounded: Bool ) -> Node {
60
60
self . style. height = . init( unit: . points, value: minimumHeight)
61
61
self . minimumMessageBoxHeight = minimumHeight
62
62
self . maximumVisibleMessageNumberOfLines = maxiumNumberOfLine
@@ -68,15 +68,15 @@ public class GTChatMessageBoxNode: ASDisplayNode {
68
68
return self
69
69
}
70
70
71
- @discardableResult public func setLeftButtons ( _ buttons: [ GTChatMessageButtonNode ] ,
72
- spacing: CGFloat ) -> Node {
71
+ @discardableResult public func setChatLeftButtons ( _ buttons: [ GTChatMessageButtonNode ] ,
72
+ spacing: CGFloat ) -> Node {
73
73
self . leftButtonGroupSpacing = spacing
74
74
self . leftButtonGroups = buttons
75
75
return self
76
76
}
77
77
78
- @discardableResult public func setRightButtons ( _ buttons: [ GTChatMessageButtonNode ] ,
79
- spacing: CGFloat ) -> Node {
78
+ @discardableResult public func setChatRightButtons ( _ buttons: [ GTChatMessageButtonNode ] ,
79
+ spacing: CGFloat ) -> Node {
80
80
self . rightButtonGroupSpacing = spacing
81
81
self . rightButtonGroups = buttons
82
82
return self
@@ -103,9 +103,9 @@ public class GTChatMessageBoxNode: ASDisplayNode {
103
103
104
104
if let rightButtonGroupLayout = self . rightButtonGroupLayoutSpec ( ) {
105
105
let rightButtonRelativeLayout = ASRelativeLayoutSpec ( horizontalPosition: . end,
106
- verticalPosition: . end,
107
- sizingOption: [ ] ,
108
- child: rightButtonGroupLayout)
106
+ verticalPosition: . end,
107
+ sizingOption: [ ] ,
108
+ child: rightButtonGroupLayout)
109
109
rightButtonRelativeLayout. style. spacingBefore = rightButtonGroupSpacing
110
110
messageBoxElements. append ( rightButtonRelativeLayout)
111
111
}
0 commit comments