Skip to content

Commit dc3a015

Browse files
committed
调整冒泡界面 & 调整其他包含评论页面的cell分隔线的padding
1 parent 0163f87 commit dc3a015

File tree

10 files changed

+52
-42
lines changed

10 files changed

+52
-42
lines changed

Coding_iOS/Controllers/CommitFilesViewController.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
203203
FileChanges * curFileChanges = _curCommitInfo.commitDetail.diffStat;
204204
FileChangesIntroduceCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellIdentifier_FileChangesIntroduceCell forIndexPath:indexPath];
205205
[cell setFilesCount:curFileChanges.paths.count insertions:curFileChanges.insertions.integerValue deletions:curFileChanges.deletions.integerValue];
206+
[tableView addLineforPlainCell:cell forRowAtIndexPath:indexPath withLeftSpace:0];
206207
return cell;
207208
}
208209
}else if (indexPath.section > 0 && indexPath.section < _listGroupKeys.count+ 1){
@@ -236,7 +237,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
236237
}
237238
}];
238239

239-
[tableView addLineforPlainCell:cell forRowAtIndexPath:indexPath withLeftSpace:50];
240+
[tableView addLineforPlainCell:cell forRowAtIndexPath:indexPath withLeftSpace:kPaddingLeftWidth];
240241
return cell;
241242
}else{
242243
AddCommentCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellIdentifier_AddCommentCell forIndexPath:indexPath];

Coding_iOS/Controllers/MRPRDetailViewController.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
306306
cell.loadRequestBlock = ^(NSURLRequest *curRequest){
307307
[weakSelf loadRequest:curRequest];
308308
};
309+
[tableView addLineforPlainCell:cell forRowAtIndexPath:indexPath withLeftSpace:0];
309310
return cell;
310311
}
311312
}else if (indexPath.section == 1){//Disclosure
@@ -325,7 +326,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
325326
MRPRCommentCell *cell = [tableView dequeueReusableCellWithIdentifier:curCommentItem.htmlMedia.imageItems.count> 0? kCellIdentifier_MRPRCommentCell_Media: kCellIdentifier_MRPRCommentCell forIndexPath:indexPath];
326327
cell.curItem = curCommentItem;
327328
cell.contentLabel.delegate = self;
328-
[tableView addLineforPlainCell:cell forRowAtIndexPath:indexPath withLeftSpace:50];
329+
[tableView addLineforPlainCell:cell forRowAtIndexPath:indexPath withLeftSpace:kPaddingLeftWidth];
329330
return cell;
330331
}else{//Add Comment
331332
AddCommentCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellIdentifier_AddCommentCell forIndexPath:indexPath];

Coding_iOS/Controllers/TopicDetailViewController.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,15 +307,15 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
307307
}];
308308
[actionSheet showInView:self.view];
309309
};
310-
[tableView addLineforPlainCell:cell forRowAtIndexPath:indexPath withLeftSpace:0];
310+
[tableView addLineforPlainCell:cell forRowAtIndexPath:indexPath withLeftSpace:kPaddingLeftWidth];
311311
return cell;
312312
} else {
313313
ProjectTopic *toComment = [_curTopic.comments.list objectAtIndex:indexPath.row-1];
314314

315315
TopicCommentCell *cell = [tableView dequeueReusableCellWithIdentifier:toComment.htmlMedia.imageItems.count > 0? kCellIdentifier_TopicComment_Media: kCellIdentifier_TopicComment forIndexPath:indexPath];
316316
cell.toComment = toComment;
317317
cell.contentLabel.delegate = self;
318-
[tableView addLineforPlainCell:cell forRowAtIndexPath:indexPath withLeftSpace:50];
318+
[tableView addLineforPlainCell:cell forRowAtIndexPath:indexPath withLeftSpace:kPaddingLeftWidth];
319319
return cell;
320320
}
321321
}

Coding_iOS/Controllers/TweetDetailViewController.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
244244
cell.loadRequestBlock = ^(NSURLRequest *curRequest){
245245
[self loadRequest:curRequest];
246246
};
247-
[tableView addLineforPlainCell:cell forRowAtIndexPath:indexPath withLeftSpace:0];
247+
[tableView addLineforPlainCell:cell forRowAtIndexPath:indexPath withLeftSpace:kPaddingLeftWidth];
248248
return cell;
249249
}else{
250250
TweetDetailCommentCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellIdentifier_TweetDetailComment forIndexPath:indexPath];
@@ -257,7 +257,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
257257
[self goToUserInfo:curComment.owner];
258258
}];
259259
cell.contentLabel.delegate = self;
260-
[tableView addLineforPlainCell:cell forRowAtIndexPath:indexPath withLeftSpace:50];
260+
[tableView addLineforPlainCell:cell forRowAtIndexPath:indexPath withLeftSpace:kPaddingLeftWidth];
261261
return cell;
262262
}
263263
}
8 Bytes
Loading
-286 Bytes
Loading
66 Bytes
Loading
-510 Bytes
Loading

