Commit 02b18eee43a78152e5281521db089c3dc2fec3e1

Authored by yanglingyu
1 parent 4396e1dc

下啦刷新调整

CNLiveVideoClassifyKit.podspec
@@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
8 8
9 Pod::Spec.new do |s| 9 Pod::Spec.new do |s|
10 s.name = 'CNLiveVideoClassifyKit' 10 s.name = 'CNLiveVideoClassifyKit'
11 - s.version = '0.0.36' 11 + s.version = '0.0.37'
12 s.summary = '视讯头部一二级菜单组件' 12 s.summary = '视讯头部一二级菜单组件'
13 13
14 # This description is used to generate tags and improve search results. 14 # This description is used to generate tags and improve search results.
CNLiveVideoClassifyKit/Classes/ClassifyCategory/Controller/CNLiveListController.m
@@ -139,6 +139,9 @@ @@ -139,6 +139,9 @@
139 NSValue *newValue = change[NSKeyValueChangeNewKey]; 139 NSValue *newValue = change[NSKeyValueChangeNewKey];
140 CGFloat contentPointY = newValue.UIOffsetValue.vertical; 140 CGFloat contentPointY = newValue.UIOffsetValue.vertical;
141 self.contentOffetY = contentPointY; 141 self.contentOffetY = contentPointY;
  142 + if (contentPointY < 0) {
  143 + [[CNLiveListManager shareListManager] dragDown:-contentPointY];
  144 + }
142 return; 145 return;
143 } 146 }
144 UIScrollView *scrollView = object; 147 UIScrollView *scrollView = object;
CNLiveVideoClassifyKit/Classes/ClassifyCategory/Controller/CNLiveSubSegmentController.m
@@ -11,6 +11,9 @@ @@ -11,6 +11,9 @@
11 #import "CNLiveListController.h" 11 #import "CNLiveListController.h"
12 12
13 @interface CNLiveSubSegmentController () 13 @interface CNLiveSubSegmentController ()
  14 +{
  15 + CGFloat _bgImageheight;
  16 +}
14 @property (nonatomic, strong)JXCategoryTitleView *myCategoryView; 17 @property (nonatomic, strong)JXCategoryTitleView *myCategoryView;
15 18
16 @property (nonatomic, strong) CNLiveNavigationBar *navigationBar; 19 @property (nonatomic, strong) CNLiveNavigationBar *navigationBar;
@@ -65,17 +68,18 @@ @@ -65,17 +68,18 @@
65 self.title = model.showName; 68 self.title = model.showName;
66 self.ld_currentIndex = 0; 69 self.ld_currentIndex = 0;
67 self.selectChannelId = -1; 70 self.selectChannelId = -1;
  71 + self->_bgImageheight = 100;
