FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

评论 api 地址有变 & UI 界面调整 · smqh-github/Coding-iOS@0a7c09d · GitHub

Commit 0a7c09d

Browse files
committed
评论 api 地址有变 & UI 界面调整
1 parent 548f8e3 commit 0a7c09d

4 files changed

Lines changed: 9 additions & 9 deletions

File tree

‎Coding_iOS/Controllers/TopicAnswerDetailViewController.m‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
171171
cell.isAnswer = indexPath.row == 0;
172172
cell.projectId = _curTopic.project.id;
173173
cell.contentLabel.delegate = self;
174-
[tableView addLineforPlainCell:cell forRowAtIndexPath:indexPath withLeftSpace:kPaddingLeftWidth + (indexPath.row == 0? 0: 40) hasSectionLine:YES];
174+
[tableView addLineforPlainCell:cell forRowAtIndexPath:indexPath withLeftSpace:kPaddingLeftWidth + (indexPath.row == 0? 40: 40) hasSectionLine:YES];
175175
return cell;
176176
}
177177

‎Coding_iOS/Models/ProjectTopic.m‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ - (void)configWithComments:(ProjectTopics *)comments
161161

162162
- (NSString *)toDoCommentPath
163163
{
164-
return [NSString stringWithFormat:@"api/project/%d/topic?parent=%d", _project_id.intValue, _id.intValue];
164+
return [NSString stringWithFormat:@"api/project/%@/topic/%@/comment", _project_id, _id];
165165
}
166166

167167
- (void)configWithComment:(ProjectTopic *)comment andAnswer:(ProjectTopic *)answer

‎Coding_iOS/Views/Cell/TopicAnswerCell.m‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
8484
CGFloat leftSpace;
8585
if (indexPath.row == 0) {
8686
toComment = _curAnswer;
87-
leftSpace = [_curAnswer commentsDisplayNum] > 0? kPaddingLeftWidth: kScreen_Width;
87+
leftSpace = [_curAnswer commentsDisplayNum] > 0? kPaddingLeftWidth + 40: kScreen_Width;
8888
}else{
8989
toComment = _curAnswer.child_comments[indexPath.row - 1];
9090
leftSpace = (indexPath.row - 1 == [_curAnswer commentsDisplayNum] - 1)? kScreen_Width: kPaddingLeftWidth + 40;

‎Coding_iOS/Views/Cell/TopicCommentCell.m‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
5353
}];
5454
[self.contentView addSubview:_bestAnswerV];
5555
}
56-
CGFloat curBottomY = 10;
56+
CGFloat curBottomY = 15;
5757
if (!_ownerIconView) {
5858
_ownerIconView = [[UIImageView alloc] initWithFrame:CGRectMake(kPaddingLeftWidth, curBottomY, 33, 33)];
5959
[_ownerIconView doCircleFrame];
@@ -121,7 +121,7 @@ - (void)setToComment:(ProjectTopic *)toComment{
121121
if (!_toComment) {
122122
return;
123123
}
124-
CGFloat curBottomY = 10;
124+
CGFloat curBottomY = 15;
125125
CGFloat curWidth = kScreen_Width - 40 - 2*kPaddingLeftWidth;
126126

127127
_bestAnswerV.hidden = !_toComment.is_recommended.boolValue;
@@ -130,7 +130,7 @@ - (void)setToComment:(ProjectTopic *)toComment{
130130
}
131131

132132
_ownerIconView.y = _contentLabel.y = curBottomY;
133-
_voteBtn.y = _ownerIconView.bottom + 2;
133+
_voteBtn.y = _ownerIconView.bottom + 5;
134134
[self setVoteCount:_toComment.up_vote_counts isVoted:_toComment.is_up_voted.boolValue];
135135
[_ownerIconView sd_setImageWithURL:[_toComment.owner.avatar urlImageWithCodePathResizeToView:_ownerIconView] placeholderImage:kPlaceholderMonkeyRoundView(_ownerIconView)];
136136
[_contentLabel setLongString:_toComment.content withFitWidth:curWidth];
@@ -140,7 +140,7 @@ - (void)setToComment:(ProjectTopic *)toComment{
140140
}
141141
}
142142

143-
curBottomY += [_toComment.content getHeightWithFont:kTopicCommentCell_FontContent constrainedToSize:CGSizeMake(curWidth, CGFLOAT_MAX)] + 5;
143+
curBottomY += [_toComment.content getHeightWithFont:kTopicCommentCell_FontContent constrainedToSize:CGSizeMake(curWidth, CGFLOAT_MAX)] + 10;
144144

145145
NSInteger imagesCount = _toComment.htmlMedia.imageItems.count;
146146
if (imagesCount > 0) {
@@ -168,9 +168,9 @@ + (CGFloat)cellHeightWithObj:(id)obj{
168168
if ([obj isKindOfClass:[ProjectTopic class]]) {
169169
ProjectTopic *toComment = (ProjectTopic *)obj;
170170
CGFloat curWidth = kScreen_Width - 40 - 2*kPaddingLeftWidth;
171-
cellHeight += 10 +[toComment.content getHeightWithFont:kTopicCommentCell_FontContent constrainedToSize:CGSizeMake(curWidth, CGFLOAT_MAX)] + 5 +20 +10;
171+
cellHeight += 15 +[toComment.content getHeightWithFont:kTopicCommentCell_FontContent constrainedToSize:CGSizeMake(curWidth, CGFLOAT_MAX)] + 10 +20 +15;
172172
cellHeight += [self imageCollectionViewHeightWithCount:toComment.htmlMedia.imageItems.count];
173-
cellHeight += toComment.is_recommended.boolValue? 25: 0;
173+
cellHeight += toComment.is_recommended.boolValue? 20: 0;
174174
}
175175
return cellHeight;
176176
}

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL