Skip to content

Commit

Permalink
关于页面增加内容
Browse files Browse the repository at this point in the history
  • Loading branch information
ming1016 committed May 28, 2014
1 parent 52045df commit e0ca170
Show file tree
Hide file tree
Showing 10 changed files with 196 additions and 72 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* 整理RSS推荐源,添加RSS时可以进行分类选择

##项目主要贡献者
[@ming1016](https://github.com/ming1016) [@zaczh](https://github.com/zaczh) [@wuzhou](https://github.com/wuzhou) [@ftxbird](https://github.com/ftxbird) [ben46](https://github.com/ben46)
ID|Github Page -|- ming1016|<https://github.com/ming1016> zaczh|<https://github.com/zaczh> wuzhou|<https://github.com/wuzhou> ftxbird|<https://github.com/ftxbird> ben46|<https://github.com/ben46>


##参与进来
Expand Down
14 changes: 10 additions & 4 deletions RSSRead.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
D21D4846192F7691007003C8 /* RSS.m in Sources */ = {isa = PBXBuildFile; fileRef = D21D4845192F7691007003C8 /* RSS.m */; };
D21D4849192F7692007003C8 /* Subscribes.m in Sources */ = {isa = PBXBuildFile; fileRef = D21D4848192F7692007003C8 /* Subscribes.m */; };
D2A26E3A19238AF800C9CB86 /* SMAboutViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D2A26E3919238AF800C9CB86 /* SMAboutViewController.m */; };
D2A2A6B819248C81009BDB38 /* about.html in Resources */ = {isa = PBXBuildFile; fileRef = D2A2A6B719248C81009BDB38 /* about.html */; };
D2DDA05B18DBBCE0005394E4 /* SMRSSListCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D2DDA05A18DBBCE0005394E4 /* SMRSSListCell.m */; };
D2DDA05F18DC25E1005394E4 /* SMDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D2DDA05E18DC25E1005394E4 /* SMDetailViewController.m */; };
D2E078BD19278D9000ABF6EB /* RecommendFeedList.plist in Resources */ = {isa = PBXBuildFile; fileRef = D2E078BC19278D9000ABF6EB /* RecommendFeedList.plist */; };
Expand Down Expand Up @@ -72,6 +71,8 @@
D2F79E27192B4682000727D4 /* bg5.png in Resources */ = {isa = PBXBuildFile; fileRef = D2F79E21192B4681000727D4 /* bg5.png */; };
D2F79E28192B4682000727D4 /* bg6.png in Resources */ = {isa = PBXBuildFile; fileRef = D2F79E22192B4681000727D4 /* bg6.png */; };
D2FB786918E3C4BB007BD413 /* js.html in Resources */ = {isa = PBXBuildFile; fileRef = D2FB786818E3C4BB007BD413 /* js.html */; };
D2FF7288193622F00062F839 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = D2FF7287193622F00062F839 /* [email protected] */; };
D2FF728B193629EC0062F839 /* SMAboutWebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D2FF728A193629EC0062F839 /* SMAboutWebViewController.m */; };
DE6576F4192BC58400017996 /* SMAddRSSToolbar.m in Sources */ = {isa = PBXBuildFile; fileRef = DE6576F3192BC58400017996 /* SMAddRSSToolbar.m */; };
DE6576F7192BCA1500017996 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = DE6576F6192BCA1500017996 /* [email protected] */; };
DE948399192F20C300EA431C /* SMTouchsView.m in Sources */ = {isa = PBXBuildFile; fileRef = DE948398192F20C300EA431C /* SMTouchsView.m */; };
Expand Down Expand Up @@ -137,7 +138,6 @@
D21D4848192F7692007003C8 /* Subscribes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Subscribes.m; sourceTree = "<group>"; };
D2A26E3819238AF800C9CB86 /* SMAboutViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SMAboutViewController.h; sourceTree = "<group>"; };
D2A26E3919238AF800C9CB86 /* SMAboutViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SMAboutViewController.m; sourceTree = "<group>"; };
D2A2A6B719248C81009BDB38 /* about.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = about.html; sourceTree = "<group>"; };
D2DDA05918DBBCE0005394E4 /* SMRSSListCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SMRSSListCell.h; sourceTree = "<group>"; };
D2DDA05A18DBBCE0005394E4 /* SMRSSListCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SMRSSListCell.m; sourceTree = "<group>"; };
D2DDA05D18DC25E1005394E4 /* SMDetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SMDetailViewController.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -197,6 +197,9 @@
D2F79E21192B4681000727D4 /* bg5.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = bg5.png; sourceTree = "<group>"; };
D2F79E22192B4681000727D4 /* bg6.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = bg6.png; sourceTree = "<group>"; };
D2FB786818E3C4BB007BD413 /* js.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = js.html; sourceTree = "<group>"; };
D2FF7287193622F00062F839 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
D2FF7289193629EC0062F839 /* SMAboutWebViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SMAboutWebViewController.h; sourceTree = "<group>"; };
D2FF728A193629EC0062F839 /* SMAboutWebViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SMAboutWebViewController.m; sourceTree = "<group>"; };
DE6576F2192BC58400017996 /* SMAddRSSToolbar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SMAddRSSToolbar.h; sourceTree = "<group>"; };
DE6576F3192BC58400017996 /* SMAddRSSToolbar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SMAddRSSToolbar.m; sourceTree = "<group>"; };
DE6576F6192BCA1500017996 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -493,7 +496,6 @@
D2F75F6718D9827B00ED44A3 /* RSSList */ = {
isa = PBXGroup;
children = (
D2A2A6B719248C81009BDB38 /* about.html */,
CB09E3DB1930798C000D7597 /* css.html */,
CB09E3DD19307BC5000D7597 /* css_dark.html */,
D2FB786818E3C4BB007BD413 /* js.html */,
Expand Down Expand Up @@ -574,6 +576,8 @@
DEE9FE45192C881300621576 /* source */,
D2A26E3819238AF800C9CB86 /* SMAboutViewController.h */,
D2A26E3919238AF800C9CB86 /* SMAboutViewController.m */,
D2FF7289193629EC0062F839 /* SMAboutWebViewController.h */,
D2FF728A193629EC0062F839 /* SMAboutWebViewController.m */,
DEE9FE39192C87DE00621576 /* SMRSSaboutgroup.h */,
DEE9FE3A192C87DE00621576 /* SMRSSaboutgroup.m */,
DEE9FE3B192C87DE00621576 /* SMRSSaboutModel.h */,
Expand All @@ -585,6 +589,7 @@
DEE9FE45192C881300621576 /* source */ = {
isa = PBXGroup;
children = (
D2FF7287193622F00062F839 /* [email protected] */,
DEE9FE41192C880700621576 /* [email protected] */,
DEE9FE42192C880700621576 /* [email protected] */,
DEE9FE3F192C87FB00621576 /* aboutRSS.plist */,
Expand Down Expand Up @@ -707,6 +712,7 @@
CBAA334A192F715600098322 /* SMAddRssSoucesCell.xib in Resources */,
D2E8FBF618C46B5A005E8F2E /* InfoPlist.strings in Resources */,
DEE9FE40192C87FB00621576 /* aboutRSS.plist in Resources */,
D2FF7288193622F00062F839 /* [email protected] in Resources */,
DEE9FE43192C880700621576 /* [email protected] in Resources */,
D2EB1F2F18FA733C000C13D3 /* backgroundNavbar.png in Resources */,
D2F79E28192B4682000727D4 /* bg6.png in Resources */,
Expand All @@ -715,7 +721,6 @@
DEE9FE44192C880700621576 /* [email protected] in Resources */,
D2F5F1361930555100321CBE /* leftBg.png in Resources */,
CB45E7BD192E310300C6D84C /* SMDetailViewBottomBar.xib in Resources */,
D2A2A6B819248C81009BDB38 /* about.html in Resources */,
CB09E3DE19307BC5000D7597 /* css_dark.html in Resources */,
D204F35D192CB5F400425808 /* bg7.png in Resources */,
D2F79E24192B4682000727D4 /* bg2.png in Resources */,
Expand Down Expand Up @@ -806,6 +811,7 @@
D2E8FBF818C46B5A005E8F2E /* main.m in Sources */,
D2DDA05B18DBBCE0005394E4 /* SMRSSListCell.m in Sources */,
CB09E3DA19304ED6000D7597 /* SMRSSListCellMgr.m in Sources */,
D2FF728B193629EC0062F839 /* SMAboutWebViewController.m in Sources */,
DEE9FE62192E5DBF00621576 /* SMAddRssSoucesCell.m in Sources */,
CB502759192FA39D00EB4DD1 /* MBProgressHUD+Ext.m in Sources */,
CB45E7C0192E332D00C6D84C /* SMDetailViewBottomBar.m in Sources */,
Expand Down
70 changes: 30 additions & 40 deletions RSSRead/SMAboutViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#import "SMRSSaboutModel.h"
#import "MBProgressHUD.h"
#import "SMBlurBackground.h"
#import "SMAboutWebViewController.h"
#define krowHeight 44

@interface SMAboutViewController () <UIWebViewDelegate>
Expand Down Expand Up @@ -91,6 +92,10 @@ - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView

}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 80;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
SMRSSaboutgroup *group = self.groups[section];
Expand All @@ -112,18 +117,18 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
cell.imageView.image = [UIImage imageNamed:about.icon];
cell.imageView.layer.cornerRadius = 22;
cell.imageView.layer.masksToBounds = YES;
cell.imageView.frame = CGRectMake(0, 0, 40, 40);
cell.textLabel.text = about.title;
cell.detailTextLabel.text = about.link;

//添加cell分割线
CGFloat lineViewX = 65;
CGFloat lineViewY = krowHeight-1;
CGFloat lineViewW = self.view.bounds.size.width - lineViewX -5;
CGFloat lineViewH = 1;
UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(lineViewX, lineViewY, lineViewW , lineViewH)];
lineView.backgroundColor = [UIColor colorWithWhite:0.7 alpha:0.5];
[cell.contentView addSubview:lineView];

// CGFloat lineViewX = 65;
// CGFloat lineViewY = krowHeight-1;
// CGFloat lineViewW = self.view.bounds.size.width - lineViewX -5;
// CGFloat lineViewH = 1;
// UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(lineViewX, lineViewY, lineViewW , lineViewH)];
// lineView.backgroundColor = [UIColor colorWithWhite:0.7 alpha:0.5];
// [cell.contentView addSubview:lineView];

return cell;
}
Expand All @@ -132,42 +137,27 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
{
SMRSSaboutgroup *group = self.groups[indexPath.section];
SMRSSaboutModel *about = group.abouts[indexPath.row];
//加载webview
UIWebView *webView = [[UIWebView alloc]init];
webView.frame = self.view.bounds;
webView.delegate =self;
[self.view addSubview:webView];

//加载指定页面
NSString * str = about.link;
NSURL *url = [NSURL URLWithString:str];
NSURLRequest * request = [NSURLRequest requestWithURL:url];
[webView loadRequest:request];
SMAboutWebViewController *webVC = [[SMAboutWebViewController alloc]initWithNibName:nil bundle:nil];
webVC.url = about.link;
webVC.title = about.title;
[self.navigationController pushViewController:webVC animated:YES];


// //加载webview
// UIWebView *webView = [[UIWebView alloc]init];
// webView.frame = self.view.bounds;
// webView.delegate =self;
// [self.view addSubview:webView];
//
// //加载指定页面
// NSString * str = about.link;
// NSURL *url = [NSURL URLWithString:str];
// NSURLRequest * request = [NSURLRequest requestWithURL:url];
// [webView loadRequest:request];

}
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
MBProgressHUD *HUD = [[MBProgressHUD alloc] initWithView:self.view];
[self.view addSubview:HUD];
//显示的文字
HUD.labelText = @"已阅正在为您努力加载中";
//是否有庶罩
HUD.dimBackground = YES;
[HUD show:YES];
self.HUD =HUD;
return YES;
}

