edit reply completed, just need to polish the UI a bit more.

This commit is contained in:
Mauro Romito
2022-10-11 21:04:04 +02:00
parent 0e5607da2e
commit 113ef5dcfe
4 changed files with 56 additions and 27 deletions
+14 -7
View File
@@ -195,6 +195,7 @@ static CGSize kThreadListBarButtonItemImageSize;
@property (nonatomic, strong) RoomContextualMenuPresenter *roomContextualMenuPresenter;
@property (nonatomic, strong) MXKErrorAlertPresentation *errorPresenter;
@property (nonatomic, strong) NSAttributedString *textMessageBeforeEditing;
@property (nonatomic, strong) NSString *htmlTextBeforeEditing;
@property (nonatomic, strong) EditHistoryCoordinatorBridgePresenter *editHistoryPresenter;
@property (nonatomic, strong) MXKDocumentPickerPresenter *documentPickerPresenter;
@property (nonatomic, strong) EmojiPickerCoordinatorBridgePresenter *emojiPickerCoordinatorBridgePresenter;
@@ -4614,12 +4615,11 @@ static CGSize kThreadListBarButtonItemImageSize;
{
MXEvent *event = [self.roomDataSource eventWithEventId:eventId];
if ([self inputToolbarConformsToHtmlToolbarViewProtocol]) {
// TODO: reimplemented the following line when the cancel UI button is implemented in the WYSIWYG toolbar
self.textMessageBeforeEditing = self.inputToolbarView.attributedTextMessage;
if ([self inputToolbarConformsToHtmlToolbarViewProtocol])
{
MXKRoomInputToolbarView <HtmlRoomInputToolbarViewProtocol> *htmlInputToolBarView = (MXKRoomInputToolbarView <HtmlRoomInputToolbarViewProtocol> *) self.inputToolbarView;
[htmlInputToolBarView setHtmlWithContent: [self.customizedRoomDataSource editableHtmlTextMessageFor:event]];
self.htmlTextBeforeEditing = htmlInputToolBarView.htmlContent;
htmlInputToolBarView.htmlContent = [self.customizedRoomDataSource editableHtmlTextMessageFor:event];
}
else if ([self inputToolbarConformsToToolbarViewProtocol])
{
@@ -4633,12 +4633,19 @@ static CGSize kThreadListBarButtonItemImageSize;
- (void)restoreTextMessageBeforeEditing
{
if (self.textMessageBeforeEditing && [self inputToolbarConformsToToolbarViewProtocol])
if (self.htmlTextBeforeEditing && [self inputToolbarConformsToHtmlToolbarViewProtocol])
{
MXKRoomInputToolbarView <HtmlRoomInputToolbarViewProtocol> *htmlInputToolBarView = (MXKRoomInputToolbarView <HtmlRoomInputToolbarViewProtocol> *) self.inputToolbarView;
htmlInputToolBarView.htmlContent = self.htmlTextBeforeEditing;
}
else if (self.textMessageBeforeEditing && [self inputToolbarConformsToToolbarViewProtocol])
{
self.inputToolbarView.attributedTextMessage = self.textMessageBeforeEditing;
}
self.textMessageBeforeEditing = nil;
self.htmlTextBeforeEditing = nil;
}
- (BOOL)inputToolbarConformsToHtmlToolbarViewProtocol
@@ -4966,7 +4973,7 @@ static CGSize kThreadListBarButtonItemImageSize;
}
}
- (void)roomInputToolbarViewDidTapCancel:(RoomInputToolbarView*)toolbarView
- (void)roomInputToolbarViewDidTapCancel:(MXKRoomInputToolbarView<RoomInputToolbarViewProtocol>*)toolbarView
{
[self cancelEventSelection];
}