Merge pull request #2564 from vector-im/riot_2538

BF: Quick reactions menu hide time and user display name
This commit is contained in:
SBiOSoftWhare
2019-07-09 10:37:40 +02:00
committed by GitHub
5 changed files with 98 additions and 1 deletions
@@ -80,6 +80,10 @@ typedef NS_ENUM(NSInteger, RoomBubbleCellDataTag)
*/
- (void)updateAdditionalContentHeightIfNeeded;
/**
The index of the first visible component. NSNotFound by default.
*/
- (NSInteger)firstVisibleComponentIndex;
#pragma mark - Show all reactions
@@ -277,6 +277,31 @@ static NSAttributedString *timestampVerticalWhitespace = nil;
return currentAttributedTextMsg;
}
- (NSInteger)firstVisibleComponentIndex
{
__block NSInteger firstVisibleComponentIndex = NSNotFound;
if (self.attachment && self.bubbleComponents.count)
{
firstVisibleComponentIndex = 0;
}
else
{
[self.bubbleComponents enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
MXKRoomBubbleComponent *component = (MXKRoomBubbleComponent*)obj;
if (component.attributedTextMessage)
{
firstVisibleComponentIndex = idx;
*stop = YES;
}
}];
}
return firstVisibleComponentIndex;
}
- (void)refreshBubbleComponentsPosition
{
// CAUTION: This method must be called on the main thread.
+1 -1
View File
@@ -5177,7 +5177,7 @@
if (bubbleComponents.count > 0)
{
NSInteger selectedComponentIndex = foundComponentIndex != NSNotFound ? foundComponentIndex : 0;
bubbleComponentFrame = [roomBubbleTableViewCell componentFrameInTableViewForIndex:selectedComponentIndex];
bubbleComponentFrame = [roomBubbleTableViewCell surroundingFrameInTableViewForComponentIndex:selectedComponentIndex];
}
else
{