Skip to content

Commit bdca60c

Browse files
author
Isaac
committed
Update
1 parent 4746b8d commit bdca60c

File tree

6 files changed

+189
-53
lines changed

6 files changed

+189
-53
lines changed

submodules/Components/PagerComponent/Sources/PagerComponent.swift

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ public protocol PagerContentViewWithBackground: UIView {
1717
func pagerUpdateBackground(backgroundFrame: CGRect, topPanelHeight: CGFloat, externalTintMaskContainer: UIView?, transition: ComponentTransition)
1818
}
1919

20+
public protocol PagerTopPanelView: UIView {
21+
var tintContentMask: UIView { get }
22+
}
23+
2024
public final class PagerComponentChildEnvironment: Equatable {
2125
public struct ContentScrollingUpdate {
2226
public var relativeOffset: CGFloat
@@ -671,19 +675,33 @@ public final class PagerComponent<ChildEnvironmentType: Equatable, TopPanelEnvir
671675
topPanelOffset = topPanelSize.height
672676
}
673677

678+
if let topPanelView = topPanelView.componentView as? PagerTopPanelView {
679+
if let externalTintMaskContainer = component.externalTintMaskContainer, topPanelView.tintContentMask.superview == nil {
680+
externalTintMaskContainer.addSubview(topPanelView.tintContentMask)
681+
}
682+
}
683+
674684
if component.externalTopPanelContainer != nil {
675685
var visibleTopPanelHeight = max(0.0, topPanelSize.height - topPanelOffset)
676686
if case .hide = component.panelHideBehavior {
677687
visibleTopPanelHeight = 0.0
678688
} else if case .disable = component.panelHideBehavior {
679689
visibleTopPanelHeight = 0.0
680690
}
681-
panelStateTransition.setFrame(view: topPanelView, frame: CGRect(origin: CGPoint(), size: CGSize(width: topPanelSize.width, height: visibleTopPanelHeight)))
691+
let topPanelFrame = CGRect(origin: CGPoint(), size: CGSize(width: topPanelSize.width, height: visibleTopPanelHeight))
692+
panelStateTransition.setFrame(view: topPanelView, frame: topPanelFrame)
693+
if let topPanelView = topPanelView.componentView as? PagerTopPanelView {
694+
panelStateTransition.setFrame(view: topPanelView.tintContentMask, frame: topPanelFrame)
695+
}
682696

683697
panelStateTransition.setFrame(view: self.contentClippingView, frame: CGRect(origin: .zero, size: contentSize))
684698
panelStateTransition.setBounds(view: self.contentClippingView, bounds: CGRect(origin: .zero, size: contentSize))
685699
} else {
686-
panelStateTransition.setFrame(view: topPanelView, frame: CGRect(origin: CGPoint(x: 0.0, y: -topPanelOffset), size: topPanelSize))
700+
let topPanelFrame = CGRect(origin: CGPoint(x: 0.0, y: -topPanelOffset), size: topPanelSize)
701+
panelStateTransition.setFrame(view: topPanelView, frame: topPanelFrame)
702+
if let topPanelView = topPanelView.componentView as? PagerTopPanelView {
703+
panelStateTransition.setFrame(view: topPanelView.tintContentMask, frame: topPanelFrame)
704+
}
687705

688706
let clippingOffset: CGFloat = component.clipContentToTopPanel ? topPanelSize.height - topPanelOffset : 0.0
689707
panelStateTransition.setFrame(view: self.contentClippingView, frame: CGRect(origin: CGPoint(x: 0.0, y: clippingOffset), size: contentSize))

submodules/TelegramUI/Components/Chat/ChatTextInputPanelNode/Sources/AccessoryItemIconButton.swift

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,9 @@ final class AccessoryItemIconButton: HighlightTrackingButton, GlassBackgroundVie
8888
}
8989

9090
self.iconImageView.image = image
91-
if #available(iOS 26.0, *) {
92-
self.iconImageView.tintColor = theme.chat.inputPanel.inputControlColor.withAlphaComponent(1.0)
93-
self.iconImageView.alpha = alpha * theme.chat.inputPanel.inputControlColor.alpha
94-
} else {
95-
self.iconImageView.tintColor = theme.chat.inputPanel.inputControlColor
96-
self.iconImageView.alpha = alpha
97-
}
91+
self.iconImageView.tintColor = theme.chat.inputPanel.inputControlColor.withAlphaComponent(1.0)
92+
self.iconImageView.alpha = alpha * theme.chat.inputPanel.inputControlColor.alpha
93+
self.iconImageView.tintMask.alpha = alpha * theme.chat.inputPanel.inputControlColor.alpha
9894