68 } 72 }
69 return self; 73 return self;
70 } 74 }
71 75
72 - (void)viewDidLoad { 76 - (void)viewDidLoad {
73 [super viewDidLoad]; 77 [super viewDidLoad];
74 - 78 + [self.view addSubview:self.bgImgView];
  79 + [self.view sendSubviewToBack:self.bgImgView];
75 if (!CNLiveStringIsEmpty(self.backImageH5)) { 80 if (!CNLiveStringIsEmpty(self.backImageH5)) {
76 // 如果后台传了背景图 就设置背景图 81 // 如果后台传了背景图 就设置背景图
77 - [self.view addSubview:self.bgImgView];  
78 - [self.view sendSubviewToBack:self.bgImgView]; 82 +
79 weakself 83 weakself
80 [self.bgImgView sd_setImageWithURL:[NSURL URLWithString:self.backImageH5] completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) { 84 [self.bgImgView sd_setImageWithURL:[NSURL URLWithString:self.backImageH5] completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
81 if (image) { 85 if (image) {
@@ -84,8 +88,14 @@ @@ -84,8 +88,14 @@
84 }else{ 88 }else{
85 weakSelf.bgImgView.height = KScreenWidth*image.size.height/image.size.width; 89 weakSelf.bgImgView.height = KScreenWidth*image.size.height/image.size.width;
86 } 90 }
  91 + self->_bgImageheight = weakSelf.bgImgView.height;
87 } 92 }
88 }]; 93 }];
  94 + }else
  95 + {
  96 + if (CNLiveStringIsEmpty(self.backImage)) {
  97 + self.bgImgView.backgroundColor = CNLiveColorWithHexString(self.backgroundColor);
  98 + }
89 } 99 }
90 [self handleDateWithChannelsArray]; 100 [self handleDateWithChannelsArray];
91 if ([CNWebRedirectHandle manager].isClickedIntegral) { 101 if ([CNWebRedirectHandle manager].isClickedIntegral) {
@@ -109,9 +119,6 @@ @@ -109,9 +119,6 @@
109 119
110 self.view.backgroundColor = [UIColor clearColor]; 120 self.view.backgroundColor = [UIColor clearColor];
111 self.myCategoryView.titles = self.titles; 121 self.myCategoryView.titles = self.titles;
112 - if (CNLiveStringIsEmpty(self.backImage)) {  
113 - self.view.backgroundColor = CNLiveColorWithHexString(self.backgroundColor);  
114 - }  
115 self.myCategoryView.titleColor = self.textColor; 122 self.myCategoryView.titleColor = self.textColor;
116 self.myCategoryView.titleSelectedColor = self.textColor; 123 self.myCategoryView.titleSelectedColor = self.textColor;
117 self.myCategoryView.cellSpacing = 32; 124 self.myCategoryView.cellSpacing = 32;
@@ -174,6 +181,16 @@ @@ -174,6 +181,16 @@
174 [CNLiveListManager shareListManager].scrollViewDidScrollBlock = ^(BOOL isUp) { 181 [CNLiveListManager shareListManager].scrollViewDidScrollBlock = ^(BOOL isUp) {
175 !weakSelf.scrollViewDidScrollBlock ?: weakSelf.scrollViewDidScrollBlock(isUp); 182 !weakSelf.scrollViewDidScrollBlock ?: weakSelf.scrollViewDidScrollBlock(isUp);
176 }; 183 };
  184 + [CNLiveListManager shareListManager].scrollViewDown = ^(CGFloat contentY) {
  185 + if (contentY > self->_bgImageheight) {
  186 + CGFloat wH = weakSelf.bgImgView.width/weakSelf.bgImgView.height;
  187 + weakSelf.bgImgView.height = contentY;
  188 + weakSelf.bgImgView.width = contentY * wH;
  189 + }else{
  190 + weakSelf.bgImgView.width = self.view.width;
  191 + weakSelf.bgImgView.height = self -> _bgImageheight;
  192 + }
  193 + };
177 }else{ 194 }else{
178 [self.view addSubview:self.navigationBar]; 195 [self.view addSubview:self.navigationBar];
179 self.bgImgView.top = 0; 196 self.bgImgView.top = 0;
@@ -363,6 +380,7 @@ @@ -363,6 +380,7 @@
363 }else{ 380 }else{
364 weakSelf.bgImgView.height = KScreenWidth*image.size.height/image.size.width; 381 weakSelf.bgImgView.height = KScreenWidth*image.size.height/image.size.width;
365 } 382 }
  383 + self->_bgImageheight = weakSelf.bgImgView.height;
366 } 384 }
367 }]; 385 }];
368 CNCategoryGetChannelModel *model = (CNCategoryGetChannelModel *)[self.pageListArr wjj_safetyObjectAtIndex:self.ld_currentIndex]; 386 CNCategoryGetChannelModel *model = (CNCategoryGetChannelModel *)[self.pageListArr wjj_safetyObjectAtIndex:self.ld_currentIndex];
@@ -570,6 +588,7 @@ @@ -570,6 +588,7 @@
570 }else{ 588 }else{
571 weakSelf.bgImgView.height = KScreenWidth*image.size.height/image.size.width; 589 weakSelf.bgImgView.height = KScreenWidth*image.size.height/image.size.width;
572 } 590 }
  591 + self->_bgImageheight = weakSelf.bgImgView.height;
