mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-19 08:03:50 +02:00
Merge MatrixKit develop with commit hash: b85b736313bec0592bd1cabc68035d97f5331137
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
Copyright 2015 OpenMarket Ltd
|
||||
Copyright 2017 Vector Creations Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#import "MXKInterleavedRecentTableViewCell.h"
|
||||
|
||||
#import "MXKSessionRecentsDataSource.h"
|
||||
|
||||
#import "MXKAccountManager.h"
|
||||
|
||||
@implementation MXKInterleavedRecentTableViewCell
|
||||
|
||||
#pragma mark - Class methods
|
||||
|
||||
- (void)awakeFromNib
|
||||
{
|
||||
[super awakeFromNib];
|
||||
|
||||
CAShapeLayer *userFlagMaskLayer = [[CAShapeLayer alloc] init];
|
||||
userFlagMaskLayer.frame = _userFlag.bounds;
|
||||
|
||||
UIBezierPath *path = [[UIBezierPath alloc] init];
|
||||
[path moveToPoint:CGPointMake(0, 0)];
|
||||
[path addLineToPoint:CGPointMake(_userFlag.frame.size.width, _userFlag.frame.size.height)];
|
||||
[path addLineToPoint:CGPointMake(_userFlag.frame.size.width, 0)];
|
||||
[path closePath];
|
||||
|
||||
userFlagMaskLayer.path = path.CGPath;
|
||||
_userFlag.layer.mask = userFlagMaskLayer;
|
||||
}
|
||||
|
||||
- (void)render:(MXKCellData *)cellData
|
||||
{
|
||||
[super render:cellData];
|
||||
|
||||
// Highlight the room owner by using his tint color.
|
||||
if (roomCellData)
|
||||
{
|
||||
MXKAccount *account = [[MXKAccountManager sharedManager] accountForUserId:roomCellData.mxSession.myUserId];
|
||||
if (account)
|
||||
{
|
||||
_userFlag.backgroundColor = account.userTintColor;
|
||||
}
|
||||
else
|
||||
{
|
||||
_userFlag.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user