Coding_iOS/Views/Cell/TweetCell.m

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111

1212
#define kTweetCell_PadingBottom 10.0
1313
#define kTweetCell_ContentWidth (kScreen_Width -kTweetCell_PadingLeft - kPaddingLeftWidth)
14-
#define kTweetCell_LikeComment_Height 25.0
14+
#define kTweetCell_LikeComment_Height 27.0
1515
#define kTweetCell_LikeComment_Width 50.0
16-
#define kTweetCell_LikeUserCCell_Height 25.0
16+
#define kTweetCell_LikeUserCCell_Height 26.0
1717
#define kTweetCell_LikeUserCCell_Pading 10.0
1818
#define kTweet_ContentFont [UIFont systemFontOfSize:16]
1919
#define kTweet_ContentMaxHeight 200.0
@@ -72,7 +72,7 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
7272
}
7373

7474
if (!self.ownerImgView) {
75-
self.ownerImgView = [[UITapImageView alloc] initWithFrame:CGRectMake(kPaddingLeftWidth, 15 + CGRectGetMaxY(_topView.frame), 35, 35)];
75+
self.ownerImgView = [[UITapImageView alloc] initWithFrame:CGRectMake(kPaddingLeftWidth, 15 + CGRectGetMaxY(_topView.frame), 38, 38)];
7676
[self.ownerImgView doCircleFrame];
7777
[self.contentView addSubview:self.ownerImgView];
7878
}
@@ -82,15 +82,16 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
8282
[self.ownerNameBtn addTarget:self action:@selector(userBtnClicked) forControlEvents:UIControlEventTouchUpInside];
8383
[self.contentView addSubview:self.ownerNameBtn];
8484
}
85-
if (!self.timeClockIconView) {
86-
self.timeClockIconView = [[UIImageView alloc] initWithFrame:CGRectMake(kScreen_Width - kPaddingLeftWidth - 70, 25 + CGRectGetMaxY(_topView.frame), 12, 12)];
87-
self.timeClockIconView.image = [UIImage imageNamed:@"time_clock_icon"];
88-
[self.contentView addSubview:self.timeClockIconView];
89-
}
85+
// if (!self.timeClockIconView) {
86+
// self.timeClockIconView = [[UIImageView alloc] initWithFrame:CGRectMake(kScreen_Width - kPaddingLeftWidth - 70, 25 + CGRectGetMaxY(_topView.frame), 12, 12)];
87+
// self.timeClockIconView.image = [UIImage imageNamed:@"time_clock_icon"];
88+
// [self.contentView addSubview:self.timeClockIconView];
89+
// }
9090
if (!self.timeLabel) {
91-
self.timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(kScreen_Width - kPaddingLeftWidth - 55, 23 + CGRectGetMaxY(_topView.frame), 55, 12)];
91+
self.timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMinX(self.ownerNameBtn.frame), 0, kScreen_Width/2, 12)];
92+
// self.timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(kScreen_Width - kPaddingLeftWidth - 55, 23 + CGRectGetMaxY(_topView.frame), 55, 12)];
9293
self.timeLabel.font = kTweet_TimtFont;
93-
self.timeLabel.textAlignment = NSTextAlignmentRight;
94+
// self.timeLabel.textAlignment = NSTextAlignmentRight;
9495
self.timeLabel.textColor = [UIColor colorWithHexString:@"0x999999"];
9596
[self.contentView addSubview:self.timeLabel];
9697
}
@@ -237,20 +238,23 @@ - (void)layoutSubviews{
237238
//owner姓名
238239
[self.ownerNameBtn setUserTitle:_tweet.owner.name font:[UIFont systemFontOfSize:17] maxWidth:(kTweetCell_ContentWidth-85)];
239240
//发出冒泡的时间
240-
[self.timeLabel setLongString:[_tweet.created_at stringDisplay_HHmm] withVariableWidth:kScreen_Width/2];
241-
CGFloat timeLabelX = kScreen_Width - kPaddingLeftWidth - CGRectGetWidth(self.timeLabel.frame);
242-
[self.timeLabel setX:timeLabelX];
243-
[self.timeClockIconView setX:timeLabelX-15];
241+
self.timeLabel.text = [_tweet.created_at stringDisplay_HHmm];
242+
// [self.timeLabel setLongString:[_tweet.created_at stringDisplay_HHmm] withVariableWidth:kScreen_Width/2];
243+
// CGFloat timeLabelX = kScreen_Width - kPaddingLeftWidth - CGRectGetWidth(self.timeLabel.frame);
244+
// [self.timeLabel setX:timeLabelX];
245+
// [self.timeClockIconView setX:timeLabelX-15];
244246

245247
CGFloat centerY = 15 + 15 + CGRectGetHeight(_ownerImgView.frame)/2;
246248
CGFloat curBottomY = _needTopView? 0: -15;
247249
centerY += curBottomY;
248250

249251
[self.topView setY:curBottomY];
250252
[self.ownerImgView setCenterY:centerY];
251-
[self.ownerNameBtn setCenterY:centerY];
252-
[self.timeClockIconView setCenterY:centerY];
253-
[self.timeLabel setCenterY:centerY];
253+
// [self.ownerNameBtn setCenterY:centerY];
254+
// [self.timeClockIconView setCenterY:centerY];
255+
// [self.timeLabel setCenterY:centerY];
256+
[self.ownerNameBtn setY:CGRectGetMinY(self.ownerImgView.frame)];
257+
[self.timeLabel setY:CGRectGetMaxY(self.ownerImgView.frame) - CGRectGetHeight(self.timeLabel.frame)];
254258

255259
curBottomY += kTweetCell_PadingTop;
256260

@@ -296,6 +300,7 @@ - (void)layoutSubviews{
296300
self.fromLabel.hidden = self.fromPhoneIconView.hidden = _tweet.device.length <= 0;
297301

298302
//喜欢&评论 按钮
303+
curBottomY += 5;
299304
[self.likeBtn setImage:[UIImage imageNamed:(_tweet.liked.boolValue? @"tweet_btn_liked":@"tweet_btn_like")] forState:UIControlStateNormal];
300305
[self.likeBtn setY:curBottomY];
301306
[self.commentBtn setY:curBottomY];
@@ -357,7 +362,7 @@ + (CGFloat)cellHeightWithObj:(id)obj needTopView:(BOOL)needTopView{
357362
cellHeight += [self contentLabelHeightWithTweet:tweet];
358363
cellHeight += [self contentMediaHeightWithTweet:tweet];
359364
cellHeight += [self locationAndDeviceHeightWithTweet:tweet];
360-
cellHeight += kTweetCell_LikeComment_Height;
365+
cellHeight += 5+ kTweetCell_LikeComment_Height;
361366
cellHeight += [TweetCell likeCommentBtn_BottomPadingWithTweet:tweet];
362367
cellHeight += [TweetCell likeUsersHeightWithTweet:tweet];
363368
cellHeight += [TweetCell commentListViewHeightWithTweet:tweet];

Coding_iOS/Views/Cell/TweetDetailCell.m

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
// Copyright (c) 2014年 Coding. All rights reserved.
77
//
88

9-
#define kTweetDetailCell_PadingLeft 55.0
9+
#define kTweetDetailCell_PadingLeft 60.0
1010
#define kTweet_TimtFont [UIFont systemFontOfSize:12]
11-
#define kTweetDetailCell_LikeComment_Height 22.0
12-
#define kTweetDetailCell_LikeComment_Width 44.0
11+
#define kTweetDetailCell_LikeComment_Height 27.0
12+
#define kTweetDetailCell_LikeComment_Width 50.0
1313
#define kTweetDetailCell_ContentWidth (kScreen_Width - 2*kPaddingLeftWidth)
1414
#define kTweetDetailCell_PadingTop 55.0
1515
#define kTweetDetailCell_PadingBottom 10.0
@@ -51,25 +51,26 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
5151
self.backgroundColor = [UIColor clearColor];
5252
// self.backgroundColor = [UIColor colorWithHexString:@"0xf3f3f3"];
5353
if (!self.ownerImgView) {
54-
self.ownerImgView = [[UITapImageView alloc] initWithFrame:CGRectMake(kPaddingLeftWidth, 10, 35, 35)];
54+
self.ownerImgView = [[UITapImageView alloc] initWithFrame:CGRectMake(kPaddingLeftWidth, 10, 38, 38)];
5555
[self.ownerImgView doCircleFrame];
5656
[self.contentView addSubview:self.ownerImgView];
5757
}
5858
if (!self.ownerNameBtn) {
5959
self.ownerNameBtn = [UIButton buttonWithUserStyle];
60-
self.ownerNameBtn.frame = CGRectMake(kTweetDetailCell_PadingLeft, 18, kScreen_Width/2, 20);
60+
self.ownerNameBtn.frame = CGRectMake(kTweetDetailCell_PadingLeft, CGRectGetMinY(self.ownerImgView.frame), kScreen_Width/2, 20);
6161
[self.ownerNameBtn addTarget:self action:@selector(userBtnClicked) forControlEvents:UIControlEventTouchUpInside];
6262
[self.contentView addSubview:self.ownerNameBtn];
6363
}
64-
if (!self.timeClockIconView) {
65-
self.timeClockIconView = [[UIImageView alloc] initWithFrame:CGRectMake(kScreen_Width - kPaddingLeftWidth - 85, 20, 12, 12)];
66-
self.timeClockIconView.image = [UIImage imageNamed:@"time_clock_icon"];
67-
[self.contentView addSubview:self.timeClockIconView];
68-
}
64+
// if (!self.timeClockIconView) {
65+
// self.timeClockIconView = [[UIImageView alloc] initWithFrame:CGRectMake(kScreen_Width - kPaddingLeftWidth - 85, 20, 12, 12)];
66+
// self.timeClockIconView.image = [UIImage imageNamed:@"time_clock_icon"];
67+
// [self.contentView addSubview:self.timeClockIconView];
68+
// }
6969
if (!self.timeLabel) {
70-
self.timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(kScreen_Width - kPaddingLeftWidth - 70, 18, 70, 12)];
70+
self.timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMinX(self.ownerNameBtn.frame), CGRectGetMaxY(self.ownerImgView.frame) - 12, kScreen_Width/2, 12)];
71+
// self.timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(kScreen_Width - kPaddingLeftWidth - 70, 18, 70, 12)];
7172
self.timeLabel.font = kTweet_TimtFont;
72-
self.timeLabel.textAlignment = NSTextAlignmentRight;
73+
// self.timeLabel.textAlignment = NSTextAlignmentRight;
7374
self.timeLabel.textColor = [UIColor colorWithHexString:@"0x999999"];
7475
[self.contentView addSubview:self.timeLabel];
7576
}
@@ -132,7 +133,7 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
132133
[self.likeUsersView registerClass:[TweetLikeUserCCell class] forCellWithReuseIdentifier:kCCellIdentifier_TweetLikeUser];
133134
self.likeUsersView.dataSource = self;
134135
self.likeUsersView.delegate = self;
135-
[self.likeUsersView addLineUp:YES andDown:NO andColor:[UIColor colorWithHexString:@"0xdddddd"]];
136+
// [self.likeUsersView addLineUp:YES andDown:NO andColor:[UIColor colorWithHexString:@"0xdddddd"]];
136137
[self.contentView addSubview:self.likeUsersView];
137138
}
138139
if (!self.webContentView) {
@@ -185,10 +186,11 @@ - (void)setTweet:(Tweet *)tweet{
185186
[self.ownerNameBtn setUserTitle:_tweet.owner.name font:self.ownerNameBtn.titleLabel.font maxWidth:(kScreen_Width- kTweetDetailCell_PadingLeft - 85)];
186187

187188
//发出冒泡的时间
188-
[self.timeLabel setLongString:[_tweet.created_at stringDisplay_HHmm] withVariableWidth:kScreen_Width/2];
189-
CGFloat timeLabelX = kScreen_Width - kPaddingLeftWidth - CGRectGetWidth(self.timeLabel.frame);
190-
[self.timeLabel setX:timeLabelX];
191-
[self.timeClockIconView setX:timeLabelX-15];
189+
self.timeLabel.text = [_tweet.created_at stringDisplay_HHmm];
190+
// [self.timeLabel setLongString:[_tweet.created_at stringDisplay_HHmm] withVariableWidth:kScreen_Width/2];
191+
// CGFloat timeLabelX = kScreen_Width - kPaddingLeftWidth - CGRectGetWidth(self.timeLabel.frame);
192+
// [self.timeLabel setX:timeLabelX];
193+
// [self.timeClockIconView setX:timeLabelX-15];
192194

193195
//owner冒泡text内容
194196
[self.webContentView setHeight:_tweet.contentHeight];
@@ -221,6 +223,7 @@ - (void)setTweet:(Tweet *)tweet{
221223
self.fromLabel.hidden = self.fromPhoneIconView.hidden = _tweet.device.length <= 0;
222224

223225
//喜欢&评论 按钮
226+
curBottomY += 5;
224227
[self.likeBtn setImage:[UIImage imageNamed:(_tweet.liked.boolValue? @"tweet_btn_liked":@"tweet_btn_like")] forState:UIControlStateNormal];
225228
[self.likeBtn setY:curBottomY];
226229
[self.commentBtn setY:curBottomY];
@@ -262,7 +265,7 @@ + (CGFloat)cellHeightWithObj:(id)obj{
262265
cellHeight += kTweetDetailCell_PadingTop;
263266
cellHeight += [[self class] contentHeightWithTweet:tweet];
264267
cellHeight += 10;
265-
cellHeight += kTweetDetailCell_LikeComment_Height;
268+
cellHeight += 5 + kTweetDetailCell_LikeComment_Height;
266269
cellHeight += [[self class] locationAndDeviceHeightWithTweet:tweet];
267270
cellHeight += [[self class] likeCommentBtn_BottomPadingWithTweet:tweet];
268271
cellHeight += [[self class] likeUsersHeightWithTweet:tweet];

0 commit comments

Comments
 (0)