573 } 592 }
574 }]; 593 }];
575 } 594 }
@@ -580,7 +599,7 @@ @@ -580,7 +599,7 @@
580 } 599 }
581 - (UIImageView *)bgImgView { 600 - (UIImageView *)bgImgView {
582 if (!_bgImgView) { 601 if (!_bgImgView) {
583 - _bgImgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 50, KScreenWidth, self.view.height-50)]; 602 + _bgImgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 50, KScreenWidth, 100)];
584 _bgImgView.backgroundColor = kWhiteColor; 603 _bgImgView.backgroundColor = kWhiteColor;
585 } 604 }
586 return _bgImgView; 605 return _bgImgView;
CNLiveVideoClassifyKit/Classes/ClassifyCategory/Manager/CNLiveListManager.h
@@ -11,11 +11,15 @@ NS_ASSUME_NONNULL_BEGIN @@ -11,11 +11,15 @@ NS_ASSUME_NONNULL_BEGIN
11 11
12 @interface CNLiveListManager : NSObject 12 @interface CNLiveListManager : NSObject
13 @property (nonatomic, copy) void (^scrollViewDidScrollBlock)(BOOL isUp); 13 @property (nonatomic, copy) void (^scrollViewDidScrollBlock)(BOOL isUp);
  14 +@property (nonatomic, copy) void (^scrollViewDown)(CGFloat contentY);
14 @property (nonatomic, assign) BOOL isHiddenFirst; 15 @property (nonatomic, assign) BOOL isHiddenFirst;
15 16
16 +(instancetype)shareListManager; 17 +(instancetype)shareListManager;
17 //第一分类是否隐藏:yes为隐藏 18 //第一分类是否隐藏:yes为隐藏
18 - (void)firstHeaderUp:(BOOL)isUp; 19 - (void)firstHeaderUp:(BOOL)isUp;
  20 +
  21 +//下拉高度
  22 +- (void)dragDown:(CGFloat) contentY;
19 //创建分类控制器 23 //创建分类控制器
20 + (CNCategoryBaseViewController *)CNCategoryBaseViewController; 24 + (CNCategoryBaseViewController *)CNCategoryBaseViewController;
21 @end 25 @end
CNLiveVideoClassifyKit/Classes/ClassifyCategory/Manager/CNLiveListManager.m
@@ -44,4 +44,8 @@ @@ -44,4 +44,8 @@
44 _isHiddenFirst = isHiddenFirst; 44 _isHiddenFirst = isHiddenFirst;
45 !self.scrollViewDidScrollBlock ?: self.scrollViewDidScrollBlock(isHiddenFirst); 45 !self.scrollViewDidScrollBlock ?: self.scrollViewDidScrollBlock(isHiddenFirst);
46 } 46 }
  47 +
  48 +- (void)dragDown:(CGFloat) contentY{
  49 + !self.scrollViewDown ?: self.scrollViewDown(contentY);
  50 +}
