Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 67f4c2a

Browse filesBrowse files
committed
UI调整
1 parent a6dfa57 commit 67f4c2a
Copy full SHA for 67f4c2a

File tree

Expand file treeCollapse file tree

12 files changed

+58
-35
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

12 files changed

+58
-35
lines changed
Open diff view settings
Collapse file

‎Coding_iOS/Coding_iOS-Info.plist‎

Copy file name to clipboardExpand all lines: Coding_iOS/Coding_iOS-Info.plist
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5-
<key>NSLocationWhenInUseUsageDescription</key>
6-
<string>我们需要通过您的地理位置信息获取您周边的相关数据</string>
7-
<key>NSLocationAlwaysUsageDescription</key>
8-
<string>我们需要通过您的地理位置信息获取您周边的相关数据</string>
95
<key>CFBundleDevelopmentRegion</key>
106
<string>en</string>
117
<key>CFBundleDisplayName</key>
@@ -36,9 +32,13 @@
3632
</dict>
3733
</array>
3834
<key>CFBundleVersion</key>
39-
<string>2.4.2015031721</string>
35+
<string>2.4.2015032019</string>
4036
<key>LSRequiresIPhoneOS</key>
4137
<true/>
38+
<key>NSLocationAlwaysUsageDescription</key>
39+
<string>我们需要通过您的地理位置信息获取您周边的相关数据</string>
40+
<key>NSLocationWhenInUseUsageDescription</key>
41+
<string>我们需要通过您的地理位置信息获取您周边的相关数据</string>
4242
<key>UIAppFonts</key>
4343
<array>
4444
<string>FontAwesome.ttf</string>
Collapse file

‎Coding_iOS/Controllers/NProjectViewController/NProjectViewController.m‎

