Skip to content

Commit 2bd0ecb

Browse files
committed
Add user info to near people cell.
1 parent 2aff47c commit 2bd0ecb

4 files changed

Lines changed: 51 additions & 6 deletions

File tree

Example/MessageDisplayExample/MessageDisplayExample.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,7 @@
393393
AB44D41B192D8BB50069A210 /* XHContact.h in Headers */ = {isa = PBXBuildFile; fileRef = AB44D419192D8BB50069A210 /* XHContact.h */; settings = {ATTRIBUTES = (Public, ); }; };
394394
AB44D41C192D8BB50069A210 /* XHContact.m in Sources */ = {isa = PBXBuildFile; fileRef = AB44D41A192D8BB50069A210 /* XHContact.m */; };
395395
AB44D41D192D8BB50069A210 /* XHContact.m in Sources */ = {isa = PBXBuildFile; fileRef = AB44D41A192D8BB50069A210 /* XHContact.m */; };
396+
AB4F12F61932AC1300693BD5 /* AlbumFlagMark@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = AB4F12F51932AC1300693BD5 /* AlbumFlagMark@2x.png */; };
396397
AB5493961931102E001F2FCC /* XHContactPhotosTableViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = AB5493941931102E001F2FCC /* XHContactPhotosTableViewCell.h */; settings = {ATTRIBUTES = (Public, ); }; };
397398
AB5493971931102E001F2FCC /* XHContactPhotosTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = AB5493951931102E001F2FCC /* XHContactPhotosTableViewCell.m */; };
398399
AB5493981931102E001F2FCC /* XHContactPhotosTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = AB5493951931102E001F2FCC /* XHContactPhotosTableViewCell.m */; };
@@ -825,6 +826,7 @@
825826
AB439972192C278400EC5E0D /* XHAlbumCollectionViewFlowLayout.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XHAlbumCollectionViewFlowLayout.m; sourceTree = "<group>"; };
826827
AB44D419192D8BB50069A210 /* XHContact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XHContact.h; sourceTree = "<group>"; };
827828
AB44D41A192D8BB50069A210 /* XHContact.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XHContact.m; sourceTree = "<group>"; };
829+
AB4F12F51932AC1300693BD5 /* AlbumFlagMark@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "AlbumFlagMark@2x.png"; sourceTree = "<group>"; };
828830
AB5493941931102E001F2FCC /* XHContactPhotosTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XHContactPhotosTableViewCell.h; sourceTree = "<group>"; };
829831
AB5493951931102E001F2FCC /* XHContactPhotosTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XHContactPhotosTableViewCell.m; sourceTree = "<group>"; };
830832
AB549399193110BD001F2FCC /* XHContactPhotosView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XHContactPhotosView.h; sourceTree = "<group>"; };
@@ -1497,6 +1499,7 @@
14971499
74C3E7E319291F1B0053F4E1 /* AlbumImages */ = {
14981500
isa = PBXGroup;
14991501
children = (
1502+
AB4F12F51932AC1300693BD5 /* AlbumFlagMark@2x.png */,
15001503
ABE87CD2192D6D7F00EC1E49 /* AlbumOperateMore@2x.png */,
15011504
ABE87CD3192D6D7F00EC1E49 /* AlbumOperateMoreHL@2x.png */,
15021505
AB79A216192C0B1500A9B951 /* circle@2x.png */,
@@ -2386,6 +2389,7 @@
23862389
746C88491916B607007F9A5E /* SenderVoiceNodePlaying001@2x.png in Resources */,
23872390
AB726395193296EE00AA738F /* album_add_photo@2x.png in Resources */,
23882391
74E5E9B11921F7710084BCFA /* RecordingBkg@2x.png in Resources */,
2392+
AB4F12F61932AC1300693BD5 /* AlbumFlagMark@2x.png in Resources */,
23892393
74E900641927940000D37C81 /* ff_IconShake@2x.png in Resources */,
23902394
746C885B1916B612007F9A5E /* sharemore_video@2x.png in Resources */,
23912395
AB8ACCE3192EB04400FA1C80 /* MoreSetting@2x.png in Resources */,
1.56 KB
Loading

MessageDisplayKit/Classes/Models/XHStoreManager.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,9 @@ - (NSMutableArray *)getLocationServiceArray {
206206

207207
for (int i = 0 ; i < 20; i ++) {
208208
if (i % 2) {
209-
[locationServices addObject:@"曾宪华"];
210-
} else {
211209
[locationServices addObject:@"杨仁捷"];
210+
} else {
211+
[locationServices addObject:@"吴盛潮"];
212212
}
213213
}
214214

MessageDisplayKit/Classes/Views/LocationServiceViews/XHLocationServiceTableViewCell.m

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,14 @@ @interface XHLocationServiceTableViewCell ()
2525
@implementation XHLocationServiceTableViewCell
2626

2727
- (void)configureCellWithItem:(id)item atIndexPath:(NSIndexPath *)indexPath {
28-
self.userNameLabel.text = item;
29-
self.distanseLabel.text = @"1000米以内";
28+
self.distanseLabel.text = @"10米以内";
29+
if (indexPath.row % 2) {
30+
self.userNameLabel.text = @"杨仁捷";
31+
self.introductionLabel.text = @"杨仁捷是UI/UE设计师,也是我的好拍档,有着编程功底,绝对是一个好设计师,UI设计可以帮程序员节省一大堆代码,这才是真正的设计师";
32+
} else {
33+
self.userNameLabel.text = @"吴盛潮";
34+
self.introductionLabel.text = @"吴盛潮是iOS开发者,也是我的好伙伴,iOS大神,找大神,找大神,一直会以技术支持的角色,所以你们不比害怕问题解决不了!";
35+
}
3036
}
3137

3238
#pragma mark - Propertys
@@ -41,23 +47,55 @@ - (UIImageView *)avatorImageView {
4147

4248
- (UILabel *)userNameLabel {
4349
if (!_userNameLabel) {
44-
_userNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.avatorImageView.frame) + kXHNearAvatorSpacing, kXHNearAvatorSpacing, 100, 30)];
50+
_userNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.avatorImageView.frame) + kXHNearAvatorSpacing, kXHNearAvatorSpacing, 55, 30)];
4551
_userNameLabel.backgroundColor = [UIColor clearColor];
4652
_userNameLabel.textColor = [UIColor blackColor];
4753
_userNameLabel.font = [UIFont boldSystemFontOfSize:17];
4854
}
4955
return _userNameLabel;
5056
}
57+
- (UIImageView *)userSexImageView {
58+
if (!_userSexImageView) {
59+
_userSexImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Contact_Male"]];
60+
CGRect userSexImageViewFrame = _userSexImageView.frame;
61+
userSexImageViewFrame.origin.x = CGRectGetMaxX(self.userNameLabel.frame);
62+
userSexImageViewFrame.origin.y = CGRectGetMidY(self.userNameLabel.frame) - CGRectGetHeight(userSexImageViewFrame) / 2.0;
63+
_userSexImageView.frame = userSexImageViewFrame;
64+
}
65+
return _userSexImageView;
66+
}
5167

