Skip to content

Commit b64c978

Browse files
committed
换换图,修下 bug
1 parent 71d50c4 commit b64c978

39 files changed

+82
-68
lines changed

Coding_iOS.xcodeproj/project.pbxproj

Lines changed: 44 additions & 28 deletions
Large diffs are not rendered by default.

Coding_iOS/.DS_Store

0 Bytes
Binary file not shown.

Coding_iOS/Coding_iOS-Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
</dict>
3838
</array>
3939
<key>CFBundleVersion</key>
40-
<string>5.0.201802061600</string>
40+
<string>5.0.201802091630</string>
4141
<key>ITSAppUsesNonExemptEncryption</key>
4242
<false/>
4343
<key>LSApplicationQueriesSchemes</key>

Coding_iOS/Controllers/EditTopicViewController.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,8 @@ - (void)loadPreview
282282
- (void)addtitleBtnClick
283283
{
284284
EditLabelViewController *vc = [[EditLabelViewController alloc] init];
285-
vc.curProject = _curProTopic.project;
285+
// vc.curProject = _curProTopic.project;
286+
vc.curProject = _curProTopic.project ?: ({Project *p = [Project new]; p.id = _curProTopic.project_id; p;});
286287
vc.orignalTags = _curProTopic.mdLabels;
287288
@weakify(self);
288289
vc.tagsSelectedBlock = ^(EditLabelViewController *vc, NSMutableArray *selectedTags){

Coding_iOS/Controllers/FileActivitiesViewController.m

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -68,26 +68,6 @@ - (void)viewDidLoad
6868
_myRefreshControl = [[ODRefreshControl alloc] initInScrollView:self.myTableView];
6969
[_myRefreshControl addTarget:self action:@selector(refresh) forControlEvents:UIControlEventValueChanged];
7070

71-
// _myToolBar = ({
72-
// EaseToolBarItem *item = [EaseToolBarItem easeToolBarItemWithTitle:@" 发表评论..." image:@"button_file_comment" disableImage:nil];
73-
//
74-
// NSDictionary *attributes = @{NSFontAttributeName : [UIFont systemFontOfSize:15],
75-
// NSForegroundColorAttributeName : [UIColor colorWithHexString:@"0xB5B5B5"]};
76-
// [item setAttributes:attributes forUIControlState:UIControlStateNormal];
77-
//
78-
// EaseToolBar *toolBar = [EaseToolBar easeToolBarWithItems:@[item]];
79-
// toolBar.delegate = self;
80-
// [self.view addSubview:toolBar];
81-
// [toolBar mas_makeConstraints:^(MASConstraintMaker *make) {
82-
// make.bottom.equalTo(self.view.mas_bottom);
83-
// make.size.mas_equalTo(toolBar.frame.size);
84-
// }];
85-
// toolBar;
86-
// });
87-
// UIEdgeInsets contentInsets = UIEdgeInsetsMake(0.0, 0.0,CGRectGetHeight(self.myToolBar.frame), 0.0);
88-
// self.myTableView.contentInset = contentInsets;
89-
// self.myTableView.scrollIndicatorInsets = contentInsets;
90-
9171
[self refresh];
9272
}
9373

Coding_iOS/Controllers/TopicDetailViewController.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ - (void)viewDidAppear:(BOOL)animated
126126
- (void)addtitleBtnClick
127127
{
128128
EditLabelViewController *vc = [[EditLabelViewController alloc] init];
129-
vc.curProject = self.curTopic.project;
129+
// vc.curProject = self.curTopic.project;
130+
vc.curProject = self.curTopic.project ?: ({Project *p = [Project new]; p.id = self.curTopic.project_id; p;});
130131
vc.orignalTags = self.curTopic.mdLabels;
131132
@weakify(self);
132133
vc.tagsSelectedBlock = ^(EditLabelViewController *vc, NSMutableArray *selectedTags){
Loading
Loading
Loading
Binary file not shown.
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-442 Bytes
Loading
-4 Bytes
Loading
-17 Bytes
Loading

Coding_iOS/Views/Cell/FileListFileCell.m

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
7878
[self.contentView addSubview:self.progressView];
7979
}
8080
if (!_stateButton) {
81-
_stateButton = [[UIButton alloc] initWithFrame:CGRectMake((kScreen_Width - 55), ([FileListFileCell cellHeight] - 25)/2, 45, 25)];
81+
_stateButton = [[UIButton alloc] initWithFrame:CGRectMake((kScreen_Width - 60), ([FileListFileCell cellHeight] - 30)/2, 50, 30)];
82+
[_stateButton doBorderWidth:1.0 color:kColorD8DDE4 cornerRadius:3];
83+
_stateButton.titleLabel.font = [UIFont systemFontOfSize:14];
84+
[_stateButton setTitleColor:kColorDark7 forState:UIControlStateNormal];
8285
[_stateButton addTarget:self action:@selector(clickedByUser) forControlEvents:UIControlEventTouchUpInside];
8386
[self.contentView addSubview:_stateButton];
8487
}
@@ -87,28 +90,33 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
8790
}
8891

8992
- (void)changeToState:(DownloadState)state{
90-
NSString *stateImageName;
93+
NSString *stateTitleStr;
9194
switch (state) {
9295
case DownloadStateDefault:
93-
stateImageName = @"icon_file_state_download";
96+
stateTitleStr = @"下载";
9497
break;
9598
case DownloadStateDownloading:
96-
stateImageName = @"icon_file_state_pause";
99+
stateTitleStr = @"暂停";
97100
break;
98101
case DownloadStatePausing:
99-
stateImageName = @"icon_file_state_goon";
102+
stateTitleStr = @"继续";
100103
break;
101104
case DownloadStateDownloaded:
102-
stateImageName = @"icon_file_state_look";
105+
stateTitleStr = @"查看";
103106
break;
104107
default:
105-
stateImageName = @"icon_file_state_download";
108+
stateTitleStr = @"下载";
106109
break;
107110
}
108-
[self.contentView setBackgroundColor:(state == DownloadStateDownloaded)? [UIColor colorWithHexString:@"0x81BCFF" andAlpha:.1]:[UIColor whiteColor]];
111+
[self setBackgroundColor:(state == DownloadStateDownloaded)? [UIColor colorWithHexString:@"0x81BCFF" andAlpha:.1]:[UIColor whiteColor]];
112+
//addLineforPlainCell: 重置了 backgroundView,要改 layer 才行
113+
CALayer *bgLayer = self.backgroundView.layer.sublayers.firstObject;
114+
if (bgLayer && [bgLayer isKindOfClass:[CAShapeLayer class]]) {
115+
((CAShapeLayer *)bgLayer).fillColor = self.backgroundColor.CGColor;
116+
}
109117
[self.progressView setHidden:!(state == DownloadStateDownloading || state == DownloadStatePausing)];
110118

111-
[_stateButton setImage:[UIImage imageNamed:stateImageName] forState:UIControlStateNormal];
119+
[_stateButton setTitle:stateTitleStr forState:UIControlStateNormal];
112120
}
113121

114122
- (void)layoutSubviews{

Coding_iOS/Views/Cell/FileVersionCell.m

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
6868
[self.contentView addSubview:self.progressView];
6969
}
7070
if (!_stateButton) {
71-
_stateButton = [[UIButton alloc] initWithFrame:CGRectMake((kScreen_Width - 55), ([FileVersionCell cellHeight] - 25)/2, 45, 25)];
71+
_stateButton = [[UIButton alloc] initWithFrame:CGRectMake((kScreen_Width - 60), ([FileVersionCell cellHeight] - 30)/2, 50, 30)];
72+
[_stateButton doBorderWidth:1.0 color:kColorD8DDE4 cornerRadius:3];
73+
_stateButton.titleLabel.font = [UIFont systemFontOfSize:14];
74+
[_stateButton setTitleColor:kColorDark7 forState:UIControlStateNormal];
7275
[_stateButton addTarget:self action:@selector(clickedByUser) forControlEvents:UIControlEventTouchUpInside];
7376
[self.contentView addSubview:_stateButton];
7477
}
@@ -138,28 +141,33 @@ - (void)updateCompleted:(CGFloat)fractionCompleted{
138141
}
139142

140143
- (void)changeToState:(DownloadState)state{
141-
NSString *stateImageName;
144+
NSString *stateTitleStr;
142145
switch (state) {
143146
case DownloadStateDefault:
144-
stateImageName = @"icon_file_state_download";
147+
stateTitleStr = @"下载";
145148
break;
146149
case DownloadStateDownloading:
147-
stateImageName = @"icon_file_state_pause";
150+
stateTitleStr = @"暂停";
148151
break;
149152
case DownloadStatePausing:
150-
stateImageName = @"icon_file_state_goon";
153+
stateTitleStr = @"继续";
151154
break;
152155
case DownloadStateDownloaded:
153-
stateImageName = @"icon_file_state_look";
156+
stateTitleStr = @"查看";
154157
break;
155158
default:
156-
stateImageName = @"icon_file_state_download";
159+
stateTitleStr = @"下载";
157160
break;
158161
}
159162
[self setBackgroundColor:(state == DownloadStateDownloaded)? [UIColor colorWithHexString:@"0x81BCFF" andAlpha:.1]:[UIColor whiteColor]];
163+
//addLineforPlainCell: 重置了 backgroundView,要改 layer 才行
164+
CALayer *bgLayer = self.backgroundView.layer.sublayers.firstObject;
165+
if (bgLayer && [bgLayer isKindOfClass:[CAShapeLayer class]]) {
166+
((CAShapeLayer *)bgLayer).fillColor = self.backgroundColor.CGColor;
167+
}
160168
[self.progressView setHidden:!(state == DownloadStateDownloading || state == DownloadStatePausing)];
161169

162-
[_stateButton setImage:[UIImage imageNamed:stateImageName] forState:UIControlStateNormal];
170+
[_stateButton setTitle:stateTitleStr forState:UIControlStateNormal];
163171
}
164172

165173
- (void)clickedByUser{

0 commit comments

Comments
 (0)