9995
self.accessibilityLabel = accessibilityLabel
10096

@@ -134,13 +130,8 @@ final class AccessoryItemIconButton: HighlightTrackingButton, GlassBackgroundVie
134130
}
135131

136132
self.iconImageView.image = image
137-
if #available(iOS 26.0, *) {
138-
self.iconImageView.tintColor = theme.chat.inputPanel.inputControlColor.withAlphaComponent(1.0)
139-
self.iconImageView.alpha = alpha * theme.chat.inputPanel.inputControlColor.alpha
140-
} else {
141-
self.iconImageView.tintColor = theme.chat.inputPanel.inputControlColor
142-
self.iconImageView.alpha = alpha
143-
}
133+
self.iconImageView.tintColor = theme.chat.inputPanel.inputControlColor.withAlphaComponent(1.0)
134+
self.iconImageView.alpha = alpha * theme.chat.inputPanel.inputControlColor.alpha
144135

145136
self.accessibilityLabel = accessibilityLabel
146137
}

submodules/TelegramUI/Components/EntityKeyboard/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ swift_library(
5252
"//submodules/TelegramCore/FlatSerialization",
5353
"//submodules/TelegramUI/Components/BatchVideoRendering",
5454
"//submodules/TelegramUI/Components/GifVideoLayer",
55+
"//submodules/TelegramUI/Components/GlassBackgroundComponent",
5556
],
5657
visibility = [
5758
"//visibility:public",

submodules/TelegramUI/Components/EntityKeyboard/Sources/EntityKeyboardTopContainerPanelComponent.swift

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,12 @@ final class EntityKeyboardTopContainerPanelComponent: Component {
7272

7373
private final class PanelView {
7474
let view = ComponentHostView<EntityKeyboardTopContainerPanelEnvironment>()
75+
let tintContentView = UIView()
7576
let visibilityFractionUpdated = ActionSlot<(CGFloat, ComponentTransition)>()
7677
var isExpanded: Bool = false
7778
}
7879

79-
final class View: UIView {
80+
final class View: UIView, PagerTopPanelView {
8081
private var backgroundView: BlurredBackgroundView?
8182
private var backgroundSeparatorView: UIView?
8283

@@ -88,7 +89,11 @@ final class EntityKeyboardTopContainerPanelComponent: Component {
8889

8990
private var visibilityFraction: CGFloat = 1.0
9091

92+
public let tintContentMask: UIView
93+
9194
override init(frame: CGRect) {
95+
self.tintContentMask = UIView()
96+
9297
super.init(frame: frame)
9398

9499
self.disablesInteractiveKeyboardGestureRecognizer = true
@@ -150,6 +155,7 @@ final class EntityKeyboardTopContainerPanelComponent: Component {
150155
panelView = PanelView()
151156
self.panelViews[panel.id] = panelView
152157
self.addSubview(panelView.view)
158+
self.tintContentMask.addSubview(panelView.tintContentView)
153159
}
154160

155161
let panelId = panel.id
@@ -172,12 +178,20 @@ final class EntityKeyboardTopContainerPanelComponent: Component {
172178
)
173179
if isInBounds {
174180
transition.animatePosition(view: panelView.view, from: CGPoint(x: transitionOffsetFraction * availableSize.width, y: 0.0), to: CGPoint(), additive: true, completion: nil)
181+
transition.animatePosition(view: panelView.tintContentView, from: CGPoint(x: transitionOffsetFraction * availableSize.width, y: 0.0), to: CGPoint(), additive: true, completion: nil)
175182
}
176183
panelTransition.setFrame(view: panelView.view, frame: panelFrame, completion: { [weak self] completed in
177184
if isPartOfTransition && completed {
178185
self?.state?.updated(transition: .immediate)
179186
}
180187
})
188+
panelTransition.setFrame(view: panelView.tintContentView, frame: panelFrame)
189+
if let panelViewImpl = panelView.view.componentView as? PagerTopPanelView {
190+
if panelViewImpl.tintContentMask.superview == nil {
191+
panelView.tintContentView.addSubview(panelViewImpl.tintContentMask)
192+
}
193+
panelTransition.setFrame(view: panelViewImpl.tintContentMask, frame: CGRect(origin: CGPoint(), size: panelFrame.size))
194+
}
181195
}
182196
}
183197
}
@@ -186,6 +200,7 @@ final class EntityKeyboardTopContainerPanelComponent: Component {
186200
if !validPanelIds.contains(id) {
187201
removedPanelIds.append(id)
188202
panelView.view.removeFromSuperview()
203+
panelView.tintContentView.removeFromSuperview()
189204
}
190205
}
191206
for id in removedPanelIds {

0 commit comments

Comments
 (0)