Commit fe3c8243912e8a59547e1a201b37a386d1222d23
1 parent
7c9dd834
0.0.7
Showing
23 changed files
with
45 additions
and
32 deletions
CNLiveImagePickerController.podspec
CNLiveImagePickerController/Classes/CNEditVideoController.m
| ... | ... | @@ -101,14 +101,14 @@ |
| 101 | 101 | self.layer.borderWidth = 2; |
| 102 | 102 | self.layer.borderColor = [UIColor clearColor].CGColor; |
| 103 | 103 | |
| 104 | - _leftView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"video_edit_left"]]; | |
| 104 | + _leftView = [[UIImageView alloc] initWithImage:[UIImage imageNamedFromMyBundle:@"video_edit_left"]]; | |
| 105 | 105 | _leftView.userInteractionEnabled = YES; |
| 106 | 106 | _leftView.tag = 0; |
| 107 | 107 | UIPanGestureRecognizer *lg = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panAction:)]; |
| 108 | 108 | [_leftView addGestureRecognizer:lg]; |
| 109 | 109 | [self addSubview:_leftView]; |
| 110 | 110 | |
| 111 | - _rightView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"video_edit_right"]]; | |
| 111 | + _rightView = [[UIImageView alloc] initWithImage:[UIImage imageNamedFromMyBundle:@"video_edit_right"]]; | |
| 112 | 112 | _rightView.userInteractionEnabled = YES; |
| 113 | 113 | _rightView.tag = 1; |
| 114 | 114 | UIPanGestureRecognizer *rg = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panAction:)]; | ... | ... |
CNLiveImagePickerController/Classes/CNImagePickerController.m
| ... | ... | @@ -50,9 +50,9 @@ |
| 50 | 50 | self.iconThemeColor = RGBOF(0x00BBE06);// 主体颜色 |
| 51 | 51 | self.showPhotoCannotSelectLayer = YES;//达到上限是否有浮层 |
| 52 | 52 | self.cannotSelectLayerColor = [[UIColor whiteColor] colorWithAlphaComponent:0.8];//设置达到上限的浮层 |
| 53 | - self.photoDefImage = [UIImage imageNamed:@"photo_cell_normal"]; | |
| 53 | + self.photoDefImage = [UIImage imageNamedFromMyBundle:@"photo_cell_normal"]; | |
| 54 | 54 | self.photoSelImage = [UIImage qmui_imageWithColor:RGBOF(0x0BBE06) size:CGSizeMake(22, 22) cornerRadius:11]; |
| 55 | - self.photoOriginDefImage = [UIImage imageNamed:@"photo_original_nor"]; | |
| 55 | + self.photoOriginDefImage = [UIImage imageNamedFromMyBundle:@"photo_original_nor"]; | |
| 56 | 56 | |
| 57 | 57 | // 3. Set allow picking video & photo & originalPhoto or not |
| 58 | 58 | // 3. 设置是否可以选择视频/图片/原图/gif(未开放) |
| ... | ... | @@ -88,7 +88,7 @@ |
| 88 | 88 | // 自定义导航栏上的返回按钮 |
| 89 | 89 | /* |
| 90 | 90 | [imagePickerVc setNavLeftBarButtonSettingBlock:^(UIButton *leftButton){ |
| 91 | - [leftButton setImage:[UIImage imageNamed:@"back"] forState:UIControlStateNormal]; | |
| 91 | + [leftButton setImage:[UIImage imageNamedFromMyBundle:@"back"] forState:UIControlStateNormal]; | |
| 92 | 92 | [leftButton setImageEdgeInsets:UIEdgeInsetsMake(0, -10, 0, 20)]; |
| 93 | 93 | }]; |
| 94 | 94 | imagePickerVc.delegate = self; |
| ... | ... | @@ -102,7 +102,7 @@ |
| 102 | 102 | self.naviTitleColor = RGBOF(0x282828);//相册title |
| 103 | 103 | self.naviTitleFont = [UIFont fontWithName:@"PingFangSC-Medium" size:18];//title文字大小 |
| 104 | 104 | [self setNavLeftBarButtonSettingBlock:^(UIButton *leftButton) {//设置返回按钮图标 |
| 105 | - [leftButton setImage:[UIImage imageNamed:@"photo_back"] forState:UIControlStateNormal];//返回按钮图片 | |
| 105 | + [leftButton setImage:[UIImage imageNamedFromMyBundle:@"photo_back"] forState:UIControlStateNormal];//返回按钮图片 | |
| 106 | 106 | [leftButton setTitle:@"返回" forState:UIControlStateNormal];//设置文字大小 |
| 107 | 107 | [leftButton setTitleColor:RGBOF(0x282828) forState:UIControlStateNormal];//设置文字颜色 |
| 108 | 108 | leftButton.titleLabel.font = [UIFont systemFontOfSize:15];//设置文字大小 |
| ... | ... | @@ -130,9 +130,9 @@ |
| 130 | 130 | [previewButton setTitleColor:RGBOF(0x000000) forState:UIControlStateNormal];//默认 |
| 131 | 131 | |
| 132 | 132 | //原图按钮 |
| 133 | - [originalPhotoButton setImage:[UIImage imageNamed:@"photo_original_normal"] forState:UIControlStateDisabled];//禁用 | |
| 134 | - [originalPhotoButton setImage:[UIImage imageNamed:@"photo_original_normal"] forState:UIControlStateNormal];//默认 | |
| 135 | - [originalPhotoButton setImage:[UIImage imageNamed:@"photo_original_select"] forState:UIControlStateSelected];//选中 | |
| 133 | + [originalPhotoButton setImage:[UIImage imageNamedFromMyBundle:@"photo_original_normal"] forState:UIControlStateDisabled];//禁用 | |
| 134 | + [originalPhotoButton setImage:[UIImage imageNamedFromMyBundle:@"photo_original_normal"] forState:UIControlStateNormal];//默认 | |
| 135 | + [originalPhotoButton setImage:[UIImage imageNamedFromMyBundle:@"photo_original_select"] forState:UIControlStateSelected];//选中 | |
| 136 | 136 | originalPhotoButton.titleLabel.font = [UIFont systemFontOfSize:16]; |
| 137 | 137 | [originalPhotoButton setTitleColor:RGBOF(0xB3B3B3) forState:UIControlStateDisabled]; |
| 138 | 138 | [originalPhotoButton setTitleColor:RGBOF(0x000000) forState:UIControlStateNormal]; |
| ... | ... | @@ -169,16 +169,16 @@ |
| 169 | 169 | [self setPhotoPreviewPageUIConfigBlock:^(UICollectionView *collectionView, UIView *naviBar, UIButton *backButton, UIButton *selectButton, UILabel *indexLabel, UIView *toolBar, UIButton *originalPhotoButton, UILabel *originalPhotoLabel, UIButton *doneButton, UIImageView *numberImageView, UILabel *numberLabel) { |
| 170 | 170 | |
| 171 | 171 | //返回按钮 |
| 172 | - [backButton setImage:[UIImage imageNamed:@"photo_original_back"] forState:UIControlStateNormal]; | |
| 172 | + [backButton setImage:[UIImage imageNamedFromMyBundle:@"photo_original_back"] forState:UIControlStateNormal]; | |
| 173 | 173 | //选择按钮 |
| 174 | - [selectButton setImage:[UIImage imageNamed:@"photo_original_nor"] forState:UIControlStateNormal]; | |
| 174 | + [selectButton setImage:[UIImage imageNamedFromMyBundle:@"photo_original_nor"] forState:UIControlStateNormal]; | |
| 175 | 175 | [selectButton setImage:[UIImage qmui_imageWithColor:RGBOF(0x0BBE06) size:CGSizeMake(28, 28) cornerRadius:14] forState:UIControlStateSelected]; |
| 176 | 176 | [selectButton setTitle:@"" forState:UIControlStateDisabled]; |
| 177 | 177 | |
| 178 | 178 | //原图按钮 |
| 179 | - [originalPhotoButton setImage:[UIImage imageNamed:@"photo_original_normal"] forState:UIControlStateDisabled];//禁用 | |
| 180 | - [originalPhotoButton setImage:[UIImage imageNamed:@"photo_original_normal"] forState:UIControlStateNormal];//默认 | |
| 181 | - [originalPhotoButton setImage:[UIImage imageNamed:@"photo_original_select"] forState:UIControlStateSelected];//选中 | |
| 179 | + [originalPhotoButton setImage:[UIImage imageNamedFromMyBundle:@"photo_original_normal"] forState:UIControlStateDisabled];//禁用 | |
| 180 | + [originalPhotoButton setImage:[UIImage imageNamedFromMyBundle:@"photo_original_normal"] forState:UIControlStateNormal];//默认 | |
| 181 | + [originalPhotoButton setImage:[UIImage imageNamedFromMyBundle:@"photo_original_select"] forState:UIControlStateSelected];//选中 | |
| 182 | 182 | originalPhotoButton.titleLabel.font = [UIFont systemFontOfSize:16]; |
| 183 | 183 | [originalPhotoButton setTitleColor:RGBOF(0xB3B3B3) forState:UIControlStateDisabled]; |
| 184 | 184 | [originalPhotoButton setTitleColor:RGBAOF(0xFFFFFF, 0.7) forState:UIControlStateNormal]; |
| ... | ... | @@ -244,8 +244,7 @@ |
| 244 | 244 | }]; |
| 245 | 245 | //相簿 |
| 246 | 246 | [self setAlbumCellDidSetModelBlock:^(TZAlbumCell *cell, UIImageView *posterImageView, UILabel *titleLabel) { |
| 247 | - [posterImageView setBackgroundColor:[UIColor blueColor]]; | |
| 248 | - [posterImageView setBackgroundColor:[UIColor blueColor]]; | |
| 247 | + [posterImageView setBackgroundColor:[UIColor whiteColor]]; | |
| 249 | 248 | |
| 250 | 249 | }]; |
| 251 | 250 | |
| ... | ... | @@ -266,7 +265,7 @@ |
| 266 | 265 | }]; |
| 267 | 266 | //图片预览 |
| 268 | 267 | [self setPhotoPreviewPageDidLayoutSubviewsBlock:^(UICollectionView *collectionView, UIView *naviBar, UIButton *backButton, UIButton *selectButton, UILabel *indexLabel, UIView *toolBar, UIButton *originalPhotoButton, UILabel *originalPhotoLabel, UIButton *doneButton, UIImageView *numberImageView, UILabel *numberLabel) { |
| 269 | - | |
| 268 | + [backButton setImage:[UIImage imageNamedFromMyBundle:@"navi_back"] forState:UIControlStateNormal]; | |
| 270 | 269 | CGRect frame = toolBar.frame; |
| 271 | 270 | doneButton.frame = CGRectMake(frame.size.width - 60 - 13, frame.size.height /2 - 15 - (kVerticalBottomSafeHeight /2), 60, 30); |
| 272 | 271 | ... | ... |
CNLiveImagePickerController/Classes/TZAssetCell.m
| ... | ... | @@ -169,7 +169,7 @@ |
| 169 | 169 | model.needOscillatoryAnimation = NO; |
| 170 | 170 | |
| 171 | 171 | if (!model.isExport) { |
| 172 | - self.imageView.image = [UIImage imageNamed:@"placeImg.png"]; | |
| 172 | + self.imageView.image = [UIImage imageNamedFromMyBundle:@"placeImg.png"]; | |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | |
| ... | ... | @@ -441,13 +441,14 @@ |
| 441 | 441 | @interface TZAlbumCell () |
| 442 | 442 | @property (weak, nonatomic) UIImageView *posterImageView; |
| 443 | 443 | @property (weak, nonatomic) UILabel *titleLabel; |
| 444 | +@property (weak, nonatomic) UIImageView *enterImageView; | |
| 444 | 445 | @end |
| 445 | 446 | |
| 446 | 447 | @implementation TZAlbumCell |
| 447 | 448 | |
| 448 | 449 | - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { |
| 449 | 450 | self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; |
| 450 | - self.accessoryType = UITableViewCellAccessoryDisclosureIndicator; | |
| 451 | + self.accessoryType = UITableViewCellAccessoryNone; | |
| 451 | 452 | return self; |
| 452 | 453 | } |
| 453 | 454 | |
| ... | ... | @@ -470,7 +471,7 @@ |
| 470 | 471 | } |
| 471 | 472 | |
| 472 | 473 | if (!model.isExport) { |
| 473 | - self.posterImageView.image = [UIImage imageNamed:@"placeImg.png"]; | |
| 474 | + self.posterImageView.image = [UIImage imageNamedFromMyBundle:@"placeImg.png"]; | |
| 474 | 475 | } |
| 475 | 476 | |
| 476 | 477 | if (self.albumCellDidSetModelBlock) { |
| ... | ... | @@ -482,6 +483,7 @@ |
| 482 | 483 | - (void)layoutSubviews { |
| 483 | 484 | if (iOS7Later) [super layoutSubviews]; |
| 484 | 485 | _selectedCountButton.frame = CGRectMake(self.tz_width - 24 - 30, 23, 24, 24); |
| 486 | + self.enterImageView.frame = CGRectMake(self.tz_width - 20, 30, 6, 12); | |
| 485 | 487 | NSInteger titleHeight = ceil(self.titleLabel.font.lineHeight); |
| 486 | 488 | self.titleLabel.frame = CGRectMake(80, (self.tz_height - titleHeight) / 2, self.tz_width - 80 - 50, titleHeight); |
| 487 | 489 | self.posterImageView.frame = CGRectMake(0, 0, 70, 70); |
| ... | ... | @@ -520,6 +522,16 @@ |
| 520 | 522 | return _titleLabel; |
| 521 | 523 | } |
| 522 | 524 | |
| 525 | +- (UIImageView *)enterImageView { | |
| 526 | + if (_enterImageView == nil) { | |
| 527 | + UIImageView *enterImageView = [[UIImageView alloc] init]; | |
| 528 | + enterImageView.image = [UIImage imageNamedFromMyBundle:@"photo_enter"]; | |
| 529 | + [self.contentView addSubview:enterImageView]; | |
| 530 | + _enterImageView = enterImageView; | |
| 531 | + } | |
| 532 | + return _enterImageView; | |
| 533 | +} | |
| 534 | + | |
| 523 | 535 | - (UIButton *)selectedCountButton { |
| 524 | 536 | if (_selectedCountButton == nil) { |
| 525 | 537 | UIButton *selectedCountButton = [[UIButton alloc] init]; | ... | ... |
CNLiveImagePickerController/Classes/TZImagePickerController.bundle/mjz_bq@2x.png
0 → 100644
1.23 KB
CNLiveImagePickerController/Classes/TZImagePickerController.bundle/mjz_go@2x.png
0 → 100644
746 Bytes
CNLiveImagePickerController/Classes/TZImagePickerController.bundle/mjz_q@2x.png
0 → 100644
2.77 KB
CNLiveImagePickerController/Classes/TZImagePickerController.bundle/mjz_sq@2x.png
0 → 100644
1.14 KB
CNLiveImagePickerController/Classes/TZImagePickerController.bundle/mjz_zk@2x.png
0 → 100644
1.15 KB
CNLiveImagePickerController/Classes/TZImagePickerController.bundle/ph_back@2x.png
0 → 100644
384 Bytes
CNLiveImagePickerController/Classes/TZImagePickerController.bundle/photo_back@2x.png
0 → 100644
1.16 KB
CNLiveImagePickerController/Classes/TZImagePickerController.bundle/photo_cell_normal@2x.png
0 → 100644
1.35 KB
CNLiveImagePickerController/Classes/TZImagePickerController.bundle/photo_enter@2x.png
0 → 100644
268 Bytes
CNLiveImagePickerController/Classes/TZImagePickerController.bundle/photo_original_nor@2x.png
0 → 100644
2.12 KB
CNLiveImagePickerController/Classes/TZImagePickerController.bundle/ph_unselect@2x.png renamed to CNLiveImagePickerController/Classes/TZImagePickerController.bundle/photo_original_normal@2x.png
902 Bytes
CNLiveImagePickerController/Classes/TZImagePickerController.bundle/ph_select@2x.png renamed to CNLiveImagePickerController/Classes/TZImagePickerController.bundle/photo_original_select@2x.png
1.31 KB
CNLiveImagePickerController/Classes/TZImagePickerController.bundle/placeImg@2x.png
0 → 100644
4.48 KB
CNLiveImagePickerController/Classes/TZImagePickerController.bundle/publish_zw@2x.png
0 → 100644
7.66 KB
CNLiveImagePickerController/Classes/TZImagePickerController.bundle/video_edit_left@2x.png
0 → 100644
203 Bytes
CNLiveImagePickerController/Classes/TZImagePickerController.bundle/video_edit_right@2x.png
0 → 100644
208 Bytes
CNLiveImagePickerController/Classes/TZImagePickerController.bundle/xzq_fh@2x.png
0 → 100644
1.71 KB
CNLiveImagePickerController/Classes/TZImagePickerController.m
| ... | ... | @@ -54,7 +54,7 @@ |
| 54 | 54 | self.navigationBar.barStyle = UIBarStyleBlack; |
| 55 | 55 | self.navigationBar.translucent = YES; |
| 56 | 56 | [TZImageManager manager].shouldFixOrientation = NO; |
| 57 | - | |
| 57 | + | |
| 58 | 58 | // Default appearance, you can reset these after this method |
| 59 | 59 | // 默认的外观,你可以在这个方法后重置 |
| 60 | 60 | self.oKButtonTitleColorNormal = [UIColor colorWithRed:(83/255.0) green:(179/255.0) blue:(17/255.0) alpha:1.0]; |
| ... | ... | @@ -385,7 +385,7 @@ |
| 385 | 385 | if ([[TZImageManager manager] authorizationStatusAuthorized]) { |
| 386 | 386 | [_tipLabel removeFromSuperview]; |
| 387 | 387 | [_settingBtn removeFromSuperview]; |
| 388 | - | |
| 388 | + | |
| 389 | 389 | [self pushPhotoPickerVc]; |
| 390 | 390 | |
| 391 | 391 | TZAlbumPickerController *albumPickerVc = (TZAlbumPickerController *)self.visibleViewController; |
| ... | ... | @@ -694,7 +694,7 @@ |
| 694 | 694 | |
| 695 | 695 | _HUDContainer.frame = CGRectMake((self.view.tz_width - 120) / 2, (self.view.tz_height - 90) / 2, 120, 90); |
| 696 | 696 | _HUDIndicatorView.frame = CGRectMake(45, 15, 30, 30); |
| 697 | - _HUDLabel.frame = CGRectMake(0,40, 120, 50); | |
| 697 | + _HUDLabel.frame = CGRectMake(0,40, 120, 50); | |
| 698 | 698 | } |
| 699 | 699 | |
| 700 | 700 | #pragma mark - Public |
| ... | ... | @@ -769,16 +769,17 @@ |
| 769 | 769 | if (![[TZImageManager manager] authorizationStatusAuthorized]) { |
| 770 | 770 | return; |
| 771 | 771 | } |
| 772 | - | |
| 772 | + | |
| 773 | 773 | if (self.isFirstAppear) { |
| 774 | 774 | TZImagePickerController *imagePickerVc = (TZImagePickerController *)self.navigationController; |
| 775 | 775 | [imagePickerVc showProgressHUD]; |
| 776 | 776 | } |
| 777 | 777 | __weak typeof(self) weakSelf = self; |
| 778 | 778 | dispatch_async(dispatch_get_global_queue(0, 0), ^{ |
| 779 | - TZImagePickerController *imagePickerVc = (TZImagePickerController *)weakSelf.navigationController; | |
| 780 | - [[TZImageManager manager] getAllAlbums:imagePickerVc.allowPickingVideo allowPickingImage:imagePickerVc.allowPickingImage needFetchAssets:!weakSelf.isFirstAppear completion:^(NSArray<TZAlbumModel *> *models) { | |
| 781 | - dispatch_async(dispatch_get_main_queue(), ^{ | |
| 779 | + dispatch_async(dispatch_get_main_queue(), ^{ | |
| 780 | + TZImagePickerController *imagePickerVc = (TZImagePickerController *)weakSelf.navigationController; | |
| 781 | + [[TZImageManager manager] getAllAlbums:imagePickerVc.allowPickingVideo allowPickingImage:imagePickerVc.allowPickingImage needFetchAssets:!weakSelf.isFirstAppear completion:^(NSArray<TZAlbumModel *> *models) { | |
| 782 | + | |
| 782 | 783 | if (models == nil) { |
| 783 | 784 | [imagePickerVc hideProgressHUD]; |
| 784 | 785 | return; |
| ... | ... | @@ -805,8 +806,9 @@ |
| 805 | 806 | } else { |
| 806 | 807 | [self->_tableView reloadData]; |
| 807 | 808 | } |
| 808 | - }); | |
| 809 | - }]; | |
| 809 | + | |
| 810 | + }]; | |
| 811 | + }); | |
| 810 | 812 | }); |
| 811 | 813 | } |
| 812 | 814 | |
| ... | ... | @@ -849,7 +851,7 @@ |
| 849 | 851 | cell.albumCellDidSetModelBlock = imagePickerVc.albumCellDidSetModelBlock; |
| 850 | 852 | cell.selectedCountButton.backgroundColor = imagePickerVc.iconThemeColor; |
| 851 | 853 | cell.model = _albumArr[indexPath.row]; |
| 852 | - cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; | |
| 854 | + cell.accessoryType = UITableViewCellAccessoryNone; | |
| 853 | 855 | return cell; |
| 854 | 856 | } |
| 855 | 857 | |
| ... | ... | @@ -920,7 +922,7 @@ |
| 920 | 922 | CGSizeEqualToSize([UIScreen mainScreen].bounds.size, CGSizeMake(812, 375)) || |
| 921 | 923 | CGSizeEqualToSize([UIScreen mainScreen].bounds.size, CGSizeMake(414, 896)) || |
| 922 | 924 | CGSizeEqualToSize([UIScreen mainScreen].bounds.size, CGSizeMake(896, 414))); |
| 923 | - | |
| 925 | + | |
| 924 | 926 | } |
| 925 | 927 | |
| 926 | 928 | + (CGFloat)tz_statusBarHeight { | ... | ... |
CNLiveImagePickerController/Classes/placeImg.png deleted
100644 → 0
7.02 KB