Skip to content

Commit b0baa6d

Browse files
committed
话题~
1 parent 2b7f0bc commit b0baa6d

5 files changed

Lines changed: 64 additions & 3 deletions

File tree

Coding_iOS.xcodeproj/project.pbxproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -966,6 +966,7 @@
966966
D0C448141C02F76600DC1C4B /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = D0C448121C02F76600DC1C4B /* [email protected] */; };
967967
D0C448151C02F76600DC1C4B /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = D0C448131C02F76600DC1C4B /* [email protected] */; };
968968
D0C448181C03187100DC1C4B /* TaskSearchCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D0C448171C03187100DC1C4B /* TaskSearchCell.m */; };
969+
D0C4481B1C034C3F00DC1C4B /* TopicSearchCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D0C4481A1C034C3F00DC1C4B /* TopicSearchCell.m */; };
969970
E7A046A01A47279E00528C12 /* Helper.m in Sources */ = {isa = PBXBuildFile; fileRef = E7A0469F1A47279E00528C12 /* Helper.m */; };
970971
/* End PBXBuildFile section */
971972

@@ -2429,6 +2430,8 @@
24292430
D0C448131C02F76600DC1C4B /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
24302431
D0C448161C03187100DC1C4B /* TaskSearchCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TaskSearchCell.h; sourceTree = "<group>"; };
24312432
D0C448171C03187100DC1C4B /* TaskSearchCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TaskSearchCell.m; sourceTree = "<group>"; };
2433+
D0C448191C034C3F00DC1C4B /* TopicSearchCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TopicSearchCell.h; sourceTree = "<group>"; };
2434+
D0C4481A1C034C3F00DC1C4B /* TopicSearchCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TopicSearchCell.m; sourceTree = "<group>"; };
24322435
E7A0469E1A47279E00528C12 /* Helper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Helper.h; sourceTree = "<group>"; };
24332436
E7A0469F1A47279E00528C12 /* Helper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Helper.m; sourceTree = "<group>"; };
24342437
/* End PBXFileReference section */
@@ -4863,6 +4866,8 @@
48634866
D0C447B81C02C63000DC1C4B /* UserSearchCell.m */,
48644867
D0C448161C03187100DC1C4B /* TaskSearchCell.h */,
48654868
D0C448171C03187100DC1C4B /* TaskSearchCell.m */,
4869+
D0C448191C034C3F00DC1C4B /* TopicSearchCell.h */,
4870+
D0C4481A1C034C3F00DC1C4B /* TopicSearchCell.m */,
48664871
);
48674872
path = Cell;
48684873
sourceTree = "<group>";
@@ -5608,6 +5613,7 @@
56085613
8EA6D14219E240C40076D59C /* TipsViewController.m in Sources */,
56095614
4E0BD88A1B6C7F5B0061CAA6 /* TopicHotkeyView.m in Sources */,
56105615
8EA6D1CA19E240C40076D59C /* UIPlaceHolderTextView.m in Sources */,
5616+
D0C4481B1C034C3F00DC1C4B /* TopicSearchCell.m in Sources */,
56115617
4E4D6A6D1B1C68D700FD2E49 /* ProjectCommitsViewController.m in Sources */,
56125618
4E6BA2E61A1EE6AF005FD721 /* UIProgressView+AFNetworking.m in Sources */,
56135619
4EB0C2001A807ED00042FC4F /* NSURL+Common.m in Sources */,

Coding_iOS/Controllers/AllSearchDisplayVC.m

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#import "TweetSearchCell.h"
3333
#import "UserSearchCell.h"
3434
#import "TaskSearchCell.h"
35-
35+
#import "ProjectTopicCell.h"
3636

