Merge pull request #6039 from vector-im/aringenbach/3526_user_pills

Add mention pills to timeline & composer
This commit is contained in:
aringenbach
2022-05-12 11:05:22 +02:00
committed by GitHub
35 changed files with 1576 additions and 345 deletions
@@ -430,7 +430,15 @@ NSString *const URLPreviewDidUpdateNotification = @"URLPreviewDidUpdateNotificat
if (selectedComponentIndex != NSNotFound && selectedComponentIndex != index && componentString.length)
{
// Apply alpha to blur this component
componentString = [Tools setTextColorAlpha:.2 inAttributedString:componentString];
componentString = [componentString withTextColorAlpha:.2];
if (@available(iOS 15.0, *)) {
[PillsFormatter setPillAlpha:.2 inAttributedString:componentString];
}
}
else if (@available(iOS 15.0, *))
{
// PillTextAttachment are not created again every time, we have to set alpha back to standard if needed.
[PillsFormatter setPillAlpha:1.f inAttributedString:componentString];
}
// Check whether the timestamp is displayed for this component, and check whether a vertical whitespace is required
@@ -469,7 +477,15 @@ NSString *const URLPreviewDidUpdateNotification = @"URLPreviewDidUpdateNotificat
if (selectedComponentIndex != NSNotFound && selectedComponentIndex != index && componentString.length)
{
// Apply alpha to blur this component
componentString = [Tools setTextColorAlpha:.2 inAttributedString:componentString];
componentString = [componentString withTextColorAlpha:.2];
if (@available(iOS 15.0, *)) {
[PillsFormatter setPillAlpha:.2 inAttributedString:componentString];
}
}
else if (@available(iOS 15.0, *))
{
// PillTextAttachment are not created again every time, we have to set alpha back to standard if needed.
[PillsFormatter setPillAlpha:1.f inAttributedString:componentString];
}
// Check whether the timestamp is displayed