Commit 8a05a1a89d7e680b4717ee3b42131eb8d52c2faa
1 parent
a08a9751
no message
Showing
5 changed files
with
78 additions
and
45 deletions
CNLiveVideoClassifyKit.podspec
| ... | ... | @@ -29,6 +29,7 @@ TODO: Add long description of the pod here. |
| 29 | 29 | # s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>' |
| 30 | 30 | |
| 31 | 31 | s.ios.deployment_target = '10.0' |
| 32 | + s.pod_target_xcconfig = { 'VALID_ARCHS' => 'x86_64 armv7 arm64' } | |
| 32 | 33 | |
| 33 | 34 | s.source_files = 'CNLiveVideoClassifyKit/Classes/**/*' |
| 34 | 35 | |
| ... | ... | @@ -36,9 +37,8 @@ TODO: Add long description of the pod here. |
| 36 | 37 | # s.resource_bundles = { |
| 37 | 38 | # 'CNLiveVideoClassifyKit' => ['CNLiveVideoClassifyKit/Assets/CNSegmentControl.bundle'] |
| 38 | 39 | # } |
| 39 | - s.prefix_header_contents = '#import "CNLivevideoClassifyPCH.h"' | |
| 40 | - s.public_header_files = 'Pod/Classes/**/*.h' | |
| 41 | -# s.static_framework = true | |
| 40 | + s.prefix_header_contents = '#import "CNLivevideoClassifyPCH.h"' | |
| 41 | + s.static_framework = true | |
| 42 | 42 | s.frameworks = 'UIKit', 'MapKit' |
| 43 | 43 | s.dependency 'JXCategoryView' |
| 44 | 44 | s.dependency 'CNLiveTripartiteManagement/MJExtension' | ... | ... |
CNLiveVideoClassifyKit/Classes/Controller/CNLiveClassifySegmentController.m
| ... | ... | @@ -73,12 +73,6 @@ static CGFloat moveHeight = 50; |
| 73 | 73 | [self.view sendSubviewToBack:self.topBgImg]; |
| 74 | 74 | [self dataDivideIntoNormalAndOtherWithFirst:YES]; |
| 75 | 75 | [self handleDateWithChannelsArray]; |
| 76 | - if ([CNUserShareManager isLogin]) { | |
| 77 | - [self.view addSubview:self.customChannelsBtn]; | |
| 78 | - }else | |
| 79 | - { | |
| 80 | - [self.view addSubview:self.loginBtn]; | |
| 81 | - } | |
| 82 | 76 | |
| 83 | 77 | self.myCategoryView.translatesAutoresizingMaskIntoConstraints = NO; |
| 84 | 78 | self.myCategoryView.titleColorGradientEnabled = YES; |
| ... | ... | @@ -169,6 +163,12 @@ static CGFloat moveHeight = 50; |
| 169 | 163 | [self categoryView:self.myCategoryView didSelectedItemAtIndex:self.ld_currentIndex]; |
| 170 | 164 | } |
| 171 | 165 | } |
| 166 | + if ([CNUserShareManager isLogin]) { | |
| 167 | + [self.view addSubview:self.customChannelsBtn]; | |
| 168 | + }else | |
| 169 | + { | |
| 170 | + [self.view addSubview:self.loginBtn]; | |
| 171 | + } | |
| 172 | 172 | // Do any additional setup after loading the view. |
| 173 | 173 | } |
| 174 | 174 | -(void)viewWillAppear:(BOOL)animated { |
| ... | ... | @@ -207,12 +207,12 @@ static CGFloat moveHeight = 50; |
| 207 | 207 | self.pageViewController.view.frame = CGRectMake(0, self.myCategoryView.bottom, kScreenWidth, self.view.bounds.size.height - self.myCategoryView.bottom+ moveHeight); |
| 208 | 208 | if ([CNUserShareManager isLogin]) { |
| 209 | 209 | self.myCategoryView.width = kScreenWidth - 45; |
| 210 | - self.customChannelsBtn.centerY = self.myCategoryView.height/2 + kStatusHeight; | |
| 210 | + self.customChannelsBtn.centerY = [self preferredCategoryViewHeight]/2 + kStatusHeight; | |
| 211 | 211 | self.customChannelsBtn.right = kScreenWidth - 18; |
| 212 | 212 | }else |
| 213 | 213 | { |
| 214 | 214 | self.myCategoryView.width = kScreenWidth - 70; |
| 215 | - self.loginBtn.centerY = self.myCategoryView.height/2 + kStatusHeight; | |
| 215 | + self.loginBtn.centerY = [self preferredCategoryViewHeight]/2 + kStatusHeight; | |
| 216 | 216 | self.loginBtn.right = kScreenWidth - 11; |
| 217 | 217 | } |
| 218 | 218 | |
| ... | ... | @@ -653,6 +653,10 @@ static CGFloat moveHeight = 50; |
| 653 | 653 | } |
| 654 | 654 | -(void)scrollViewUpDowm:(BOOL)isUp |
| 655 | 655 | { |
| 656 | + if (isUp != self.findScrollView.isScrollEnabled) { | |
| 657 | + return; | |
| 658 | + } | |
| 659 | + self.findScrollView.scrollEnabled = !isUp; | |
| 656 | 660 | [UIView animateWithDuration:0.3 animations:^{ |
| 657 | 661 | if (isUp) { |
| 658 | 662 | [self scrollViewUp]; |
| ... | ... | @@ -664,10 +668,6 @@ static CGFloat moveHeight = 50; |
| 664 | 668 | } |
| 665 | 669 | |
| 666 | 670 | -(void)scrollViewUp{ |
| 667 | - if (self.topBgImg.top<0) { | |
| 668 | - return; | |
| 669 | - } | |
| 670 | - [self managerScrollView:YES]; | |
| 671 | 671 | self.topBgImg.top -= moveHeight; |
| 672 | 672 | self.myCategoryView.collectionView.top = -50-kStatusHeight; |
| 673 | 673 | self.pageViewController.view.top = kStatusHeight; |
| ... | ... | @@ -679,10 +679,6 @@ static CGFloat moveHeight = 50; |
| 679 | 679 | } |
| 680 | 680 | } |
| 681 | 681 | -(void)scrollViewDown{ |
| 682 | - if (self.topBgImg.top==0) { | |
| 683 | - return; | |
| 684 | - } | |
| 685 | - [self managerScrollView:NO]; | |
| 686 | 682 | self.topBgImg.top += moveHeight; |
| 687 | 683 | self.myCategoryView.collectionView.top = 0; |
| 688 | 684 | self.pageViewController.view.top = self.myCategoryView.bottom; |
| ... | ... | @@ -694,14 +690,6 @@ static CGFloat moveHeight = 50; |
| 694 | 690 | } |
| 695 | 691 | } |
| 696 | 692 | |
| 697 | --(void)managerScrollView:(BOOL)enabled | |
| 698 | -{ | |
| 699 | - self.findScrollView.scrollEnabled = !enabled; | |
| 700 | - if ([self.pageViewController.viewControllers.firstObject isKindOfClass:[CNLiveSubSegmentController class]]) { | |
| 701 | - CNLiveSubSegmentController *subVc = (CNLiveSubSegmentController *)self.pageViewController.viewControllers.firstObject; | |
| 702 | - [subVc layoutRightSubViewWithShow:!enabled]; | |
| 703 | - } | |
| 704 | -} | |
| 705 | 693 | #pragma mark - |
| 706 | 694 | #pragma mark - CNSubClassifySegmentControllerDelegate |
| 707 | 695 | // 显示 目击者/监管/大众体育 首次使用引导页 | ... | ... |
CNLiveVideoClassifyKit/Classes/Controller/CNLiveSubSegmentController.h
| ... | ... | @@ -25,9 +25,6 @@ NS_ASSUME_NONNULL_BEGIN |
| 25 | 25 | -(instancetype)initWithModel:(CNCategoryGetChannelModel *)model; |
| 26 | 26 | @property (nonatomic, copy) void (^scrollViewDidScrollBlock)(BOOL isUp); |
| 27 | 27 | |
| 28 | -// 一级频道显示隐藏时二级频道右侧的搜索按钮变宽变窄控制 | |
| 29 | -- (void)layoutRightSubViewWithShow:(BOOL)show; | |
| 30 | - | |
| 31 | 28 | - (void)refreshCurrentVCData; |
| 32 | 29 | - (void)showGuideView; |
| 33 | 30 | ... | ... |
CNLiveVideoClassifyKit/Classes/Controller/CNLiveSubSegmentController.m
| ... | ... | @@ -121,6 +121,7 @@ |
| 121 | 121 | weakself |
| 122 | 122 | list.scrollViewDidScrollBlock = ^(BOOL isUp) { |
| 123 | 123 | !weakSelf.scrollViewDidScrollBlock ?: weakSelf.scrollViewDidScrollBlock(isUp); |
| 124 | + [weakSelf rightSubViewWithShow:isUp]; | |
| 124 | 125 | }; |
| 125 | 126 | [self.controllersArr addObject:listVC]; |
| 126 | 127 | } |
| ... | ... | @@ -165,6 +166,24 @@ |
| 165 | 166 | // 美食中国 历史记录 |
| 166 | 167 | [self.view addSubview:self.historyBtn]; |
| 167 | 168 | } |
| 169 | + | |
| 170 | + self.myCategoryView.top = 0; | |
| 171 | + self.pageViewController.view.frame = CGRectMake(0, self.myCategoryView.bottom+10, kScreenWidth, self.view.bounds.size.height - self.myCategoryView.bottom); | |
| 172 | + self.searchBtn.right = KScreenWidth-12; | |
| 173 | + CGFloat width = self.searchBtn.left; | |
| 174 | + self.searchBtn.centerY = self.myCategoryView.height/2; | |
| 175 | + if ([self.channelId isEqualToString:@"219"]) { | |
| 176 | + self.moreBtn.right = KScreenWidth-12-66-15; | |
| 177 | + self.moreBtn.centerY = self.myCategoryView.height/2; | |
| 178 | + self.progressView.right = KScreenWidth-93-18-15; | |
| 179 | + self.progressView.centerY = self.myCategoryView.height/2; | |
| 180 | + width = self.progressView.left; | |
| 181 | + }else if ([self.channelId isEqualToString:@"11"]){ | |
| 182 | + self.historyBtn.right = KScreenWidth-93; | |
| 183 | + self.historyBtn.centerY = self.myCategoryView.height/2; | |
| 184 | + width = self.historyBtn.left; | |
| 185 | + } | |
| 186 | + self.myCategoryView.width = width; | |
| 168 | 187 | // Do any additional setup after loading the view. |
| 169 | 188 | } |
| 170 | 189 | -(void)viewDidLayoutSubviews |
| ... | ... | @@ -176,13 +195,13 @@ |
| 176 | 195 | CGFloat width = self.searchBtn.left; |
| 177 | 196 | self.searchBtn.centerY = self.myCategoryView.height/2; |
| 178 | 197 | if ([self.channelId isEqualToString:@"219"]) { |
| 179 | - self.moreBtn.right = KScreenWidth-12-66-15; | |
| 198 | + self.moreBtn.right = self.searchBtn.left-15; | |
| 180 | 199 | self.moreBtn.centerY = self.myCategoryView.height/2; |
| 181 | - self.progressView.right = KScreenWidth-93-18-15; | |
| 200 | + self.progressView.right = self.moreBtn.left-15; | |
| 182 | 201 | self.progressView.centerY = self.myCategoryView.height/2; |
| 183 | 202 | width = self.progressView.left; |
| 184 | 203 | }else if ([self.channelId isEqualToString:@"11"]){ |
| 185 | - self.historyBtn.right = KScreenWidth-93; | |
| 204 | + self.historyBtn.right = self.searchBtn.left - 15; | |
| 186 | 205 | self.historyBtn.centerY = self.myCategoryView.height/2; |
| 187 | 206 | width = self.historyBtn.left; |
| 188 | 207 | } |
| ... | ... | @@ -287,9 +306,20 @@ |
| 287 | 306 | self.pageListArr = array.copy; |
| 288 | 307 | } |
| 289 | 308 | // 一级频道显示隐藏时二级频道右侧的搜索按钮变宽变窄控制 |
| 290 | -- (void)layoutRightSubViewWithShow:(BOOL)show { | |
| 291 | - self.findScrollView.scrollEnabled = !show; | |
| 292 | - if (show) { | |
| 309 | +- (void)rightSubViewWithShow:(BOOL)show { | |
| 310 | + if (show == self.findScrollView.isScrollEnabled) { | |
| 311 | + return; | |
| 312 | + } | |
| 313 | + self.findScrollView.scrollEnabled = show; | |
| 314 | + weakself | |
| 315 | + [UIView animateWithDuration:0.3 animations:^{ | |
| 316 | + [weakSelf uploadUIWithIsUp:show]; | |
| 317 | + }]; | |
| 318 | + | |
| 319 | +} | |
| 320 | +-(void)uploadUIWithIsUp:(BOOL)isUp | |
| 321 | +{ | |
| 322 | + if (!isUp) { | |
| 293 | 323 | // 正常 |
| 294 | 324 | |
| 295 | 325 | self.searchBtn.width = 66; |
| ... | ... | @@ -297,27 +327,28 @@ |
| 297 | 327 | [self.searchBtn setTitle:@"搜索" forState:UIControlStateNormal]; |
| 298 | 328 | CGFloat width = self.searchBtn.left; |
| 299 | 329 | if ([self.channelId isEqualToString:@"219"]) { |
| 300 | - self.moreBtn.right = KScreenWidth-12-66-15; | |
| 301 | - self.progressView.right = KScreenWidth-93-18-15; | |
| 330 | + self.moreBtn.right = self.searchBtn.left - 15; | |
| 331 | + self.progressView.right = self.moreBtn.left-15; | |
| 302 | 332 | width = self.progressView.left; |
| 303 | 333 | } else if ([self.channelId isEqualToString:@"11"]) { |
| 304 | - self.historyBtn.right = KScreenWidth-93; | |
| 334 | + self.historyBtn.right = self.searchBtn.left - 15;; | |
| 305 | 335 | width = self.historyBtn.left; |
| 306 | 336 | } |
| 307 | - | |
| 337 | + | |
| 308 | 338 | self.myCategoryView.width = width; |
| 309 | 339 | } else { |
| 310 | 340 | // 变窄 |
| 311 | 341 | |
| 312 | 342 | self.searchBtn.width = 30; |
| 313 | 343 | self.searchBtn.right = KScreenWidth-12; |
| 344 | + self.searchBtn.titleLabel.text = nil; | |
| 314 | 345 | [self.searchBtn setTitle:nil forState:UIControlStateNormal]; |
| 315 | 346 | |
| 316 | 347 | if ([self.channelId isEqualToString:@"219"]) { |
| 317 | - self.moreBtn.right = KScreenWidth-12-66-15+30; | |
| 318 | - self.progressView.right = KScreenWidth-93-18-15+30; | |
| 348 | + self.moreBtn.right = self.searchBtn.left - 15; | |
| 349 | + self.progressView.right = self.moreBtn.left - 15; | |
| 319 | 350 | } else if ([self.channelId isEqualToString:@"11"]) { |
| 320 | - self.historyBtn.right = KScreenWidth-93+30; | |
| 351 | + self.historyBtn.right = self.searchBtn.left - 15; | |
| 321 | 352 | } |
| 322 | 353 | self.myCategoryView.width = self.searchBtn.left; |
| 323 | 354 | } | ... | ... |
Example/CNLiveVideoClassifyKit.xcodeproj/project.pbxproj
| ... | ... | @@ -233,6 +233,7 @@ |
| 233 | 233 | 6003F587195388D20070C39A /* Frameworks */, |
| 234 | 234 | 6003F588195388D20070C39A /* Resources */, |
| 235 | 235 | 9BF71EFE8082311341273D3D /* [CP] Embed Pods Frameworks */, |
| 236 | + BC09AB0A3E357D27DAAEC5F9 /* [CP] Copy Pods Resources */, | |
| 236 | 237 | ); |
| 237 | 238 | buildRules = ( |
| 238 | 239 | ); |
| ... | ... | @@ -389,7 +390,6 @@ |
| 389 | 390 | "${BUILT_PRODUCTS_DIR}/CNLiveRequestBastKit/CNLiveRequestBastKit.framework", |
| 390 | 391 | "${BUILT_PRODUCTS_DIR}/CNLiveTripartiteManagement/CNLiveTripartiteManagement.framework", |
| 391 | 392 | "${BUILT_PRODUCTS_DIR}/CNLiveUserManagement/CNLiveUserManagement.framework", |
| 392 | - "${BUILT_PRODUCTS_DIR}/CNLiveVideoClassifyKit/CNLiveVideoClassifyKit.framework", | |
| 393 | 393 | "${BUILT_PRODUCTS_DIR}/FWDebug/FWDebug.framework", |
| 394 | 394 | "${BUILT_PRODUCTS_DIR}/JXCategoryView/JXCategoryView.framework", |
| 395 | 395 | "${BUILT_PRODUCTS_DIR}/MJExtension/MJExtension.framework", |
| ... | ... | @@ -416,7 +416,6 @@ |
| 416 | 416 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveRequestBastKit.framework", |
| 417 | 417 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveTripartiteManagement.framework", |
| 418 | 418 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveUserManagement.framework", |
| 419 | - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CNLiveVideoClassifyKit.framework", | |
| 420 | 419 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FWDebug.framework", |
| 421 | 420 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/JXCategoryView.framework", |
| 422 | 421 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MJExtension.framework", |
| ... | ... | @@ -432,6 +431,24 @@ |
| 432 | 431 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-CNLiveVideoClassifyKit_Example/Pods-CNLiveVideoClassifyKit_Example-frameworks.sh\"\n"; |
| 433 | 432 | showEnvVarsInLog = 0; |
| 434 | 433 | }; |
| 434 | + BC09AB0A3E357D27DAAEC5F9 /* [CP] Copy Pods Resources */ = { | |
| 435 | + isa = PBXShellScriptBuildPhase; | |
| 436 | + buildActionMask = 2147483647; | |
| 437 | + files = ( | |
| 438 | + ); | |
| 439 | + inputPaths = ( | |
| 440 | + "${PODS_ROOT}/Target Support Files/Pods-CNLiveVideoClassifyKit_Example/Pods-CNLiveVideoClassifyKit_Example-resources.sh", | |
| 441 | + "${PODS_ROOT}/../../CNLiveVideoClassifyKit/Assets/CNSegmentControl.bundle", | |
| 442 | + ); | |
| 443 | + name = "[CP] Copy Pods Resources"; | |
| 444 | + outputPaths = ( | |
| 445 | + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/CNSegmentControl.bundle", | |
| 446 | + ); | |
| 447 | + runOnlyForDeploymentPostprocessing = 0; | |
| 448 | + shellPath = /bin/sh; | |
| 449 | + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-CNLiveVideoClassifyKit_Example/Pods-CNLiveVideoClassifyKit_Example-resources.sh\"\n"; | |
| 450 | + showEnvVarsInLog = 0; | |
| 451 | + }; | |
| 435 | 452 | /* End PBXShellScriptBuildPhase section */ |
| 436 | 453 | |
| 437 | 454 | /* Begin PBXSourcesBuildPhase section */ | ... | ... |