mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-18 23:48:29 +02:00
Merge pull request #5383 from vector-im/steve/5208_text_msg_layout
Message bubbles: Text message layout
This commit is contained in:
@@ -163,4 +163,11 @@
|
||||
*/
|
||||
- (MXKRoomBubbleComponent*)getFirstBubbleComponentWithDisplay;
|
||||
|
||||
/**
|
||||
Get the last visible component.
|
||||
|
||||
@return Last visible component or nil.
|
||||
*/
|
||||
- (MXKRoomBubbleComponent*)getLastBubbleComponentWithDisplay;
|
||||
|
||||
@end
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user