47 @end 51 @end
Example/CNLiveVideoClassifyKit/CNLIVEAppDelegate.m
@@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
13 13
14 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
15 { 15 {
16 - [CNLiveEnvironmentManager setEnvironment:CNLiveProductionAppStore];//CNLiveDebugAppStore];//CNLiveProductionAppStore//CNLiveTestFlight 16 + [CNLiveEnvironmentManager setEnvironment:CNLiveDebugAppStore];//CNLiveDebugAppStore];//CNLiveProductionAppStore//CNLiveTestFlight
17 // Override point for customization after application launch. 17 // Override point for customization after application launch.
18 return YES; 18 return YES;
19 } 19 }
Example/Podfile.lock
@@ -43,20 +43,20 @@ PODS: @@ -43,20 +43,20 @@ PODS:
43 - CNLiveNewTripartiteManagement/QMUIKit 43 - CNLiveNewTripartiteManagement/QMUIKit
44 - CNLiveRequestBastKit 44 - CNLiveRequestBastKit
45 - CNLiveUserManagement 45 - CNLiveUserManagement
46 - - CNLiveBusinessTools (0.1.27): 46 + - CNLiveBusinessTools (0.1.31):
47 - CNLiveBaseKit 47 - CNLiveBaseKit
48 - CNLiveEnvironment 48 - CNLiveEnvironment
49 - CNLiveNewTripartiteManagement/QMUIKit 49 - CNLiveNewTripartiteManagement/QMUIKit
  50 + - CNLiveNewTripartiteManagement/YYAsyncLayer
50 - CNLiveNewTripartiteManagement/YYCache 51 - CNLiveNewTripartiteManagement/YYCache
  52 + - CNLiveNewTripartiteManagement/YYCategories
  53 + - CNLiveNewTripartiteManagement/YYDispatchQueuePool
