Merge pull request #5383 from vector-im/steve/5208_text_msg_layout

Message bubbles: Text message layout
This commit is contained in:
SBiOSoftWhare
2022-01-21 16:06:57 +01:00
committed by GitHub
50 changed files with 2154 additions and 399 deletions

View File

@@ -163,4 +163,11 @@
*/
- (MXKRoomBubbleComponent*)getFirstBubbleComponentWithDisplay;
/**
Get the last visible component.
@return Last visible component or nil.
*/
- (MXKRoomBubbleComponent*)getLastBubbleComponentWithDisplay;
@end

View File

@@ -306,16 +306,15 @@
return first;
}
- (MXKRoomBubbleComponent*) getFirstBubbleComponentWithDisplay
- (MXKRoomBubbleComponent*)getFirstBubbleComponentWithDisplay
{
// Look for the first component which is actually displayed (some event are ignored in room history display).
MXKRoomBubbleComponent* first = nil;
@synchronized(bubbleComponents)
{
for (NSInteger index = 0; index < bubbleComponents.count; index++)
for (MXKRoomBubbleComponent *component in bubbleComponents)
{
MXKRoomBubbleComponent *component = bubbleComponents[index];
if (component.attributedTextMessage)
{
first = component;
@@ -327,6 +326,26 @@
return first;
}
- (MXKRoomBubbleComponent*)getLastBubbleComponentWithDisplay
{
// Look for the first component which is actually displayed (some event are ignored in room history display).
MXKRoomBubbleComponent* lastVisibleComponent = nil;
@synchronized(bubbleComponents)
{
for (MXKRoomBubbleComponent *component in bubbleComponents.reverseObjectEnumerator)
{
if (component.attributedTextMessage)
{
lastVisibleComponent = component;
break;
}
}
}
return lastVisibleComponent;
}
- (NSAttributedString*)attributedTextMessageWithHighlightedEvent:(NSString*)eventId tintColor:(UIColor*)tintColor
{
NSAttributedString *customAttributedTextMsg;