3737
// nav--------
3838
#import "TweetDetailViewController.h"
@@ -157,6 +157,8 @@ - (void)initSearchResultsTableView {
157157
[tableView registerClass:[FileSearchCell class] forCellReuseIdentifier:@"FileSearchCell"];
158158
[tableView registerClass:[UserSearchCell class] forCellReuseIdentifier:@"UserSearchCell"];
159159
[tableView registerClass:[TaskSearchCell class] forCellReuseIdentifier:@"TaskSearchCell"];
160+
[tableView registerClass:[ProjectTopicCell class] forCellReuseIdentifier:@"ProjectTopicCell"];
161+
160162

161163
tableView.dataSource = self;
162164
tableView.delegate = self;
@@ -377,6 +379,9 @@ -(void)reloadDisplayData{
377379
case eSearchType_Task:
378380
[self.dateSource addObjectsFromArray:_searchPros.tasks.list];
379381
break;
382+
case eSearchType_Topic:
383+
[self.dateSource addObjectsFromArray:_searchPros.project_topics.list];
384+
break;
380385
default:
381386
break;
382387
}
@@ -404,6 +409,9 @@ - (void)refreshHeaderTitle{
404409
case eSearchType_Task:
405410
titleStr=[NSString stringWithFormat:@"共搜索到 %ld 个与\"%@\"相关的任务", [_searchPros.tasks.totalRow longValue],self.searchBar.text];
406411
break;
412+
case eSearchType_Topic:
413+
titleStr=[NSString stringWithFormat:@"共搜索到 %ld 个与\"%@\"相关的讨论", [_searchPros.project_topics.totalRow longValue],self.searchBar.text];
414+
break;
407415
default:
408416
break;
409417
}
@@ -471,6 +479,9 @@ - (void)requestDataWithPage:(NSInteger)page {
471479
case eSearchType_Task:
472480
[weakSelf.dateSource addObjectsFromArray:_searchPros.tasks.list];
473481
break;
482+
case eSearchType_Topic:
483+
[weakSelf.dateSource addObjectsFromArray:_searchPros.project_topics.list];
484+
break;
474485
default:
475486
break;
476487
}
@@ -558,6 +569,12 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
558569
cell.task=task;
559570
[tableView addLineforPlainCell:cell forRowAtIndexPath:indexPath withLeftSpace:kPaddingLeftWidth];
560571
return cell;
572+
}else if(_curSearchType==eSearchType_Topic){
573+
ProjectTopicCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ProjectTopicCell" forIndexPath:indexPath];
574+
ProjectTopic *topic =_dateSource[indexPath.row];
575+
cell.curTopic = topic;
576+
[tableView addLineforPlainCell:cell forRowAtIndexPath:indexPath withLeftSpace:kPaddingLeftWidth];
577+
return cell;
561578
}else{
562579
return nil;
563580
}
@@ -575,6 +592,8 @@ - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPa
575592
return kUserSearchCellHeight;
576593
}else if(_curSearchType==eSearchType_Task){
577594
return kTaskSearchCellHeight;
595+
}else if(_curSearchType==eSearchType_Topic){
596+
return [ProjectTopicCell cellHeightWithObj:_dateSource[indexPath.row]];
578597
}else{
579598
return 100;
580599
}

Coding_iOS/Controllers/ProjectSquareViewController.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ - (void)viewDidLoad {
2828
listView.useNewStyle=TRUE;
2929
[self.view addSubview:listView];
3030
[listView mas_makeConstraints:^(MASConstraintMaker *make) {
31-
make.edges.equalTo(self.view);
31+
make.left.bottom.right.equalTo(self.view);
32+
make.top.equalTo(self.view).offset(-44);
3233
}];
33-
3434
}
3535

3636
- (void)didReceiveMemoryWarning {
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//
2+
// TopicSearchCell.h
3+
// Coding_iOS
4+
//
5+
// Created by jwill on 15/11/23.
6+
// Copyright © 2015年 Coding. All rights reserved.
7+
//
8+
9+
#import <UIKit/UIKit.h>
10+
11+
@interface TopicSearchCell : UITableViewCell
12+
13+
@end
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//
2+
// TopicSearchCell.m
3+
// Coding_iOS
4+
//
5+
// Created by jwill on 15/11/23.
6+
// Copyright © 2015年 Coding. All rights reserved.
7+
//
8+
9+
#import "TopicSearchCell.h"
10+
11+
@implementation TopicSearchCell
12+
13+
- (void)awakeFromNib {
14+
// Initialization code
15+
}
16+
17+
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
18+
[super setSelected:selected animated:animated];
19+
20+
// Configure the view for the selected state
21+
}
22+
23+
@end

0 commit comments

Comments
 (0)