Copy file name to clipboardExpand all lines: Coding_iOS/Controllers/NProjectViewController/NProjectViewController.m
+10-4Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ - (void)refresh{
8383
return;
8484
}
8585
__weak typeof(self) weakSelf = self;
86+
if (!_myProject.is_public) {
87+
[self.view beginLoading];
88+
}
8689
[[Coding_NetAPIManager sharedManager] request_ProjectDetail_WithObj:_myProject andBlock:^(id data, NSError *error) {
8790
if (data) {
8891
CGFloat readMeHeight = weakSelf.myProject.readMeHeight;
@@ -98,6 +101,7 @@ - (void)refresh{
98101
}
99102
}else{
100103
[weakSelf.refreshControl endRefreshing];
104+
[weakSelf.view endLoading];
101105
}
102106
}];
103107
}
@@ -106,9 +110,10 @@ - (void)refreshReadMe{
106110
__weak typeof(self) weakSelf = self;
107111
[[Coding_NetAPIManager sharedManager] request_ReadMeOFProject:_myProject andBlock:^(id data, NSError *error) {
108112
[weakSelf.refreshControl endRefreshing];
113+
[weakSelf.view endLoading];
109114
if (data) {
110115
weakSelf.myProject.readMeHtml = data;
111-
[weakSelf.myTableView reloadSections:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, [self numberOfSectionsInTableView:weakSelf.myTableView])] withRowAnimation:UITableViewRowAnimationNone];
116+
[weakSelf.myTableView reloadData];
112117
}
113118
}];
114119
}
@@ -122,6 +127,7 @@ - (void)refreshActivityMore:(BOOL)loadMore{
122127
__weak typeof(self) weakSelf = self;
123128
[[Coding_NetAPIManager sharedManager] request_ProjectActivityList_WithObj:_myProActs andBlock:^(NSArray *data, NSError *error) {
124129
[weakSelf.refreshControl endRefreshing];
130+
[weakSelf.view endLoading];
125131
[weakSelf.myTableView.infiniteScrollingView stopAnimating];
126132
if (data) {
127133
[weakSelf.myProActs configWithProActList:data];
@@ -357,7 +363,7 @@ - (void)gitButtonClicked:(NSInteger)index{
357363
{
358364
if (!_myProject.isStaring) {
359365
[[Coding_NetAPIManager sharedManager] request_StarProject:_myProject andBlock:^(id data, NSError *error) {
360-
[weakSelf.myTableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationNone];
366+
[weakSelf.myTableView reloadData];
361367
}];
362368
}
363369
}
@@ -366,7 +372,7 @@ - (void)gitButtonClicked:(NSInteger)index{
366372
{
367373
if (!_myProject.isWatching) {
368374
[[Coding_NetAPIManager sharedManager] request_WatchProject:_myProject andBlock:^(id data, NSError *error) {
369-
[weakSelf.myTableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationNone];
375+
[weakSelf.myTableView reloadData];
370376
}];
371377
}
372378
}
@@ -376,7 +382,7 @@ - (void)gitButtonClicked:(NSInteger)index{
376382
[[UIActionSheet bk_actionSheetCustomWithTitle:@"fork将会将此项目复制到您的个人空间,确定要fork吗?" buttonTitles:@[@"确定"] destructiveTitle:nil cancelTitle:@"取消" andDidDismissBlock:^(UIActionSheet *sheet, NSInteger index) {
377383
if (index == 0) {
378384
[[Coding_NetAPIManager sharedManager] request_ForkProject:_myProject andBlock:^(id data, NSError *error) {
379-
[weakSelf.myTableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationNone];
385+
[weakSelf.myTableView reloadData];
380386
if (data) {
381387
NProjectViewController *vc = [[NProjectViewController alloc] init];
382388
vc.myProject = data;
Collapse file

‎Coding_iOS/Controllers/RootControllers/BaseViewController.m‎

Copy file name to clipboardExpand all lines: Coding_iOS/Controllers/RootControllers/BaseViewController.m
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#import "TopicDetailViewController.h"
1717
#import "EditTaskViewController.h"
1818
#import "ProjectViewController.h"
19+
#import "NProjectViewController.h"
1920
#import "Coding_NetAPIManager.h"
2021
#import "AppDelegate.h"
2122
#import "WebViewController.h"
@@ -160,9 +161,11 @@ + (UIViewController *)analyseVCFromLinkStr:(NSString *)linkStr{
160161
Project *curPro = [[Project alloc] init];
161162
curPro.owner_user_name = user_global_key;
162163
curPro.name = project_name;
163-
ProjectViewController *vc = [[ProjectViewController alloc] init];
164+
// ProjectViewController *vc = [[ProjectViewController alloc] init];
165+
NProjectViewController *vc = [[NProjectViewController alloc] init];
166+
164167
vc.myProject = curPro;
165-
vc.curIndex = 0;
168+
// vc.curIndex = 0;
166169
analyseVC = vc;
167170
}else if ((matchedCaptures = [linkStr captureComponentsMatchedByRegex:conversionRegexStr]).count > 0) {
168171
//私信
Collapse file

‎Coding_iOS/Controllers/TopicDetailViewController.m‎

Copy file name to clipboardExpand all lines: Coding_iOS/Controllers/TopicDetailViewController.m
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ - (void)viewDidLoad
5151
{
5252
[super viewDidLoad];
5353
// Do any additional setup after loading the view.
54-
self.title = @"讨论详情";
55-
5654
_myTableView = ({
5755
UITableView *tableView = [[UITableView alloc] initWithFrame:self.view.bounds];
5856
tableView.backgroundColor = [UIColor clearColor];
@@ -91,6 +89,11 @@ - (void)viewDidLoad
9189
[self refreshTopic];
9290
}
9391

92+
- (void)setCurTopic:(ProjectTopic *)curTopic{
93+
_curTopic = curTopic;
94+
self.title = curTopic.project.name? curTopic.project.name: @"讨论详情";
95+
}
96+
9497
- (void)viewWillDisappear:(BOOL)animated{
9598
[super viewWillDisappear:animated];
9699
if (_myMsgInputView) {
Collapse file

‎Coding_iOS/Models/Tweet.m‎

Copy file name to clipboardExpand all lines: Coding_iOS/Models/Tweet.m
+13-2Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,21 @@ - (BOOL)hasMoreComments{
7777
- (NSInteger)numOfLikers{
7878
return MIN(_like_users.count +1,
7979
MIN(_likes.intValue,
80-
8));
80+
[self maxLikerNum]));
8181
}
82+
83+
- (NSInteger)maxLikerNum{
84+
NSInteger maxNum = 8;
85+
if (kDevice_Is_iPhone6) {
86+
maxNum = 10;
87+
}else if (kDevice_Is_iPhone6Plus){
88+
maxNum = 11;
89+
}
90+
return maxNum;
91+
}
92+
8293
- (BOOL)hasMoreLikers{
83-
return (_likes.intValue > _like_users.count || _likes.intValue > 7);
94+
return (_likes.intValue > _like_users.count || _likes.intValue > [self maxLikerNum] - 1);
8495
}
8596

8697
- (NSString *)toDoLikePath{
Collapse file

‎Coding_iOS/Views/CCell/TweetMediaItemSingleCCell.m‎

Copy file name to clipboardExpand all lines: Coding_iOS/Views/CCell/TweetMediaItemSingleCCell.m
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
// Copyright (c) 2014年 Coding. All rights reserved.
77
//
88

9-
#define kTweetMediaItemCCellSingle_Width (0.6 *kScreen_Width)
9+
#define kTweetMediaItemCCellSingle_Width (0.4 *kScreen_Width)
1010
#define kTweetMediaItemCCellSingle_WidthMonkey ((kScreen_Width - 80.0)/3.0)
11-
#define kTweetMediaItemCCellSingle_MaxHeight (0.6 *kScreen_Height)
11+
#define kTweetMediaItemCCellSingle_MaxHeight (0.4 *kScreen_Height)
1212

1313
#import "TweetMediaItemSingleCCell.h"
1414
#import "UIImageView+WebCache.h"
Collapse file

‎Coding_iOS/Views/Cell/ProjectItemsCell.m‎

Copy file name to clipboardExpand all lines: Coding_iOS/Views/Cell/ProjectItemsCell.m
+1-4Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,7 @@ + (CGFloat)cellHeightWithObj:(id)obj{
8686
- (UIButton *)itemWithFrame:(CGRect)frame icon:(NSString *)iconStr color:(NSString *)colorStr title:(NSString *)titleStr index:(NSInteger)index{
8787
UIButton *item = [[UIButton alloc] initWithFrame:frame];
8888

89-
CGFloat iconWidth = kScaleFrom_iPhone5_Desgin(50);
90-
if (kDevice_Is_iPhone6Plus || kDevice_Is_iPhone6) {
91-
iconWidth -= 5;
92-
}
89+
CGFloat iconWidth = kScaleFrom_iPhone5_Desgin(46);
9390

9491
UIImage *itemImg = [UIImage imageWithIcon:iconStr backgroundColor:[UIColor clearColor] iconColor:[UIColor whiteColor] iconScale:1.0 andSize:CGSizeMake(iconWidth/2.8, iconWidth/2.8)];
9592
UIImageView *itemImgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, iconWidth, iconWidth)];
Collapse file

‎Coding_iOS/Views/Cell/TaskContentCell.m‎

Copy file name to clipboardExpand all lines: Coding_iOS/Views/Cell/TaskContentCell.m
+2-5Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#define kTaskContentCell_PadingRight 20.0
1010
#define kTaskContentCell_ContentHeightMin 100.0
1111
#define kTextView_Pading 8.0
12-
#define kTaskContentCell_ContentWidth (kScreen_Width-kTaskContentCell_PadingLeft-kTaskContentCell_PadingRight)
12+
#define kTaskContentCell_ContentWidth (kScreen_Width-kTaskContentCell_PadingLeft-kTaskContentCell_PadingRight + 2*kTextView_Pading)
1313
#define kTaskContentCell_ContentFont [UIFont systemFontOfSize:18]
1414

1515

@@ -45,9 +45,6 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
4545
if (!_deleteBtn) {
4646
_deleteBtn = ({
4747
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
48-
// button.layer.cornerRadius = 5.0;
49-
// button.layer.borderWidth = 1.0;
50-
// button.layer.borderColor = [UIColor colorWithHexString:@"0xdadada"].CGColor;
5148
button.titleLabel.font = [UIFont systemFontOfSize:13];
5249
[button setTitleColor:[UIColor colorWithHexString:@"0x666666"] forState:UIControlStateNormal];
5350
[button setTitle:@"删除" forState:UIControlStateNormal];
@@ -57,7 +54,7 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
5754
});
5855
}
5956
[_taskContentView mas_makeConstraints:^(MASConstraintMaker *make) {
60-
make.edges.equalTo(self.contentView).insets(UIEdgeInsetsMake(0, kTaskContentCell_PadingLeft-kTextView_Pading, 40, kTaskContentCell_PadingLeft-kTextView_Pading));
57+
make.edges.equalTo(self.contentView).insets(UIEdgeInsetsMake(5, kTaskContentCell_PadingLeft-kTextView_Pading, 40, kTaskContentCell_PadingLeft-kTextView_Pading));
6158
}];
6259
[_creatorLabel mas_makeConstraints:^(MASConstraintMaker *make) {
6360
make.left.equalTo(self.contentView.mas_left).offset(kTaskContentCell_PadingLeft);
Collapse file

‎Coding_iOS/Views/Cell/TweetCell.m‎

Copy file name to clipboardExpand all lines: Coding_iOS/Views/Cell/TweetCell.m
+4-3Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
7474
}
7575
if (!self.ownerNameBtn) {
7676
self.ownerNameBtn = [UIButton buttonWithUserStyle];
77-
self.ownerNameBtn.frame = CGRectMake(kTweetCell_PadingLeft, 15, 50, 20);
77+
self.ownerNameBtn.frame = CGRectMake(kTweetCell_PadingLeft, 17, 50, 20);
7878
[self.ownerNameBtn addTarget:self action:@selector(userBtnClicked) forControlEvents:UIControlEventTouchUpInside];
7979
[self.contentView addSubview:self.ownerNameBtn];
8080
}
@@ -238,7 +238,7 @@ - (void)layoutSubviews{
238238
[self.contentLabel addLinkToTransitInformation:[NSDictionary dictionaryWithObject:item forKey:@"value"] withRange:item.range];
239239
}
240240
}
241-
CGFloat curBottomY = kTweetCell_PadingTop +[TweetCell contentLabelHeightWithTweet:_tweet] +5;
241+
CGFloat curBottomY = kTweetCell_PadingTop +[TweetCell contentLabelHeightWithTweet:_tweet] +10;
242242
//图片缩略图展示
243243
if (_tweet.htmlMedia.imageItems.count > 0) {
244244

@@ -304,6 +304,7 @@ - (void)layoutSubviews{
304304
curBottomY += [TweetCell likeCommentBtn_BottomPadingWithTweet:_tweet];
305305

306306

307+
curBottomY += 5;
307308
if (_tweet.numOfLikers > 0 || _tweet.numOfComments > 0) {
308309
[_commentOrLikeBeginImgView setY:(curBottomY - CGRectGetHeight(_commentOrLikeBeginImgView.frame))];
309310
_commentOrLikeBeginImgView.hidden = NO;
@@ -354,7 +355,7 @@ + (CGFloat)cellHeightWithObj:(id)obj{
354355
}else{
355356
cellHeight = 3;
356357
}
357-
cellHeight += 10;
358+
cellHeight += 20;
358359
cellHeight += kTweetCell_PadingTop;
359360
cellHeight += [TweetCell contentLabelHeightWithTweet:tweet];
360361
cellHeight += [TweetCell contentMediaHeightWithTweet:tweet];
Collapse file

‎Coding_iOS/Views/Cell/TweetCommentCell.m‎

Copy file name to clipboardExpand all lines: Coding_iOS/Views/Cell/TweetCommentCell.m
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
3232
self.backgroundColor = [UIColor clearColor];
3333
self.backgroundView = nil;
3434
if (!_commentLabel) {
35-
_commentLabel = [[UITTTAttributedLabel alloc] initWithFrame:CGRectMake(kTweetCommentCell_LeftOrRightPading, 5, kTweetCommentCell_ContentWidth, 20)];
35+
_commentLabel = [[UITTTAttributedLabel alloc] initWithFrame:CGRectMake(kTweetCommentCell_LeftOrRightPading, kScaleFrom_iPhone5_Desgin(6), kTweetCommentCell_ContentWidth, 20)];
3636
_commentLabel.numberOfLines = 0;
3737
_commentLabel.backgroundColor = [UIColor clearColor];
3838
_commentLabel.font = kTweet_CommentFont;
@@ -84,7 +84,7 @@ - (void)configWithComment:(Comment *)curComment topLine:(BOOL)has{
8484
[_commentLabel addLinkToTransitInformation:[NSDictionary dictionaryWithObject:item forKey:@"value"] withRange:item.range];
8585
}
8686
}
87-
CGFloat curBottomY = CGRectGetHeight(_commentLabel.frame) +12;
87+
CGFloat curBottomY = CGRectGetMaxY(_commentLabel.frame) +kScaleFrom_iPhone5_Desgin(5);
8888

8989
_userNameLabel.text = curUser.name;
9090
_timeLabel.text = [_curComment.created_at stringTimesAgo];
@@ -106,7 +106,7 @@ + (CGFloat)cellHeightWithObj:(id)obj{
106106
CGFloat cellHeight = 0;
107107
if ([obj isKindOfClass:[Comment class]]) {
108108
Comment *curComment = (Comment *)obj;
109-
cellHeight = [curComment.content getHeightWithFont:kTweet_CommentFont constrainedToSize:CGSizeMake(kTweetCommentCell_ContentWidth, CGFLOAT_MAX)] +30;
109+
cellHeight = [curComment.content getHeightWithFont:kTweet_CommentFont constrainedToSize:CGSizeMake(kTweetCommentCell_ContentWidth, CGFLOAT_MAX)] +15 + kScaleFrom_iPhone5_Desgin(15);
110110
}
111111
return cellHeight;
112112
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.