Signal-iOS/Signal/ConversationView/ConversationBottomPanelView.swift
Igor Solomennikov 943bbabdc1
Second round of improvements to chat input bar appearance on iOS 26.
• modernize and unify appearance of different conversation input blocking panels.
• make chat search bar look pretty on iOS 26.
• add blur/tint under the conversation input bottom bar to improve legibility.

Fixes:
• interactive keyboard dismissal would accelerate scroll in conversation
• unpleasant appearance of the chat input bar open opening of the conversation
2025-10-27 12:46:18 -07:00

49 lines
1.7 KiB
Swift

//
// Copyright 2025 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
//
import SignalUI
class ConversationBottomPanelView: UIView {
/// Subclasses must add content here.
var contentView: UIView {
backgroundView.contentView
}
/// Subclasses must constrain their content to this layout guide.
let contentLayoutGuide = UILayoutGuide()
private lazy var backgroundView = UIVisualEffectView(effect: UIBlurEffect(style: .prominent))
override init(frame: CGRect) {
super.init(frame: frame)
directionalLayoutMargins = .init(hMargin: 16, vMargin: 16)
addLayoutGuide(contentLayoutGuide)
addSubview(backgroundView)
backgroundView.translatesAutoresizingMaskIntoConstraints = false
addConstraints([
backgroundView.topAnchor.constraint(equalTo: topAnchor),
backgroundView.leadingAnchor.constraint(equalTo: leadingAnchor),
backgroundView.trailingAnchor.constraint(equalTo: trailingAnchor),
backgroundView.bottomAnchor.constraint(equalTo: bottomAnchor),
contentLayoutGuide.topAnchor.constraint(equalTo: layoutMarginsGuide.topAnchor),
contentLayoutGuide.leadingAnchor.constraint(equalTo: layoutMarginsGuide.leadingAnchor),
contentLayoutGuide.trailingAnchor.constraint(equalTo: layoutMarginsGuide.trailingAnchor),
contentLayoutGuide.bottomAnchor.constraint(
equalTo: safeAreaLayoutGuide.bottomAnchor,
constant: UIDevice.current.hasIPhoneXNotch ? 0 : -12
)
])
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}