|
|
@ -3,10 +3,14 @@
|
|
|
|
//
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
#import "OWSContactShareView.h"
|
|
|
|
#import "OWSContactShareView.h"
|
|
|
|
|
|
|
|
#import "OWSContactAvatarBuilder.h"
|
|
|
|
|
|
|
|
#import "Signal-Swift.h"
|
|
|
|
#import "UIColor+JSQMessages.h"
|
|
|
|
#import "UIColor+JSQMessages.h"
|
|
|
|
#import "UIColor+OWS.h"
|
|
|
|
#import "UIColor+OWS.h"
|
|
|
|
#import "UIFont+OWS.h"
|
|
|
|
#import "UIFont+OWS.h"
|
|
|
|
#import "UIView+OWS.h"
|
|
|
|
#import "UIView+OWS.h"
|
|
|
|
|
|
|
|
#import <SignalMessaging/Environment.h>
|
|
|
|
|
|
|
|
#import <SignalMessaging/SignalMessaging-Swift.h>
|
|
|
|
#import <SignalServiceKit/OWSContact.h>
|
|
|
|
#import <SignalServiceKit/OWSContact.h>
|
|
|
|
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
@ -101,22 +105,18 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
[contentView autoPinEdgeToSuperviewEdge:ALEdgeTop withInset:self.vMargin];
|
|
|
|
[contentView autoPinEdgeToSuperviewEdge:ALEdgeTop withInset:self.vMargin];
|
|
|
|
[contentView autoPinEdgeToSuperviewEdge:ALEdgeBottom withInset:self.vMargin];
|
|
|
|
[contentView autoPinEdgeToSuperviewEdge:ALEdgeBottom withInset:self.vMargin];
|
|
|
|
|
|
|
|
|
|
|
|
UIView *iconCircleView = [UIView containerView];
|
|
|
|
AvatarImageView *avatarView = [AvatarImageView new];
|
|
|
|
iconCircleView.backgroundColor = [UIColor colorWithRGBHex:0x00ffff];
|
|
|
|
// TODO: What's the best colorSeed value to use?
|
|
|
|
iconCircleView.layer.cornerRadius = self.iconSize * 0.5f;
|
|
|
|
OWSAvatarBuilder *avatarBuilder =
|
|
|
|
[iconCircleView autoSetDimension:ALDimensionWidth toSize:self.iconSize];
|
|
|
|
[[OWSContactAvatarBuilder alloc] initWithNonSignalName:self.contactShare.displayName
|
|
|
|
[iconCircleView autoSetDimension:ALDimensionHeight toSize:self.iconSize];
|
|
|
|
colorSeed:self.contactShare.displayName
|
|
|
|
[iconCircleView setCompressionResistanceHigh];
|
|
|
|
diameter:(NSUInteger)self.iconSize
|
|
|
|
[iconCircleView setContentHuggingHigh];
|
|
|
|
contactsManager:[Environment current].contactsManager];
|
|
|
|
|
|
|
|
avatarView.image = [avatarBuilder build];
|
|
|
|
// TODO: Use avatar, if present and downloaded. else default.
|
|
|
|
[avatarView autoSetDimension:ALDimensionWidth toSize:self.iconSize];
|
|
|
|
UIImage *image = [UIImage imageNamed:@"attachment_file"];
|
|
|
|
[avatarView autoSetDimension:ALDimensionHeight toSize:self.iconSize];
|
|
|
|
OWSAssert(image);
|
|
|
|
[avatarView setCompressionResistanceHigh];
|
|
|
|
UIImageView *imageView = [UIImageView new];
|
|
|
|
[avatarView setContentHuggingHigh];
|
|
|
|
imageView.image = [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
|
|
|
|
|
|
|
|
imageView.tintColor = self.bubbleBackgroundColor;
|
|
|
|
|
|
|
|
[iconCircleView addSubview:imageView];
|
|
|
|
|
|
|
|
[imageView autoCenterInSuperview];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UILabel *topLabel = [UILabel new];
|
|
|
|
UILabel *topLabel = [UILabel new];
|
|
|
|
topLabel.text = self.contactShare.displayName;
|
|
|
|
topLabel.text = self.contactShare.displayName;
|
|
|
@ -166,7 +166,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
[stackView autoPinEdgeToSuperviewEdge:ALEdgeTop withInset:0 relation:NSLayoutRelationGreaterThanOrEqual];
|
|
|
|
[stackView autoPinEdgeToSuperviewEdge:ALEdgeTop withInset:0 relation:NSLayoutRelationGreaterThanOrEqual];
|
|
|
|
[stackView autoPinEdgeToSuperviewEdge:ALEdgeBottom withInset:0 relation:NSLayoutRelationGreaterThanOrEqual];
|
|
|
|
[stackView autoPinEdgeToSuperviewEdge:ALEdgeBottom withInset:0 relation:NSLayoutRelationGreaterThanOrEqual];
|
|
|
|
|
|
|
|
|
|
|
|
[stackView addArrangedSubview:iconCircleView];
|
|
|
|
[stackView addArrangedSubview:avatarView];
|
|
|
|
[stackView addArrangedSubview:labelsView];
|
|
|
|
[stackView addArrangedSubview:labelsView];
|
|
|
|
[stackView addArrangedSubview:disclosureImageView];
|
|
|
|
[stackView addArrangedSubview:disclosureImageView];
|
|
|
|
}
|
|
|
|
}
|
|
|
|