- (void)webViewDidFinishLoad:(UIWebView *)webView
{
[self.HUD hide:YES afterDelay:0.5];
}
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
{
self.HUD.labelText = @"亲,你的网络可能有问题.";
[self.HUD hide:YES afterDelay:2];
[self.webView removeFromSuperview];
}

/**
* 第section组显示的头部标题
Expand Down
13 changes: 13 additions & 0 deletions RSSRead/SMAboutWebViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// SMAboutWebViewController.h
// RSSRead
//
// Created by ming on 14-5-28.
// Copyright (c) 2014年 starming. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface SMAboutWebViewController : UIViewController
@property(nonatomic,strong)NSString *url;
@end
91 changes: 91 additions & 0 deletions RSSRead/SMAboutWebViewController.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
//
// SMAboutWebViewController.m
// RSSRead
//
// Created by ming on 14-5-28.
// Copyright (c) 2014年 starming. All rights reserved.
//

#import "SMAboutWebViewController.h"
#import "MBProgressHUD+Ext.h"

@interface SMAboutWebViewController ()<UIWebViewDelegate>
@property(nonatomic,strong)UIWebView *webView;
@property (nonatomic,weak) MBProgressHUD *HUD;
@end

@implementation SMAboutWebViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}

-(void)loadView {
[super loadView];
_webView = [[UIWebView alloc] initWithFrame:self.view.bounds];
_webView.delegate = self;
[_webView setBackgroundColor:[UIColor whiteColor]];
_webView.scalesPageToFit = YES;
_webView.scrollView.directionalLockEnabled = YES;
_webView.scrollView.showsHorizontalScrollIndicator = NO;
[_webView setOpaque:NO]; // 默认是透明的
[self.view addSubview:_webView];
}

- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
[_webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:_url]]];
}
-(void)setUrl:(NSString *)url {
NSLog(@"dddd %@",url);
_url = url;
}

- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
MBProgressHUD *HUD = [[MBProgressHUD alloc] initWithView:self.view];
[self.view addSubview:HUD];
//显示的文字
HUD.labelText = @"已阅正在为您努力加载中";
//是否有庶罩
HUD.dimBackground = YES;
[HUD show:YES];
self.HUD =HUD;
return YES;
}

- (void)webViewDidFinishLoad:(UIWebView *)webView
{
[self.HUD hide:YES afterDelay:0.5];
}
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
{
self.HUD.labelText = @"亲,你的网络可能有问题.";
[self.HUD hide:YES afterDelay:2];
[self.webView removeFromSuperview];
}

/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/

@end
20 changes: 10 additions & 10 deletions RSSRead/SMSettingViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ -(RETableViewSection *)addGeneralSection{
-(RETableViewSection *)addBackgroundImageSection{
RETableViewSection *section = [RETableViewSection sectionWithHeaderTitle:@"背景"];
[self.manager addSection:section];
_isUseYourOwnBackgroundImage = [REBoolItem itemWithTitle:@"是否启用自己的背景" value:[[SMPreferences sharedInstance] isUseYourOwnBackgroundImage] switchValueChangeHandler:^(REBoolItem *item){
[[SMPreferences sharedInstance] setIsUseYourOwnBackgroundImage:item.value];
[[SMPreferences sharedInstance] synchronize];
}];
[section addItem:_isUseYourOwnBackgroundImage];
// _isUseYourOwnBackgroundImage = [REBoolItem itemWithTitle:@"是否启用自己的背景" value:[[SMPreferences sharedInstance] isUseYourOwnBackgroundImage] switchValueChangeHandler:^(REBoolItem *item){
// [[SMPreferences sharedInstance] setIsUseYourOwnBackgroundImage:item.value];
// [[SMPreferences sharedInstance] synchronize];
// }];
// [section addItem:_isUseYourOwnBackgroundImage];

_isUseBlurForYourBackgroundImage = [REBoolItem itemWithTitle:@"是否启用模糊效果" value:[[SMPreferences sharedInstance] isUseBlurForYourBackgroundImage] switchValueChangeHandler:^(REBoolItem *item){
[[SMPreferences sharedInstance] setIsUseBlurForYourBackgroundImage:item.value];
Expand All @@ -86,11 +86,11 @@ -(RETableViewSection *)addBackgroundImageSection{
}];
[section addItem:_backgroundBlurRadius];

_backgroundImageSelect = [RETableViewItem itemWithTitle:@"选择一张自己的背景" accessoryType:UITableViewCellAccessoryNone selectionHandler:^(RETableViewItem *item) {
//TODO:选择相册一张背景
}];
_backgroundImageSelect.image = [UIImage imageNamed:@"bg3"];
[section addItem:_backgroundImageSelect];
// _backgroundImageSelect = [RETableViewItem itemWithTitle:@"选择一张自己的背景" accessoryType:UITableViewCellAccessoryNone selectionHandler:^(RETableViewItem *item) {
// //TODO:选择相册一张背景
// }];
// _backgroundImageSelect.image = [UIImage imageNamed:@"bg3"];
// [section addItem:_backgroundImageSelect];

return section;
}
Expand Down
8 changes: 0 additions & 8 deletions RSSRead/about.html

This file was deleted.

Loading

0 comments on commit e0ca170

Please sign in to comment.