This commit is contained in:
2014-08-11 16:29:18 +08:00
parent 8e92b78d9a
commit 859443c955
19 changed files with 593 additions and 5 deletions
+60
View File
@@ -68,6 +68,18 @@
A9AF6CA41994D0660076C0EE /* ad2@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9AF6CA11994D0660076C0EE /* ad2@2x.png */; }; A9AF6CA41994D0660076C0EE /* ad2@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9AF6CA11994D0660076C0EE /* ad2@2x.png */; };
A9AF6CA51994D0660076C0EE /* ad3@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9AF6CA21994D0660076C0EE /* ad3@2x.png */; }; A9AF6CA51994D0660076C0EE /* ad3@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9AF6CA21994D0660076C0EE /* ad3@2x.png */; };
A9AF6CA61994D0660076C0EE /* ad4@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9AF6CA31994D0660076C0EE /* ad4@2x.png */; }; A9AF6CA61994D0660076C0EE /* ad4@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9AF6CA31994D0660076C0EE /* ad4@2x.png */; };
A9EAA035199857F5001A872A /* HomeMainView.m in Sources */ = {isa = PBXBuildFile; fileRef = A9EAA034199857F5001A872A /* HomeMainView.m */; };
A9EAA04019985EDE001A872A /* HomeMainView.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9EAA03F19985EDE001A872A /* HomeMainView.xib */; };
A9EAA04519986DC3001A872A /* fund_cell_label_bg_blue@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9EAA04119986DC3001A872A /* fund_cell_label_bg_blue@2x.png */; };
A9EAA04619986DC3001A872A /* fund_cell_label_bg_gray@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9EAA04219986DC3001A872A /* fund_cell_label_bg_gray@2x.png */; };
A9EAA04719986DC3001A872A /* fund_cell_label_bg_green@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9EAA04319986DC3001A872A /* fund_cell_label_bg_green@2x.png */; };
A9EAA04819986DC3001A872A /* fund_cell_label_bg_red@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9EAA04419986DC3001A872A /* fund_cell_label_bg_red@2x.png */; };
A9EAA04A19986E8C001A872A /* pull_arrow_down_black@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9EAA04919986E8C001A872A /* pull_arrow_down_black@2x.png */; };
A9EAA04E1998787B001A872A /* hk_home_center__cycle@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9EAA04B1998787B001A872A /* hk_home_center__cycle@2x.png */; };
A9EAA04F1998787B001A872A /* hk_home_center_bg@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9EAA04C1998787B001A872A /* hk_home_center_bg@2x.png */; };
A9EAA0501998787B001A872A /* hk_home_center_cover@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9EAA04D1998787B001A872A /* hk_home_center_cover@2x.png */; };
A9EAA052199879CC001A872A /* pie_chart_center.png in Resources */ = {isa = PBXBuildFile; fileRef = A9EAA051199879CC001A872A /* pie_chart_center.png */; };
A9EAA05619988C55001A872A /* MRCircularProgressView.m in Sources */ = {isa = PBXBuildFile; fileRef = A9EAA05519988C55001A872A /* MRCircularProgressView.m */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */ /* Begin PBXContainerItemProxy section */
@@ -163,6 +175,20 @@
A9AF6CA11994D0660076C0EE /* ad2@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ad2@2x.png"; sourceTree = "<group>"; }; A9AF6CA11994D0660076C0EE /* ad2@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ad2@2x.png"; sourceTree = "<group>"; };
A9AF6CA21994D0660076C0EE /* ad3@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ad3@2x.png"; sourceTree = "<group>"; }; A9AF6CA21994D0660076C0EE /* ad3@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ad3@2x.png"; sourceTree = "<group>"; };
A9AF6CA31994D0660076C0EE /* ad4@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ad4@2x.png"; sourceTree = "<group>"; }; A9AF6CA31994D0660076C0EE /* ad4@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ad4@2x.png"; sourceTree = "<group>"; };
A9EAA033199857F5001A872A /* HomeMainView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HomeMainView.h; sourceTree = "<group>"; };
A9EAA034199857F5001A872A /* HomeMainView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HomeMainView.m; sourceTree = "<group>"; };
A9EAA03F19985EDE001A872A /* HomeMainView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = HomeMainView.xib; sourceTree = "<group>"; };
A9EAA04119986DC3001A872A /* fund_cell_label_bg_blue@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "fund_cell_label_bg_blue@2x.png"; sourceTree = "<group>"; };
A9EAA04219986DC3001A872A /* fund_cell_label_bg_gray@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "fund_cell_label_bg_gray@2x.png"; sourceTree = "<group>"; };
A9EAA04319986DC3001A872A /* fund_cell_label_bg_green@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "fund_cell_label_bg_green@2x.png"; sourceTree = "<group>"; };
A9EAA04419986DC3001A872A /* fund_cell_label_bg_red@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "fund_cell_label_bg_red@2x.png"; sourceTree = "<group>"; };
A9EAA04919986E8C001A872A /* pull_arrow_down_black@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "pull_arrow_down_black@2x.png"; sourceTree = "<group>"; };
A9EAA04B1998787B001A872A /* hk_home_center__cycle@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "hk_home_center__cycle@2x.png"; sourceTree = "<group>"; };
A9EAA04C1998787B001A872A /* hk_home_center_bg@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "hk_home_center_bg@2x.png"; sourceTree = "<group>"; };
A9EAA04D1998787B001A872A /* hk_home_center_cover@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "hk_home_center_cover@2x.png"; sourceTree = "<group>"; };
A9EAA051199879CC001A872A /* pie_chart_center.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = pie_chart_center.png; sourceTree = "<group>"; };
A9EAA05419988C55001A872A /* MRCircularProgressView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MRCircularProgressView.h; sourceTree = "<group>"; };
A9EAA05519988C55001A872A /* MRCircularProgressView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MRCircularProgressView.m; sourceTree = "<group>"; };
C7B3792862C24377B1ACD469 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; C7B3792862C24377B1ACD469 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */ /* End PBXFileReference section */
@@ -198,6 +224,9 @@
A9AA325D19970335000BE4FB /* HomeAdView.m */, A9AA325D19970335000BE4FB /* HomeAdView.m */,
A9AA325E19970335000BE4FB /* ImagePlayerView.h */, A9AA325E19970335000BE4FB /* ImagePlayerView.h */,
A9AA325F19970335000BE4FB /* ImagePlayerView.m */, A9AA325F19970335000BE4FB /* ImagePlayerView.m */,
A9EAA033199857F5001A872A /* HomeMainView.h */,
A9EAA034199857F5001A872A /* HomeMainView.m */,
A9EAA03F19985EDE001A872A /* HomeMainView.xib */,
); );
path = HomeView; path = HomeView;
sourceTree = "<group>"; sourceTree = "<group>";
@@ -306,6 +335,7 @@
A9AF6C4A19949B510076C0EE /* Common */ = { A9AF6C4A19949B510076C0EE /* Common */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
A9EAA05319988C55001A872A /* MRCircularProgressView */,
A9AF6C7E1994C5700076C0EE /* MJRefresh */, A9AF6C7E1994C5700076C0EE /* MJRefresh */,
A9AF6C4B19949B7B0076C0EE /* ManagerConstants.h */, A9AF6C4B19949B7B0076C0EE /* ManagerConstants.h */,
); );
@@ -315,6 +345,15 @@
A9AF6C4D19949CAD0076C0EE /* Resource */ = { A9AF6C4D19949CAD0076C0EE /* Resource */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
A9EAA051199879CC001A872A /* pie_chart_center.png */,
A9EAA04B1998787B001A872A /* hk_home_center__cycle@2x.png */,
A9EAA04C1998787B001A872A /* hk_home_center_bg@2x.png */,
A9EAA04D1998787B001A872A /* hk_home_center_cover@2x.png */,
A9EAA04919986E8C001A872A /* pull_arrow_down_black@2x.png */,
A9EAA04119986DC3001A872A /* fund_cell_label_bg_blue@2x.png */,
A9EAA04219986DC3001A872A /* fund_cell_label_bg_gray@2x.png */,
A9EAA04319986DC3001A872A /* fund_cell_label_bg_green@2x.png */,
A9EAA04419986DC3001A872A /* fund_cell_label_bg_red@2x.png */,
A9AF6C9F1994D0210076C0EE /* ad1@2x.png */, A9AF6C9F1994D0210076C0EE /* ad1@2x.png */,
A9AF6CA11994D0660076C0EE /* ad2@2x.png */, A9AF6CA11994D0660076C0EE /* ad2@2x.png */,
A9AF6CA21994D0660076C0EE /* ad3@2x.png */, A9AF6CA21994D0660076C0EE /* ad3@2x.png */,
@@ -376,6 +415,15 @@
path = MainView; path = MainView;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
A9EAA05319988C55001A872A /* MRCircularProgressView */ = {
isa = PBXGroup;
children = (
A9EAA05419988C55001A872A /* MRCircularProgressView.h */,
A9EAA05519988C55001A872A /* MRCircularProgressView.m */,
);
path = MRCircularProgressView;
sourceTree = "<group>";
};
/* End PBXGroup section */ /* End PBXGroup section */
/* Begin PBXNativeTarget section */ /* Begin PBXNativeTarget section */
@@ -455,19 +503,26 @@
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
A9AF6C43199498C40076C0EE /* MyViewController.xib in Resources */, A9AF6C43199498C40076C0EE /* MyViewController.xib in Resources */,
A9EAA04719986DC3001A872A /* fund_cell_label_bg_green@2x.png in Resources */,
A9AF6C731994B5890076C0EE /* icon_bar_share@2x.png in Resources */, A9AF6C731994B5890076C0EE /* icon_bar_share@2x.png in Resources */,
A9EAA04019985EDE001A872A /* HomeMainView.xib in Resources */,
A9AF6C6919949CD30076C0EE /* icon_dock_session@2x.png in Resources */, A9AF6C6919949CD30076C0EE /* icon_dock_session@2x.png in Resources */,
A9AF6C5C19949CD30076C0EE /* icon_dock_forum_actived@2x.png in Resources */, A9AF6C5C19949CD30076C0EE /* icon_dock_forum_actived@2x.png in Resources */,
A9AF6CA61994D0660076C0EE /* ad4@2x.png in Resources */, A9AF6CA61994D0660076C0EE /* ad4@2x.png in Resources */,
A9AF6C48199498D10076C0EE /* MoreViewController.xib in Resources */, A9AF6C48199498D10076C0EE /* MoreViewController.xib in Resources */,
A9EAA04A19986E8C001A872A /* pull_arrow_down_black@2x.png in Resources */,
A9AF6C6119949CD30076C0EE /* icon_dock_mine@2x.png in Resources */, A9AF6C6119949CD30076C0EE /* icon_dock_mine@2x.png in Resources */,
A9AF6CA51994D0660076C0EE /* ad3@2x.png in Resources */, A9AF6CA51994D0660076C0EE /* ad3@2x.png in Resources */,
A9EAA04819986DC3001A872A /* fund_cell_label_bg_red@2x.png in Resources */,
A9AF6C5E19949CD30076C0EE /* icon_dock_home_actived@2x.png in Resources */, A9AF6C5E19949CD30076C0EE /* icon_dock_home_actived@2x.png in Resources */,
A9EAA04519986DC3001A872A /* fund_cell_label_bg_blue@2x.png in Resources */,
A9AF6C6219949CD30076C0EE /* icon_dock_rt_actived@2x.png in Resources */, A9AF6C6219949CD30076C0EE /* icon_dock_rt_actived@2x.png in Resources */,
A9AF6C781994B5890076C0EE /* icon_share_default.png in Resources */, A9AF6C781994B5890076C0EE /* icon_share_default.png in Resources */,
A9AF6C741994B5890076C0EE /* icon_indicate_add_module@2x.png in Resources */, A9AF6C741994B5890076C0EE /* icon_indicate_add_module@2x.png in Resources */,
A9AF6C751994B5890076C0EE /* icon_indicate_arrow_don@2x.png in Resources */, A9AF6C751994B5890076C0EE /* icon_indicate_arrow_don@2x.png in Resources */,
A9AF6C5D19949CD30076C0EE /* icon_dock_forum@2x.png in Resources */, A9AF6C5D19949CD30076C0EE /* icon_dock_forum@2x.png in Resources */,
A9EAA04E1998787B001A872A /* hk_home_center__cycle@2x.png in Resources */,
A9EAA0501998787B001A872A /* hk_home_center_cover@2x.png in Resources */,
A9AF6C6719949CD30076C0EE /* icon_dock_session_actived@2x.png in Resources */, A9AF6C6719949CD30076C0EE /* icon_dock_session_actived@2x.png in Resources */,
A9AF6C771994B5890076C0EE /* icon_indicate_more@2x.png in Resources */, A9AF6C771994B5890076C0EE /* icon_indicate_more@2x.png in Resources */,
A9AA325A199702DB000BE4FB /* Images.xcassets in Resources */, A9AA325A199702DB000BE4FB /* Images.xcassets in Resources */,
@@ -479,11 +534,14 @@
A9AF6C791994B5890076C0EE /* tabbarShadowImage@2x.png in Resources */, A9AF6C791994B5890076C0EE /* tabbarShadowImage@2x.png in Resources */,
A9AF6BF719947DD00076C0EE /* InfoPlist.strings in Resources */, A9AF6BF719947DD00076C0EE /* InfoPlist.strings in Resources */,
A9AF6C761994B5890076C0EE /* icon_indicate_more_down@2x.png in Resources */, A9AF6C761994B5890076C0EE /* icon_indicate_more_down@2x.png in Resources */,
A9EAA04619986DC3001A872A /* fund_cell_label_bg_gray@2x.png in Resources */,
A9EAA052199879CC001A872A /* pie_chart_center.png in Resources */,
A9AF6CA41994D0660076C0EE /* ad2@2x.png in Resources */, A9AF6CA41994D0660076C0EE /* ad2@2x.png in Resources */,
A9AF6C34199484200076C0EE /* HomeViewController.xib in Resources */, A9AF6C34199484200076C0EE /* HomeViewController.xib in Resources */,
A9AF6C0019947DD00076C0EE /* Main.storyboard in Resources */, A9AF6C0019947DD00076C0EE /* Main.storyboard in Resources */,
A9AF6C3E199486CA0076C0EE /* ProductListViewController.xib in Resources */, A9AF6C3E199486CA0076C0EE /* ProductListViewController.xib in Resources */,
A9AF6C2F199483520076C0EE /* MainViewController.xib in Resources */, A9AF6C2F199483520076C0EE /* MainViewController.xib in Resources */,
A9EAA04F1998787B001A872A /* hk_home_center_bg@2x.png in Resources */,
A9AF6C6319949CD30076C0EE /* icon_dock_rt@2x.png in Resources */, A9AF6C6319949CD30076C0EE /* icon_dock_rt@2x.png in Resources */,
A9AF6C721994B5890076C0EE /* icon_bar_card@2x.png in Resources */, A9AF6C721994B5890076C0EE /* icon_bar_card@2x.png in Resources */,
A9AF6C6819949CD30076C0EE /* icon_dock_session_msg@2x.png in Resources */, A9AF6C6819949CD30076C0EE /* icon_dock_session_msg@2x.png in Resources */,
@@ -540,12 +598,14 @@
isa = PBXSourcesBuildPhase; isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
A9EAA05619988C55001A872A /* MRCircularProgressView.m in Sources */,
A9AF6C961994C5700076C0EE /* UIView+Extension.m in Sources */, A9AF6C961994C5700076C0EE /* UIView+Extension.m in Sources */,
A9AF6C921994C5700076C0EE /* MJRefreshFooterView.m in Sources */, A9AF6C921994C5700076C0EE /* MJRefreshFooterView.m in Sources */,
A9AA326019970335000BE4FB /* HomeAdView.m in Sources */, A9AA326019970335000BE4FB /* HomeAdView.m in Sources */,
A9AF6C3D199486CA0076C0EE /* ProductListViewController.m in Sources */, A9AF6C3D199486CA0076C0EE /* ProductListViewController.m in Sources */,
A9AF6C941994C5700076C0EE /* UIScrollView+Extension.m in Sources */, A9AF6C941994C5700076C0EE /* UIScrollView+Extension.m in Sources */,
A9AF6C47199498D10076C0EE /* MoreViewController.m in Sources */, A9AF6C47199498D10076C0EE /* MoreViewController.m in Sources */,
A9EAA035199857F5001A872A /* HomeMainView.m in Sources */,
A9AF6C951994C5700076C0EE /* UIScrollView+MJRefresh.m in Sources */, A9AF6C951994C5700076C0EE /* UIScrollView+MJRefresh.m in Sources */,
A9AA326119970335000BE4FB /* ImagePlayerView.m in Sources */, A9AA326119970335000BE4FB /* ImagePlayerView.m in Sources */,
A9AF6C0319947DD00076C0EE /* ViewController.m in Sources */, A9AF6C0319947DD00076C0EE /* ViewController.m in Sources */,
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

@@ -45,7 +45,7 @@
- (UIImageView *)arrowImage - (UIImageView *)arrowImage
{ {
if (!_arrowImage) { if (!_arrowImage) {
UIImageView *arrowImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:MJRefreshSrcName(@"arrow.png")]]; UIImageView *arrowImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:MJRefreshSrcName(@"pull_arrow_down_black.png")]];
arrowImage.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin; arrowImage.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
[self addSubview:_arrowImage = arrowImage]; [self addSubview:_arrowImage = arrowImage];
} }
@@ -0,0 +1,56 @@
//
// MRCircularProgressView.h
// MRCircularProgressView
//
// Created by Jose Luis Martinez de la Riva on 30/01/14.
//
// Copyright (c) 2014 http://martinezdelariva.com
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE
//
#import <UIKit/UIKit.h>
@interface MRCircularProgressView : UIView
// Set delegate to allow callbacks (animataionDidFinish, etc)
@property (weak, nonatomic) id delegate;
// Color of the progress arc
@property (strong, nonatomic) UIColor *progressColor;
// Width of progress arc
@property (assign, nonatomic) CGFloat progressArcWidth;
// Width of wrapper arc
@property (assign, nonatomic) CGFloat wrapperArcWidth;
// Color of wrapper arc
@property (strong, nonatomic) UIColor *wrapperColor;
// Set new progress (0.0f - 1.0f) with animation option
- (void)setProgress:(CGFloat)progress animated:(BOOL)animate;
// Set new progress (0.0f - 1.0f) animated with custom duration
- (void)setProgress:(CGFloat)progress duration:(CFTimeInterval)duration;
-(void)pause;
-(void)resume;
@end
@@ -0,0 +1,209 @@
//
// MRCircularProgressView.m
// MRCircularProgressView
//
// Created by Jose Luis Martinez de la Riva on 30/01/14.
//
// Copyright (c) 2014 http://martinezdelariva.com
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE
//
#import "MRCircularProgressView.h"
@interface MRCircularProgressView()
@property (strong, nonatomic) CAShapeLayer *shapeLayer;
@property (assign, nonatomic) CGFloat currentProgress;
@property (assign, nonatomic) CGFloat lastProgress;
@property (assign, nonatomic) BOOL animated;
@property (assign, nonatomic) CFTimeInterval duration;
@end
@implementation MRCircularProgressView
- (void)awakeFromNib
{
[self setUp];
}
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
// Initialization code
[self setUp];
}
return self;
}
- (void)setUp
{
// Init variables
self.delegate = nil;
self.currentProgress = 0.0f;
self.lastProgress = 0.0f;
self.animated = YES;
self.progressColor = [UIColor blueColor];
self.wrapperColor = self.progressColor;
self.duration = 0.5;
self.progressArcWidth = 3.0f;
self.wrapperArcWidth = 1.f;
}
- (void)drawRect:(CGRect)rect
{
// Outer circle
CGRect newRect = ({
CGRect insetRect = CGRectInset(rect, self.wrapperArcWidth + 0.5f, self.wrapperArcWidth + 0.5f);
CGRect newRect = insetRect;
newRect.size.width = MIN(CGRectGetMaxX(insetRect), CGRectGetMaxY(insetRect));
newRect.size.height = newRect.size.width;
newRect.origin.x = insetRect.origin.x + (CGRectGetWidth(insetRect) - CGRectGetWidth(newRect)) / 2;
newRect.origin.y = insetRect.origin.y + (CGRectGetHeight(insetRect) - CGRectGetHeight(newRect)) / 2;
newRect;
});
UIBezierPath *outerCircle = [UIBezierPath bezierPathWithOvalInRect:newRect];
[self.wrapperColor setStroke];
outerCircle.lineWidth = self.wrapperArcWidth;
[outerCircle stroke];
}
- (CGPathRef)progressPath
{
// Offset
CGFloat offset = - M_PI_2;
// EndAngle
CGFloat endAngle = self.currentProgress * 2 * M_PI + offset;
// Center
CGRect rect = self.bounds;
CGPoint center = CGPointMake(CGRectGetMidX(rect), CGRectGetMidY(rect));
// Radius
CGFloat radius = MIN(center.x, center.y) - self.progressArcWidth / 2;
// Inner arc
UIBezierPath *arcPath = [UIBezierPath bezierPathWithArcCenter:center
radius:radius
startAngle:offset
endAngle:endAngle
clockwise:1];
return arcPath.CGPath;
}
- (void)layoutSubviews
{
[super layoutSubviews];
[self refreshShapeLayer];
}
#pragma mark - Getters methods
- (CAShapeLayer *)shapeLayer
{
if (!_shapeLayer) {
_shapeLayer = [CAShapeLayer layer];
_shapeLayer.lineWidth = self.progressArcWidth;
_shapeLayer.fillColor = nil;
_shapeLayer.lineJoin = kCALineJoinBevel;
_shapeLayer.speed=1.0f;
[self.layer addSublayer:_shapeLayer];
}
// This will allow the color to be change in the middle of the duration period
_shapeLayer.strokeColor = self.progressColor.CGColor;
return _shapeLayer;
}
#pragma mark - Private methods
- (void)refreshShapeLayer
{
// Update path
self.shapeLayer.path = [self progressPath];
// Animation
if (self.currentProgress != self.lastProgress && self.animated) {
// From value
CGFloat fromValue = (1 * self.lastProgress) / self.currentProgress;
// Animation
CABasicAnimation *pathAnimation = [CABasicAnimation animationWithKeyPath:@"strokeEnd"];
pathAnimation.delegate = self.delegate;
pathAnimation.duration = self.duration;
pathAnimation.fromValue = @(fromValue);
pathAnimation.toValue = @(1.0f);
[self.shapeLayer addAnimation:pathAnimation forKey:@"strokeEnd"];
}
// Update lastProgress
self.lastProgress = self.currentProgress;
}
#pragma mark - Public methods
- (void)setProgress:(CGFloat)progress animated:(BOOL)animate
{
self.currentProgress = MAX(MIN(progress, 1.0f), 0.0f);
self.animated = animate;
if (progress==0.0) {
//means reset been tapped
self.shapeLayer.speed=1;
}
[self setNeedsLayout];
}
- (void)setProgress:(CGFloat)progress duration:(CFTimeInterval)duration
{
self.duration = duration;
[self setProgress:progress animated:YES];
}
#pragma mark pause/resume
-(void)pause
{
if (self.currentProgress !=0) {
CFTimeInterval pausedTime = [self.shapeLayer convertTime:CACurrentMediaTime() fromLayer:nil];
self.shapeLayer.speed = 0.0;
self.shapeLayer.timeOffset = pausedTime;
}
}
-(void)resume
{
if (self.shapeLayer.speed==0) {
CFTimeInterval pausedTime = [self.shapeLayer timeOffset];
self.shapeLayer.speed = 1.0;
self.shapeLayer.timeOffset = 0.0;
self.shapeLayer.beginTime = 0.0;
CFTimeInterval timeSincePause = [self.shapeLayer convertTime:CACurrentMediaTime() fromLayer:nil] - pausedTime;
self.shapeLayer.beginTime = timeSincePause;
}
}
@end
@@ -0,0 +1,22 @@
//
// HomeMainView.h
// ManagerDemo
//
// Created by xmfish on 14-8-11.
// Copyright (c) 2014年 ash. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "MRCircularProgressView.h"
@interface HomeMainView : UIView
@property (weak, nonatomic) IBOutlet UILabel *typeLabel;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet MRCircularProgressView *percentView;
- (IBAction)percentBtnClick:(id)sender;
@property (weak, nonatomic) IBOutlet DTAttributedLabel *percentLabel;
@property (weak, nonatomic) IBOutlet DTAttributedLabel *expectLabel;
@property (weak, nonatomic) IBOutlet DTAttributedLabel *timeLabel;
@property (weak, nonatomic) IBOutlet UILabel *infoLabel;
- (IBAction)sureBtnClick:(id)sender;
@end
@@ -0,0 +1,88 @@
//
// HomeMainView.m
// ManagerDemo
//
// Created by xmfish on 14-8-11.
// Copyright (c) 2014年 ash. All rights reserved.
//
#import "HomeMainView.h"
@implementation HomeMainView
{
CGFloat progressPercent;
}
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
// Initialization code
}
return self;
}
-(void)awakeFromNib{
[super awakeFromNib];
}
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
// Drawing code
progressPercent = 0.33;
//进度条
_percentView.delegate = self;
_percentView.wrapperColor = [UIColor clearColor];
_percentView.progressColor = [UIColor redColor];
_percentView.progressArcWidth = 10.0f;
[_percentView setProgress:progressPercent duration:1.0];
//
_typeLabel.transform = CGAffineTransformMakeRotation( M_PI/4 );
//中间文字
NSString* htmlStr = @"<span style=\"font-size:40px; color:red; text-align:center; \">9</span>%";
NSData *data = [htmlStr dataUsingEncoding:NSUTF8StringEncoding];
NSDictionary* optionsDic = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:kCTTextAlignmentCenter],DTDefaultTextAlignment, nil];
NSAttributedString *percentString = [[NSAttributedString alloc] initWithHTMLData:data options:optionsDic documentAttributes:nil];
_percentLabel.attributedString = percentString;
//预期
htmlStr = @"<span style=\"font-size:11px;text-align:center; \">四个大字<span style=\"font-size:13px; color:red;\">10.20%</span></span>";
data = [htmlStr dataUsingEncoding:NSUTF8StringEncoding];
percentString = [[NSAttributedString alloc] initWithHTMLData:data documentAttributes:NULL];
_expectLabel.attributedString = percentString;
//时间
htmlStr = [NSString stringWithFormat:@"<span style=\"font-size:11px;text-align:center; \">限<span style=\"font-size:13px; color:red;\">%d</span>个月<span style=\"font-size:13px; color:red;\">%d</span>起</span>",15,50];
data = [htmlStr dataUsingEncoding:NSUTF8StringEncoding];
percentString = [[NSAttributedString alloc] initWithHTMLData:data documentAttributes:NULL];
_timeLabel.attributedString = percentString;
}
- (IBAction)percentBtnClick:(id)sender {
DLog("首页点击");
[_percentView setProgress:0.00 animated:YES];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_SEC*0.2),
dispatch_get_main_queue(), ^(){
[_percentView setProgress:progressPercent duration:1.0];
});
}
- (IBAction)sureBtnClick:(id)sender {
DLog(@"确认");
}
#pragma mark - CABasicAnimationDelegate
- (void)animationDidStart:(CAAnimation *)theAnimation
{
DLog(@"Animation started");
}
- (void)animationDidStop:(CAAnimation *)theAnimation finished:(BOOL)flag
{
DLog(@"Animation stopped");
}
@end
@@ -0,0 +1,122 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="4514" systemVersion="13E28" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3746"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="7ik-6g-4aB" customClass="HomeMainView">
<rect key="frame" x="0.0" y="0.0" width="280" height="295"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="r0t-sm-d8w" customClass="MRCircularProgressView">
<rect key="frame" x="78" y="46" width="125" height="125"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" placeholderIntrinsicWidth="118" placeholderIntrinsicHeight="118" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="TJP-Gm-InT">
<rect key="frame" x="81" y="49" width="118" height="118"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" image="pie_chart_center.png">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="percentBtnClick:" destination="7ik-6g-4aB" eventType="touchUpInside" id="D8X-3U-Zz0"/>
</connections>
</button>
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="bkz-1X-k90" customClass="DTAttributedLabel">
<rect key="frame" x="109" y="84" width="63" height="47"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="bottom" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="点我你就会变超人" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="iR9-8X-qqa">
<rect key="frame" x="3" y="-6" width="200" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="19"/>
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
<color key="shadowColor" red="0.981644611" green="0.981644611" blue="0.981644611" alpha="1" colorSpace="calibratedRGB"/>
<size key="shadowOffset" width="1" height="1"/>
</label>
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="KFi-f6-ETu">
<rect key="frame" x="240" y="0.0" width="40" height="40"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="fund_cell_label_bg_blue.png" translatesAutoresizingMaskIntoConstraints="NO" id="Obj-JA-SBo">
<rect key="frame" x="0.0" y="0.0" width="40" height="40"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" placeholderIntrinsicWidth="42" placeholderIntrinsicHeight="21" text="新手" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1tT-kO-DcP">
<rect key="frame" x="0.0" y="-9" width="42" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<rect key="contentStretch" x="1" y="1" width="1" height="1"/>
<fontDescription key="fontDescription" name="HelveticaNeue" family="Helvetica Neue" pointSize="14"/>
<nil key="highlightedColor"/>
<size key="shadowOffset" width="0.0" height="0.0"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="bMf-HX-BVn" customClass="DTAttributedLabel">
<rect key="frame" x="3" y="181" width="130" height="20"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="yOO-QQ-AEi" customClass="DTAttributedLabel">
<rect key="frame" x="150" y="181" width="130" height="20"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Igx-ly-iLf">
<rect key="frame" x="141" y="181" width="1" height="20"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
</view>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="额外送你20快钱" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="kkT-GU-Uxk">
<rect key="frame" x="11" y="209" width="260" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" red="1" green="0.37822147690000002" blue="0.16647340829999999" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="b3g-Qg-i3k">
<rect key="frame" x="0.0" y="231" width="280" height="44"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.79962531889999999" green="0.18166188729999999" blue="0.1209349611" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<state key="normal" title="点击">
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="sureBtnClick:" destination="7ik-6g-4aB" eventType="touchUpInside" id="EqN-bW-UPj"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="bXv-dI-unZ">
<rect key="frame" x="81" y="49" width="118" height="118"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="percentBtnClick:" destination="7ik-6g-4aB" eventType="touchUpInside" id="su9-hl-na1"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<connections>
<outlet property="expectLabel" destination="bMf-HX-BVn" id="HN2-oi-JmM"/>
<outlet property="infoLabel" destination="kkT-GU-Uxk" id="1tG-93-QzH"/>
<outlet property="nameLabel" destination="iR9-8X-qqa" id="ket-0J-7Id"/>
<outlet property="percentLabel" destination="bkz-1X-k90" id="Kto-ze-01o"/>
<outlet property="percentView" destination="r0t-sm-d8w" id="ncm-g1-PfS"/>
<outlet property="timeLabel" destination="yOO-QQ-AEi" id="hJv-z0-5nv"/>
<outlet property="typeLabel" destination="1tT-kO-DcP" id="CMf-iF-RqM"/>
</connections>
</view>
</objects>
<resources>
<image name="fund_cell_label_bg_blue.png" width="38" height="40"/>
<image name="pie_chart_center.png" width="235" height="235"/>
</resources>
</document>
@@ -9,6 +9,7 @@
#import "HomeViewController.h" #import "HomeViewController.h"
#import "MJRefresh.h" #import "MJRefresh.h"
#import "HomeAdView.h" #import "HomeAdView.h"
#import "HomeMainView.h"
@interface HomeViewController () @interface HomeViewController ()
@end @end
@@ -77,11 +78,23 @@
return 1; return 1;
} }
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return 1; return 2;
} }
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{ {
return 120; CGFloat height = 0.0;
switch (indexPath.row) {
case 0:
height = 160.0;
break;
case 1:
height = 280.0;
break;
default:
break;
}
return height;
} }
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath -(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{ {
@@ -89,9 +102,26 @@
UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:homeViewCell]; UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:homeViewCell];
if (cell == nil) { if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:homeViewCell]; cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:homeViewCell];
HomeAdView* homeAdView = [[HomeAdView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, 120)]; cell.selectionStyle = UITableViewCellSelectionStyleNone;
switch (indexPath.row) {
case 0:{
HomeAdView* homeAdView = [[HomeAdView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, 140)];
[cell addSubview:homeAdView]; [cell addSubview:homeAdView];
} }
break;
case 1:{
NSArray *nib=[[NSBundle mainBundle]loadNibNamed:@"HomeMainView" owner:self options:nil];
HomeMainView* homeMainView = (HomeMainView*)[nib objectAtIndex:0];
CGRect frame = homeMainView.frame;
frame.origin.x = 20;
homeMainView.frame = frame;
[cell addSubview:homeMainView];
}
default:
break;
}
}
return cell; return cell;
} }
+1
View File
@@ -15,5 +15,6 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import "ManagerConstants.h" #import "ManagerConstants.h"
#import "MKNetworkKit.h" #import "MKNetworkKit.h"
#import "DTCoreText.h"
#import "STableViewController.h" #import "STableViewController.h"
#endif #endif
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB