mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-22 01:22:46 +02:00
merged element 1.10.12 into bum
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
class RoomInputToolbarTextView: UITextView {
|
||||
|
||||
private var heightConstraint: NSLayoutConstraint!
|
||||
private var pillViews = [UIView]()
|
||||
|
||||
weak var toolbarDelegate: RoomInputToolbarTextViewDelegate?
|
||||
|
||||
@@ -51,12 +52,18 @@ class RoomInputToolbarTextView: UITextView {
|
||||
}
|
||||
|
||||
override var text: String! {
|
||||
willSet {
|
||||
flushPills()
|
||||
}
|
||||
didSet {
|
||||
updateUI()
|
||||
}
|
||||
}
|
||||
|
||||
override var attributedText: NSAttributedString! {
|
||||
willSet {
|
||||
flushPills()
|
||||
}
|
||||
didSet {
|
||||
updateUI()
|
||||
}
|
||||
@@ -162,3 +169,17 @@ class RoomInputToolbarTextView: UITextView {
|
||||
delegate.onTouchUp(inside: delegate.rightInputToolbarButton)
|
||||
}
|
||||
}
|
||||
|
||||
extension RoomInputToolbarTextView: PillViewFlusher {
|
||||
func registerPillView(_ pillView: UIView) {
|
||||
pillViews.append(pillView)
|
||||
}
|
||||
|
||||
private func flushPills() {
|
||||
for view in pillViews {
|
||||
view.alpha = 0.0
|
||||
view.removeFromSuperview()
|
||||
}
|
||||
pillViews.removeAll()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
@class RoomInputToolbarView;
|
||||
@class LinkActionWrapper;
|
||||
@class SuggestionPatternWrapper;
|
||||
@class UserSuggestionViewModelContextWrapper;
|
||||
@class CompletionSuggestionViewModelContextWrapper;
|
||||
|
||||
/**
|
||||
Destination of the message in the composer
|
||||
@@ -84,7 +84,7 @@ typedef NS_ENUM(NSUInteger, RoomInputToolbarViewSendMode)
|
||||
|
||||
- (void)didDetectTextPattern: (SuggestionPatternWrapper *)suggestionPattern;
|
||||
|
||||
- (UserSuggestionViewModelContextWrapper *)userSuggestionContext;
|
||||
- (CompletionSuggestionViewModelContextWrapper *)completionSuggestionContext;
|
||||
|
||||
- (MXMediaManager *)mediaManager;
|
||||
|
||||
|
||||
@@ -70,6 +70,8 @@ static const NSTimeInterval kActionMenuComposerHeightAnimationDuration = .3;
|
||||
|
||||
_sendMode = RoomInputToolbarViewSendModeSend;
|
||||
self.inputContextViewHeightConstraint.constant = 0;
|
||||
self.inputContextLabel.isAccessibilityElement = NO;
|
||||
self.inputContextButton.isAccessibilityElement = NO;
|
||||
|
||||
[self.rightInputToolbarButton setTitle:nil forState:UIControlStateNormal];
|
||||
[self.rightInputToolbarButton setTitle:nil forState:UIControlStateHighlighted];
|
||||
@@ -255,6 +257,10 @@ static const NSTimeInterval kActionMenuComposerHeightAnimationDuration = .3;
|
||||
break;
|
||||
}
|
||||
|
||||
// Hide the context items from VoiceOver when the context view is "hidden".
|
||||
self.inputContextLabel.isAccessibilityElement = self.inputContextViewHeightConstraint.constant > 0;
|
||||
self.inputContextButton.isAccessibilityElement = self.inputContextViewHeightConstraint.constant > 0;
|
||||
|
||||
[self.rightInputToolbarButton setImage:buttonImage forState:UIControlStateNormal];
|
||||
|
||||
if (self.maxHeight && updatedHeight > self.maxHeight)
|
||||
@@ -480,11 +486,22 @@ static const NSTimeInterval kActionMenuComposerHeightAnimationDuration = .3;
|
||||
[self.mainToolbarView.leftAnchor constraintEqualToAnchor:self.voiceMessageToolbarView.leftAnchor],
|
||||
[self.mainToolbarView.bottomAnchor constraintEqualToAnchor:self.voiceMessageToolbarView.bottomAnchor],
|
||||
[self.mainToolbarView.rightAnchor constraintEqualToAnchor:self.voiceMessageToolbarView.rightAnchor]]];
|
||||
|
||||
// The voice message toolbar is taller than the input toolbar so the record button is read
|
||||
// out before the other subviews. Fix this by manually adding the elements in the right order.
|
||||
self.accessibilityElements = @[self.attachMediaButton,
|
||||
self.actionsBar,
|
||||
self.inputContextLabel,
|
||||
self.inputContextButton,
|
||||
self.textView,
|
||||
self.rightInputToolbarButton,
|
||||
self.voiceMessageToolbarView];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self.voiceMessageToolbarView removeFromSuperview];
|
||||
_voiceMessageToolbarView = nil;
|
||||
self.accessibilityElements = nil;
|
||||
}
|
||||
}
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user