5268
- (UILabel *)distanseLabel {
5369
if (!_distanseLabel) {
54-
_distanseLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMinX(self.userNameLabel.frame), CGRectGetMaxY(self.userNameLabel.frame), 100, 20)];
70+
_distanseLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMinX(self.userNameLabel.frame), CGRectGetMaxY(self.userNameLabel.frame), 50, 15)];
5571
_distanseLabel.font = [UIFont systemFontOfSize:12];
5672
_distanseLabel.backgroundColor = [UIColor clearColor];
5773
_distanseLabel.textColor = [UIColor grayColor];
5874
}
5975
return _distanseLabel;
6076
}
77+
- (UIImageView *)albumImageView {
78+
if (!_albumImageView) {
79+
_albumImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"AlbumFlagMark"]];
80+
CGRect albumImageViewFrame = _albumImageView.frame;
81+
albumImageViewFrame.origin.x = CGRectGetMaxX(self.distanseLabel.frame);
82+
albumImageViewFrame.origin.y = CGRectGetMinY(self.distanseLabel.frame);
83+
_albumImageView.frame = albumImageViewFrame;
84+
}
85+
return _albumImageView;
86+
}
87+
88+
- (UILabel *)introductionLabel {
89+
if (!_introductionLabel) {
90+
_introductionLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetWidth([[UIScreen mainScreen] bounds]) - kXHNearAvatorSpacing - 160, kXHNearAvatorSpacing, 160, kXHNearAvatorSize)];
91+
_introductionLabel.font = [UIFont systemFontOfSize:10];
92+
_introductionLabel.backgroundColor = [UIColor clearColor];
93+
_introductionLabel.textColor = [UIColor colorWithRed:0.097 green:0.633 blue:1.000 alpha:1.000];
94+
_introductionLabel.lineBreakMode = NSLineBreakByTruncatingTail;
95+
_introductionLabel.numberOfLines = 0;
96+
}
97+
return _introductionLabel;
98+
}
6199

62100
#pragma mark - Life Cycle
63101

@@ -67,7 +105,10 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
67105
// Initialization code
68106
[self.contentView addSubview:self.avatorImageView];
69107
[self.contentView addSubview:self.userNameLabel];
108+
[self.contentView addSubview:self.userSexImageView];
70109
[self.contentView addSubview:self.distanseLabel];
110+
[self.contentView addSubview:self.albumImageView];
111+
[self.contentView addSubview:self.introductionLabel];
71112
}
72113
return self;
73114
}

0 commit comments

Comments
 (0)