Signal-iOS/Signal/ConversationView/ConversationViewController+BodyRangesTextViewDelegate.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

46 lines
1.6 KiB
Swift

//
// Copyright 2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
//
public import SignalServiceKit
public import SignalUI
extension ConversationViewController: BodyRangesTextViewDelegate {
var supportsMentions: Bool { thread.allowsMentionSend }
public func textViewDidBeginTypingMention(_ textView: BodyRangesTextView) {}
public func textViewDidEndTypingMention(_ textView: BodyRangesTextView) {}
public func textViewMentionPickerParentView(_ textView: BodyRangesTextView) -> UIView? {
view
}
public func textViewMentionPickerReferenceView(_ textView: BodyRangesTextView) -> UIView? {
bottomBarContainer
}
public func textViewMentionPickerPossibleAddresses(_ textView: BodyRangesTextView, tx: DBReadTransaction) -> [SignalServiceAddress] {
supportsMentions ? thread.recipientAddresses(with: SDSDB.shimOnlyBridge(tx)) : []
}
public func textViewMentionCacheInvalidationKey(_ textView: BodyRangesTextView) -> String {
return thread.uniqueId
}
public func textViewDisplayConfiguration(_ textView: BodyRangesTextView) -> HydratedMessageBody.DisplayConfiguration {
return .composing(textViewColor: textView.textColor)
}
public func mentionPickerStyle(_ textView: BodyRangesTextView) -> MentionPickerStyle {
return .default
}
public func textViewDidInsertMemoji(_ memojiGlyph: OWSAdaptiveImageGlyph) {
// Note: attachment might be nil or have an error at this point; that's fine.
let attachment = SignalAttachment.attachmentFromMemoji(memojiGlyph)
self.didPasteAttachments(attachment.map { [$0] })
}
}