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