Skip to content

Commit 010c7d4

Browse files
committed
文件 - 要开始了
1 parent 36b25bf commit 010c7d4

5 files changed

Lines changed: 40 additions & 3 deletions

File tree

.DS_Store

0 Bytes
Binary file not shown.

Coding_iOS.xcodeproj/project.pbxproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,8 @@
372372
4EAE06901B784E9200179F4B /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 4EAE068F1B784E9200179F4B /* [email protected] */; };
373373
4EAE06921B7880BA00179F4B /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 4EAE06911B7880BA00179F4B /* [email protected] */; };
374374
4EAE06A41B7AE4EF00179F4B /* FileComment.m in Sources */ = {isa = PBXBuildFile; fileRef = 4EAE06A31B7AE4EF00179F4B /* FileComment.m */; };
375+
4EAE06A71B7B1AE100179F4B /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 4EAE06A51B7B1AE100179F4B /* [email protected] */; };
376+
4EAE06A81B7B1AE100179F4B /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 4EAE06A61B7B1AE100179F4B /* [email protected] */; };
375377
4EB0C2001A807ED00042FC4F /* NSURL+Common.m in Sources */ = {isa = PBXBuildFile; fileRef = 4EB0C1FF1A807ED00042FC4F /* NSURL+Common.m */; };
376378
4EB845331AB83C3B0030DC69 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 4EB845301AB83C3B0030DC69 /* [email protected] */; };
377379
4EB845341AB83C3B0030DC69 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 4EB845311AB83C3B0030DC69 /* [email protected] */; };
@@ -1404,6 +1406,8 @@
14041406
4EAE06911B7880BA00179F4B /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
14051407
4EAE06A21B7AE4EF00179F4B /* FileComment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileComment.h; sourceTree = "<group>"; };
14061408
4EAE06A31B7AE4EF00179F4B /* FileComment.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FileComment.m; sourceTree = "<group>"; };
1409+
4EAE06A51B7B1AE100179F4B /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
1410+
4EAE06A61B7B1AE100179F4B /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
14071411
4EB0C1FE1A807ED00042FC4F /* NSURL+Common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSURL+Common.h"; sourceTree = "<group>"; };
14081412
4EB0C1FF1A807ED00042FC4F /* NSURL+Common.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSURL+Common.m"; sourceTree = "<group>"; };
14091413
4EB845301AB83C3B0030DC69 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
@@ -2408,6 +2412,8 @@
24082412
4EACB43D1A2C448F0097ABB3 /* [email protected] */,
24092413
4EACB43E1A2C448F0097ABB3 /* [email protected] */,
24102414
4EACB4421A2C45300097ABB3 /* [email protected] */,
2415+
4EAE06A51B7B1AE100179F4B /* [email protected] */,
2416+
4EAE06A61B7B1AE100179F4B /* [email protected] */,
24112417
);
24122418
path = button_file_manage;
24132419
sourceTree = "<group>";
@@ -4474,6 +4480,7 @@
44744480
8EA6D18A19E240C40076D59C /* [email protected] in Resources */,
44754481
4EB845341AB83C3B0030DC69 /* [email protected] in Resources */,
44764482
8E97CE641A0A3424006F9AD7 /* [email protected] in Resources */,
4483+
4EAE06A81B7B1AE100179F4B /* [email protected] in Resources */,
44774484
4E0849851A918A7F00BD27F6 /* [email protected] in Resources */,
44784485
4E96E7DE1A1B537E0037C098 /* [email protected] in Resources */,
44794486
8EA6D1A119E240C40076D59C /* [email protected] in Resources */,
@@ -4643,6 +4650,7 @@
46434650
4E6383E01B32676600D98648 /* [email protected] in Resources */,
46444651
4E8F92DE1B67BE3C00033D8F /* [email protected] in Resources */,
46454652
8E97CE521A0A3410006F9AD7 /* [email protected] in Resources */,
4653+
4EAE06A71B7B1AE100179F4B /* [email protected] in Resources */,
46464654
8EC911291A027A54009EAE99 /* [email protected] in Resources */,
46474655
4E6383C41B3265DC00D98648 /* [email protected] in Resources */,
46484656
4EED9DD11B53BBCF000E5827 /* [email protected] in Resources */,