51 - CNLiveNewTripartiteManagement/YYImage 54 - CNLiveNewTripartiteManagement/YYImage
52 - CNLiveNewTripartiteManagement/YYModel 55 - CNLiveNewTripartiteManagement/YYModel
53 - CNLiveNewTripartiteManagement/YYText 56 - CNLiveNewTripartiteManagement/YYText
54 - CNLiveNewTripartiteManagement/YYWebImage 57 - CNLiveNewTripartiteManagement/YYWebImage
55 - CNLiveRequestBastKit 58 - CNLiveRequestBastKit
56 - CNLiveUserManagement 59 - CNLiveUserManagement
57 - - YYAsyncLayer  
58 - - YYCategories  
59 - - YYDispatchQueuePool  
60 - CNLiveCategory (0.0.2): 60 - CNLiveCategory (0.0.2):
61 - CNLiveCategory/Object (= 0.0.2) 61 - CNLiveCategory/Object (= 0.0.2)
62 - CNLiveCategory/Object (0.0.2) 62 - CNLiveCategory/Object (0.0.2)
@@ -118,17 +118,16 @@ PODS: @@ -118,17 +118,16 @@ PODS:
118 - CNLiveBusinessTools 118 - CNLiveBusinessTools
119 - CNLiveCustomUI/CNLiveGetImage 119 - CNLiveCustomUI/CNLiveGetImage
120 - CNLiveNewTripartiteManagement/MJRefresh 120 - CNLiveNewTripartiteManagement/MJRefresh
121 - - CNLiveCWebViewModule (0.1.2): 121 + - CNLiveCWebViewModule (0.2.1):
122 - CNLiveCustomUI 122 - CNLiveCustomUI
123 - CNLiveEnvironment 123 - CNLiveEnvironment
124 - CNLiveNewTripartiteManagement/Masonry 124 - CNLiveNewTripartiteManagement/Masonry
125 - - CNLiveNewTripartiteManagement/QMUIKit  
126 - CNLiveNewTripartiteManagement/YYText 125 - CNLiveNewTripartiteManagement/YYText
127 - CNLiveRequestBastKit 126 - CNLiveRequestBastKit
128 - CNLiveSDK/CNLiveStat 127 - CNLiveSDK/CNLiveStat
129 - CNLiveUserManagement 128 - CNLiveUserManagement
130 - WebViewJavascriptBridge 129 - WebViewJavascriptBridge
131 - - CNLiveEnvironment (0.3.3) 130 + - CNLiveEnvironment (0.3.4)
132 - CNLiveNewTripartiteManagement/Masonry (0.2.0.6): 131 - CNLiveNewTripartiteManagement/Masonry (0.2.0.6):
133 - Masonry (= 1.1.0) 132 - Masonry (= 1.1.0)
134 - CNLiveNewTripartiteManagement/MJExtension (0.2.0.6): 133 - CNLiveNewTripartiteManagement/MJExtension (0.2.0.6):
@@ -162,7 +161,7 @@ PODS: @@ -162,7 +161,7 @@ PODS:
162 - CNLiveSDK/CNLiveStat (0.3.4.8) 161 - CNLiveSDK/CNLiveStat (0.3.4.8)
163 - CNLiveUserManagement (0.1.5): 162 - CNLiveUserManagement (0.1.5):
164 - CNLiveNewTripartiteManagement/MJExtension 163 - CNLiveNewTripartiteManagement/MJExtension
165 - - CNLiveVideoClassifyKit (0.0.31): 164 + - CNLiveVideoClassifyKit (0.0.36):
166 - CNLiveBaseKit 165 - CNLiveBaseKit
167 - CNLiveBeeHive 166 - CNLiveBeeHive
168 - CNLiveBusinessBaseModule 167 - CNLiveBusinessBaseModule
@@ -505,11 +504,11 @@ PODS: @@ -505,11 +504,11 @@ PODS:
505 - SDWebImage (5.2.3): 504 - SDWebImage (5.2.3):
506 - SDWebImage/Core (= 5.2.3) 505 - SDWebImage/Core (= 5.2.3)
507 - SDWebImage/Core (5.2.3) 506 - SDWebImage/Core (5.2.3)
508 - - UMAPM (1.5.5) 507 + - UMAPM (1.5.6)
509 - UMCCommon (7.3.5): 508 - UMCCommon (7.3.5):
510 - UMAPM 509 - UMAPM
511 - UMDevice 510 - UMDevice
512 - - UMDevice (2.0.5) 511 + - UMDevice (2.1.0)
513 - WebViewJavascriptBridge (6.0.3) 512 - WebViewJavascriptBridge (6.0.3)
514 - YYAsyncLayer (1.0) 513 - YYAsyncLayer (1.0)
515 - YYCache (1.0.4) 514 - YYCache (1.0.4)
@@ -584,18 +583,18 @@ SPEC CHECKSUMS: @@ -584,18 +583,18 @@ SPEC CHECKSUMS:
584 CNLiveBeeHive: 1e105b15b6ccaad546258fcf91231563beb853d4 583 CNLiveBeeHive: 1e105b15b6ccaad546258fcf91231563beb853d4
585 CNLiveBServices: 747c8c6c8d300c4daaeb108027c5886c66ed02ce 584 CNLiveBServices: 747c8c6c8d300c4daaeb108027c5886c66ed02ce
586 CNLiveBusinessBaseModule: 1d2eee2e04c8db762781b7ad45278d043db56748 585 CNLiveBusinessBaseModule: 1d2eee2e04c8db762781b7ad45278d043db56748
587 - CNLiveBusinessTools: dfd3270d885523be2599bdc3a95a416277682d0d 586 + CNLiveBusinessTools: 3cb2335316d1a330a179ea11151db0d5c203adb4
588 CNLiveCategory: c90a01af1e20cd89f47d4f551d47d2ddc9ca96f3 587 CNLiveCategory: c90a01af1e20cd89f47d4f551d47d2ddc9ca96f3
589 CNLiveCommonCategory: 22c9842b31f2087803ae69e983b2c944fb80eae1 588 CNLiveCommonCategory: 22c9842b31f2087803ae69e983b2c944fb80eae1
590 CNLiveCustomControl: a692e47171afb799cebc210a8e77c5a4ddfc2099 589 CNLiveCustomControl: a692e47171afb799cebc210a8e77c5a4ddfc2099
591 CNLiveCustomUI: b704f07f5f734e45c06bda1877e67b5f9e5d3581 590 CNLiveCustomUI: b704f07f5f734e45c06bda1877e67b5f9e5d3581
592 - CNLiveCWebViewModule: 1af1e2853cc1203dacad5a66e8215e62ede2bfc9  
593 - CNLiveEnvironment: 6af0a2f332b704ffdec67106b4ba044c7f8da371 591 + CNLiveCWebViewModule: 97d40b79c45b026f72d83bf2f6501912a1148572
  592 + CNLiveEnvironment: 48ba0f934399fd25fc54dc3239009754bcc1ddb3
