GeezerVison is showing github.com — bugfix · DoomYang/Coding-iOS@7bcef46
File treeExpand file treeCollapse file tree Open diff view settings Controllers/NProjectViewController
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: Coding_iOS/Controllers/NProjectViewController/NProjectViewController.m +5-4Lines changed: 5 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -91,7 +91,8 @@ - (void)refresh{ | 91 | 91 | CGFloat readMeHeight = weakSelf.myProject.readMeHeight; | 92 | 92 | weakSelf.myProject = data; | 93 | 93 | weakSelf.myProject.readMeHeight = readMeHeight; | 94 | | - | | 94 | + weakSelf.myProActs = [ProjectActivities proActivitiesWithPro:weakSelf.myProject type:ProjectActivityTypeAll]; | | 95 | + | 95 | 96 | weakSelf.myTableView.showsInfiniteScrolling = !weakSelf.myProject.is_public.boolValue; | 96 | 97 |
| 97 | 98 | if (weakSelf.myProject.is_public.boolValue) { | @@ -113,13 +114,13 @@ - (void)refreshReadMe{ | 113 | 114 | [weakSelf.view endLoading]; | 114 | 115 | if (data) { | 115 | 116 | weakSelf.myProject.readMeHtml = data; | 116 | | - [weakSelf.myTableView reloadData]; | 117 | 117 | } | | 118 | + [weakSelf.myTableView reloadData]; | 118 | 119 | }]; | 119 | 120 | } | 120 | 121 |
| 121 | 122 | - (void)refreshActivityMore:(BOOL)loadMore{ | 122 | | - if (_myProActs.isLoading) { | | 123 | + if (!_myProActs.user_id || _myProActs.isLoading) { | 123 | 124 | return; | 124 | 125 | } | 125 | 126 | _myProActs.willLoadMore = loadMore; | @@ -131,9 +132,9 @@ - (void)refreshActivityMore:(BOOL)loadMore{ | 131 | 132 | [weakSelf.myTableView.infiniteScrollingView stopAnimating]; | 132 | 133 | if (data) { | 133 | 134 | [weakSelf.myProActs configWithProActList:data]; | 134 | | - [weakSelf.myTableView reloadData]; | 135 | 135 | weakSelf.myTableView.showsInfiniteScrolling = weakSelf.myProActs.canLoadMore; | 136 | 136 | } | | 137 | + [weakSelf.myTableView reloadData]; | 137 | 138 | }]; | 138 | 139 | } | 139 | 140 |
| |
Collapse file Copy file name to clipboardExpand all lines: Coding_iOS/Util/Manager/Coding_NetAPIManager.m +21-6Lines changed: 21 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -1275,13 +1275,28 @@ - (void)request_ForkProject:(Project *)project andBlock:(void (^)(id data, NSErr | 1275 | 1275 | } | 1276 | 1276 | - (void)request_ReadMeOFProject:(Project *)project andBlock:(void (^)(id data, NSError *error))block{ | 1277 | 1277 | [MobClick event:kUmeng_Event_Request label:@"项目_README"]; | 1278 | | - NSString *path = [NSString stringWithFormat:@"api/user/%@/project/%@/git/tree/master",project.owner_user_name, project.name]; | 1279 | | - [[CodingNetAPIClient sharedJsonClient] requestJsonDataWithPath:path withParams:nil withMethodType:Get andBlock:^(id data, NSError *error) { | 1280 | | - if (data) { | 1281 | | - NSString *readMeHtml = [[[data valueForKey:@"data"] valueForKey:@"readme"] valueForKey:@"preview"]; | 1282 | | - block(readMeHtml? readMeHtml: @"我们推荐每个项目都新建一个README文件", nil); | | 1278 | + | | 1279 | + [[Coding_NetAPIManager sharedManager] request_CodeBranchOrTagWithPath:@"list_branches" withPro:project andBlock:^(id dataTemp, NSError *errorTemp) { | | 1280 | + if (dataTemp) { | | 1281 | + __block NSString *defultBranch = @"master"; | | 1282 | + NSArray *branchList = (NSArray *)dataTemp; | | 1283 | + [branchList enumerateObjectsUsingBlock:^(CodeBranchOrTag *obj, NSUInteger idx, BOOL *stop) { | | 1284 | + if (obj.is_default_branch.boolValue) { | | 1285 | + defultBranch = obj.name; | | 1286 | + } | | 1287 | + }]; | | 1288 | + | | 1289 | + NSString *path = [NSString stringWithFormat:@"api/user/%@/project/%@/git/tree/%@",project.owner_user_name, project.name, defultBranch]; | | 1290 | + [[CodingNetAPIClient sharedJsonClient] requestJsonDataWithPath:path withParams:nil withMethodType:Get andBlock:^(id data, NSError *error) { | | 1291 | + if (data) { | | 1292 | + NSString *readMeHtml = [[[data valueForKey:@"data"] valueForKey:@"readme"] valueForKey:@"preview"]; | | 1293 | + block(readMeHtml? readMeHtml: @"我们推荐每个项目都新建一个README文件", nil); | | 1294 | + }else{ | | 1295 | + block(nil, error); | | 1296 | + } | | 1297 | + }]; | 1283 | 1298 | }else{ | 1284 | | - block(nil, error); | | 1299 | + block(nil, errorTemp); | 1285 | 1300 | } | 1286 | 1301 | }]; | 1287 | 1302 | } | |
Collapse file Copy file name to clipboardExpand all lines: Coding_iOS/Views/CCell/TweetLikeUserCCell.m +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -34,6 +34,7 @@ - (void)configWithUser:(User *)user likesNum:(NSNumber *)likes{ | 34 | 34 | _likesLabel.hidden = YES; | 35 | 35 | } | 36 | 36 | }else{ | | 37 | + [self.imgView sd_setImageWithURL:nil]; | 37 | 38 | [self.imgView setImage:[UIImage imageWithColor:[UIColor colorWithHexString:@"0xdadada"]]]; | 38 | 39 | if (!_likesLabel) { | 39 | 40 | _likesLabel = [[UILabel alloc] initWithFrame:_imgView.frame]; | |
Collapse file Copy file name to clipboardExpand all lines: Coding_iOS/Views/Cell/TweetDetailCell.m +3-2Lines changed: 3 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 16 | 16 | #define kTweetDetailCell_PadingBottom 10.0 | 17 | 17 | #define kTweetDetailCell_LikeUserCCell_Height 25.0 | 18 | 18 | #define kTweetDetailCell_LikeUserCCell_Pading 10.0 | 19 | | -#define kTweetDetailCell_LikeNumMax 10 | | 19 | +#define kTweetDetailCell_LikeNumMax ((kDevice_Is_iPhone6 || kDevice_Is_iPhone6Plus)? 11: 9) | 20 | 20 |
| 21 | 21 |
| 22 | 22 |
| @@ -44,6 +44,7 @@ @implementation TweetDetailCell | 44 | 44 |
| 45 | 45 | - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier | 46 | 46 | { | | 47 | + | 47 | 48 | self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; | 48 | 49 | if (self) { | 49 | 50 | // Initialization code | @@ -383,7 +384,7 @@ - (void)locationBtnClicked:(id)sender{ | 383 | 384 | - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{ | 384 | 385 | NSInteger row = 0; | 385 | 386 | if (_tweet.like_users.count > 0) { | 386 | | - row = MIN(_tweet.like_users.count, kTweetDetailCell_LikeNumMax); | | 387 | + row = MIN(_tweet.like_users.count +1, kTweetDetailCell_LikeNumMax); | 387 | 388 | } | 388 | 389 | return row; | 389 | 390 | } | |
|