Coding_iOS/Controllers/FileViewController.m

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,17 @@
1212
#import "Coding_NetAPIManager.h"
1313
#import "WebContentManager.h"
1414
#import <MMMarkdown/MMMarkdown.h>
15+
#import "EaseToolBar.h"
1516

16-
@interface FileViewController () <QLPreviewControllerDataSource, QLPreviewControllerDelegate, UIDocumentInteractionControllerDelegate, UIWebViewDelegate>
17+
@interface FileViewController () <QLPreviewControllerDataSource, QLPreviewControllerDelegate, UIDocumentInteractionControllerDelegate, UIWebViewDelegate, EaseToolBarDelegate>
1718
@property (strong, nonatomic) NSURL *fileUrl;
1819
@property (strong, nonatomic) QLPreviewController *previewController;
1920
@property (strong, nonatomic) FileDownloadView *downloadView;
2021
@property (nonatomic, strong) UIDocumentInteractionController *docInteractionController;
2122

2223
@property (strong, nonatomic) UIWebView *contentWebView;
2324
@property (strong, nonatomic) UIActivityIndicatorView *activityIndicator;
25+
@property (nonatomic, strong) EaseToolBar *myToolBar;
2426

2527
@end
2628

@@ -37,6 +39,22 @@ - (void)viewDidLoad {
3739
}
3840
}
3941

42+
- (EaseToolBar *)myToolBar{
43+
return nil;
44+
if (!_myToolBar) {
45+
EaseToolBarItem *item1 = [EaseToolBarItem easeToolBarItemWithTitle:@" 文件动态" image:@"button_file_activity" disableImage:nil];
46+
EaseToolBarItem *item2 = [EaseToolBarItem easeToolBarItemWithTitle:@" 历史版本" image:@"button_file_history" disableImage:nil];
47+
_myToolBar = [EaseToolBar easeToolBarWithItems:@[item1, item2]];
48+
_myToolBar.delegate = self;
49+
[self.view addSubview:_myToolBar];
50+
[_myToolBar mas_makeConstraints:^(MASConstraintMaker *make) {
51+
make.bottom.equalTo(self.view.mas_bottom);
52+
make.size.mas_equalTo(_myToolBar.frame.size);
53+
}];
54+
}
55+
return _myToolBar;
56+
}
57+
4058
- (void)requestFileData{
4159
[self.view beginLoading];
4260
__weak typeof(self) weakSelf = self;
@@ -64,6 +82,7 @@ - (void)configContent{
6482

6583
if (!fileUrl ) {
6684
[self showDownloadView];
85+
_myToolBar.hidden = YES;
6786
return;
6887
}
6988

@@ -80,6 +99,7 @@ - (void)configContent{
8099
}else {
81100
[self showDownloadView];
82101
}
102+
self.myToolBar.hidden = NO;
83103
}
84104

85105

@@ -94,7 +114,9 @@ - (void)showDiskFile:(NSURL *)fileUrl{
94114

95115
[self.view addSubview:preview.view];
96116
[preview.view mas_makeConstraints:^(MASConstraintMaker *make) {
97-
make.edges.equalTo(self.view);
117+
make.top.left.right.equalTo(self.view);
118+
make.bottom.equalTo(self.view).offset(-49);
119+
// make.edges.equalTo(self.view);
98120
}];
99121
self.previewController = preview;
100122
}
@@ -120,7 +142,9 @@ - (void)loadWebView:(NSURL *)fileUrl{
120142
[_contentWebView addSubview:_activityIndicator];
121143
[self.view addSubview:_contentWebView];
122144
[_contentWebView mas_makeConstraints:^(MASConstraintMaker *make) {
123-
make.edges.equalTo(self.view);
145+
make.top.left.right.equalTo(self.view);
146+
make.bottom.equalTo(self.view).offset(-49);
147+
// make.edges.equalTo(self.view);
124148
}];
125149
}
126150
if ([self.curFile.fileType isEqualToString:@"md"]){
@@ -267,6 +291,11 @@ - (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error{
267291
[self showError:error];
268292
}
269293
}
294+
295+
#pragma mark EaseToolBarDelegate
296+
- (void)easeToolBar:(EaseToolBar *)toolBar didClickedIndex:(NSInteger)index{
297+
[self showHudTipStr:@"还在做"];
298+
}
270299
@end
271300

272301

2.13 KB
Loading
1.45 KB
Loading

0 commit comments

Comments
 (0)