594 CNLiveNewTripartiteManagement: 29ddb2d23ee77bcd42ba5eaf5f1322ed37db5baa 593 CNLiveNewTripartiteManagement: 29ddb2d23ee77bcd42ba5eaf5f1322ed37db5baa
595 CNLiveRequestBastKit: 9fe28913b94a0a072298eba3356f17b98ef0b6cd 594 CNLiveRequestBastKit: 9fe28913b94a0a072298eba3356f17b98ef0b6cd
596 CNLiveSDK: 75bafaafbb8c09dcb4420adfe0f05130405b25e7 595 CNLiveSDK: 75bafaafbb8c09dcb4420adfe0f05130405b25e7
597 CNLiveUserManagement: ead053f2d701b01ea8fb5f1da572be788f2dd3cf 596 CNLiveUserManagement: ead053f2d701b01ea8fb5f1da572be788f2dd3cf
598 - CNLiveVideoClassifyKit: d36f2503ac8103369634f70f53df3ccc7b9a84d1 597 + CNLiveVideoClassifyKit: 2b21a4818b6712b9dd1703381777096a1315c670
599 FWDebug: 5a20d089a300517153de1438d8128ad4c4690951 598 FWDebug: 5a20d089a300517153de1438d8128ad4c4690951
600 JXCategoryView: 2ef9ecfd3735158d009ce02d1f29811aa822da65 599 JXCategoryView: 2ef9ecfd3735158d009ce02d1f29811aa822da65
601 Masonry: 678fab65091a9290e40e2832a55e7ab731aad201 600 Masonry: 678fab65091a9290e40e2832a55e7ab731aad201
@@ -603,9 +602,9 @@ SPEC CHECKSUMS: @@ -603,9 +602,9 @@ SPEC CHECKSUMS:
603 MJRefresh: ed450d6eb9d3346a2cb033ab7eb6de090aeef437 602 MJRefresh: ed450d6eb9d3346a2cb033ab7eb6de090aeef437
604 QMUIKit: 15294d6a350466e4a6f4df0333eac5bff474f995 603 QMUIKit: 15294d6a350466e4a6f4df0333eac5bff474f995
605 SDWebImage: 46a7f73228f84ce80990c786e4372cf4db5875ce 604 SDWebImage: 46a7f73228f84ce80990c786e4372cf4db5875ce
606 - UMAPM: 1ab13287a2b05c1d491009321270daddf5659a74 605 + UMAPM: 5ab988b8bedfd090ee2307cb80530ba79b8ac264
607 UMCCommon: 3c535e9e3958f72df075cc6fe4776fb5e403c8bc 606 UMCCommon: 3c535e9e3958f72df075cc6fe4776fb5e403c8bc
608 - UMDevice: c13bbb2e8ca6c67d1e23e03162553e3ec5a8b5b0 607 + UMDevice: 04948a92184e8d25f1369b635dff5490c1f063e0
609 WebViewJavascriptBridge: 7f5bc4d3581e672e8f32bd0f812d54bc69bb8e29 608 WebViewJavascriptBridge: 7f5bc4d3581e672e8f32bd0f812d54bc69bb8e29
610 YYAsyncLayer: df6b01ebc695c5f6b4c15dd5c23fa3e081eb25c0 609 YYAsyncLayer: df6b01ebc695c5f6b4c15dd5c23fa3e081eb25c0
611 YYCache: 8105b6638f5e849296c71f331ff83891a4942952 610 YYCache: 8105b6638f5e849296c71f331ff83891a4942952