@@ -133,6 +133,7 @@ public final class ChatTextInputActionButtonsNode: ASDisplayNode, ChatSendMessag
133133 private let presentationContext : ChatPresentationContext ?
134134 private let strings : PresentationStrings
135135
136+ public let micButtonBackgroundView : GlassBackgroundView
136137 public let micButtonTintMaskView : UIImageView
137138 public let micButton : ChatTextInputMediaRecordingButton
138139
@@ -146,6 +147,7 @@ public final class ChatTextInputActionButtonsNode: ASDisplayNode, ChatSendMessag
146147 public let textNode : ImmediateAnimatedCountLabelNode
147148
148149 public let expandMediaInputButton : HighlightTrackingButton
150+ private let expandMediaInputButtonBackgroundView : GlassBackgroundView
149151 private let expandMediaInputButtonIcon : GlassBackgroundView . ContentImageView
150152
151153 private var effectBadgeView : EffectBadgeView ?
@@ -173,13 +175,14 @@ public final class ChatTextInputActionButtonsNode: ASDisplayNode, ChatSendMessag
173175 let strings = presentationInterfaceState. strings
174176 self . strings = strings
175177
178+ self . micButtonBackgroundView = GlassBackgroundView ( )
176179 self . maskContentView = UIView ( )
177180
178181 self . micButtonTintMaskView = UIImageView ( )
179182 self . micButtonTintMaskView. tintColor = . black
180183 self . micButton = ChatTextInputMediaRecordingButton ( context: context, theme: theme, pause: true , strings: strings, presentController: presentController)
181184 self . micButton. animationOutput = self . micButtonTintMaskView
182- self . maskContentView. addSubview ( self . micButtonTintMaskView)
185+ self . micButtonBackgroundView . maskContentView. addSubview ( self . micButtonTintMaskView)
183186
184187 self . sendContainerNode = ASDisplayNode ( )
185188 self . sendContainerNode. layer. allowsGroupOpacity = true
@@ -192,12 +195,14 @@ public final class ChatTextInputActionButtonsNode: ASDisplayNode, ChatSendMessag
192195 self . textNode. isUserInteractionEnabled = false
193196
194197 self . expandMediaInputButton = HighlightTrackingButton ( )
198+ self . expandMediaInputButtonBackgroundView = GlassBackgroundView ( )
199+ self . expandMediaInputButtonBackgroundView. isUserInteractionEnabled = false
200+ self . expandMediaInputButton. addSubview ( self . expandMediaInputButtonBackgroundView)
195201 self . expandMediaInputButtonIcon = GlassBackgroundView . ContentImageView ( )
196- self . maskContentView . addSubview ( self . expandMediaInputButtonIcon. tintMask )
202+ self . expandMediaInputButtonBackgroundView . contentView . addSubview ( self . expandMediaInputButtonIcon)
197203 self . expandMediaInputButtonIcon. image = PresentationResourcesChat . chatInputPanelExpandButtonImage ( presentationInterfaceState. theme)
198- self . expandMediaInputButtonIcon. tintColor = theme. chat. inputPanel. inputControlColor. withAlphaComponent ( 1.0 )
199- self . expandMediaInputButtonIcon. setMonochromaticEffect ( tintColor: theme. chat. inputPanel. panelControlColor. withAlphaComponent ( 1.0 ) )
200- self . expandMediaInputButtonIcon. alpha = theme. chat. inputPanel. panelControlColor. alpha
204+ self . expandMediaInputButtonIcon. tintColor = theme. chat. inputPanel. panelControlColor
205+ self . expandMediaInputButtonIcon. setMonochromaticEffect ( tintColor: theme. chat. inputPanel. panelControlColor)
201206
202207 super. init ( )
203208
@@ -225,14 +230,14 @@ public final class ChatTextInputActionButtonsNode: ASDisplayNode, ChatSendMessag
225230 }
226231
227232 self . micButton. layer. allowsGroupOpacity = true
233+ self . view. addSubview ( self . micButtonBackgroundView)
228234 self . view. addSubview ( self . micButton)
229235
230236 self . addSubnode ( self . sendContainerNode)
231237 self . sendContainerNode. view. addSubview ( self . sendButtonBackgroundView)
232238 self . sendContainerNode. addSubnode ( self . sendButton)
233239 self . sendContainerNode. addSubnode ( self . textNode)
234240 self . view. addSubview ( self . expandMediaInputButton)
235- self . expandMediaInputButton. addSubview ( self . expandMediaInputButtonIcon)
236241
237242 self . expandMediaInputButton. highligthedChanged = { [ weak self] highlighted in
238243 guard let self else {
@@ -265,9 +270,8 @@ public final class ChatTextInputActionButtonsNode: ASDisplayNode, ChatSendMessag
265270
266271 public func updateTheme( theme: PresentationTheme , wallpaper: TelegramWallpaper ) {
267272 self . micButton. updateTheme ( theme: theme)
268- self . expandMediaInputButtonIcon. tintColor = theme. chat. inputPanel. panelControlColor. withAlphaComponent ( 1.0 )
269- self . expandMediaInputButtonIcon. setMonochromaticEffect ( tintColor: theme. chat. inputPanel. panelControlColor. withAlphaComponent ( 1.0 ) )
270- self . expandMediaInputButtonIcon. alpha = theme. chat. inputPanel. panelControlColor. alpha
273+ self . expandMediaInputButtonIcon. tintColor = theme. chat. inputPanel. panelControlColor
274+ self . expandMediaInputButtonIcon. setMonochromaticEffect ( tintColor: theme. chat. inputPanel. panelControlColor)
271275 }
272276
273277 private var absoluteRect : ( CGRect , CGSize ) ?
@@ -286,7 +290,7 @@ public final class ChatTextInputActionButtonsNode: ASDisplayNode, ChatSendMessag
286290 self . validLayout = size
287291
288292 var innerSize = size
289- innerSize. width = 38 .0 + 3.0 * 2.0
293+ innerSize. width = 40 .0 + 3.0 * 2.0
290294
291295 var starsAmount : Int64 ?
292296 if let sendPaidMessageStars = interfaceState. sendPaidMessageStars, interfaceState. interfaceState. editMessage == nil {
@@ -336,19 +340,26 @@ public final class ChatTextInputActionButtonsNode: ASDisplayNode, ChatSendMessag
336340 self . sendButton. imageNode. alpha = 1.0
337341 self . textNode. isHidden = true
338342 }
343+
344+ transition. updateFrame ( view: self . micButtonBackgroundView, frame: CGRect ( origin: CGPoint ( ) , size: size) )
345+ self . micButtonBackgroundView. update ( size: size, cornerRadius: size. height * 0.5 , isDark: interfaceState. theme. overallDarkAppearance, tintColor: . init( kind: . panel, color: interfaceState. theme. chat. inputPanel. inputBackgroundColor. withMultipliedAlpha ( 0.7 ) ) , transition: ComponentTransition ( transition) )
339346
340- transition. updateFrame ( layer: self . micButton. layer, frame: CGRect ( origin: CGPoint ( x : 7.0 , y : 0.0 ) , size: CGSize ( width : size. width - 7.0 , height : size . height ) ) )
347+ transition. updateFrame ( layer: self . micButton. layer, frame: CGRect ( origin: CGPoint ( ) , size: size) )
341348 self . micButton. layoutItems ( )
342349
343350 transition. updateFrame ( view: self . sendButtonBackgroundView, frame: CGRect ( origin: CGPoint ( ) , size: innerSize) . insetBy ( dx: 3.0 , dy: 3.0 ) )
344351 self . sendButtonBackgroundView. tintColor = interfaceState. theme. chat. inputPanel. panelControlAccentColor
345352 transition. updateFrame ( layer: self . sendButton. layer, frame: CGRect ( origin: CGPoint ( ) , size: innerSize) )
346- transition. updateFrame ( node: self . sendContainerNode, frame: CGRect ( origin: CGPoint ( ) , size: innerSize) )
353+ let sendContainerFrame = CGRect ( origin: CGPoint ( ) , size: innerSize)
354+ transition. updatePosition ( node: self . sendContainerNode, position: sendContainerFrame. center)
355+ transition. updateBounds ( node: self . sendContainerNode, bounds: CGRect ( origin: CGPoint ( ) , size: sendContainerFrame. size) )
347356
348357 let backgroundSize = CGSize ( width: innerSize. width, height: 40.0 )
349358 let backgroundFrame = CGRect ( origin: CGPoint ( x: showTitle ? 5.0 + UIScreenPixel : floorToScreenPixels ( ( size. width - backgroundSize. width) / 2.0 ) , y: floorToScreenPixels ( ( size. height - backgroundSize. height) / 2.0 ) ) , size: backgroundSize)
350359
351360 transition. updateFrame ( view: self . expandMediaInputButton, frame: CGRect ( origin: CGPoint ( ) , size: size) )
361+ transition. updateFrame ( view: self . expandMediaInputButtonBackgroundView, frame: CGRect ( origin: CGPoint ( ) , size: size) )
362+ self . expandMediaInputButtonBackgroundView. update ( size: size, cornerRadius: size. height * 0.5 , isDark: interfaceState. theme. overallDarkAppearance, tintColor: . init( kind: . panel, color: interfaceState. theme. chat. inputPanel. inputBackgroundColor. withMultipliedAlpha ( 0.7 ) ) , transition: ComponentTransition ( transition) )
352363 if let image = self . expandMediaInputButtonIcon. image {
353364 let expandIconFrame = CGRect ( origin: CGPoint ( x: floor ( ( size. width - image. size. width) * 0.5 ) , y: floor ( ( size. height - image. size. height) * 0.5 ) ) , size: image. size)
354365 self . expandMediaInputButtonIcon. center = expandIconFrame. center
0 commit comments