|
@@ -8,6 +8,7 @@
|
|
|
|
|
|
#import "AliyunEffectFilterView.h"
|
|
|
#import "AliyunEffectFilterCell.h"
|
|
|
+#import "AliyunBeautyLevelCollectionViewCell.h"
|
|
|
#import "AliyunEffectInfo.h"
|
|
|
#import "AliyunDBHelper.h"
|
|
|
#import "AVC_ShortVideo_Config.h"
|
|
@@ -22,11 +23,18 @@
|
|
|
*/
|
|
|
@property (nonatomic, strong) UICollectionView *collectionView;
|
|
|
|
|
|
+@property (nonatomic, strong) UICollectionView *collectionView1;
|
|
|
+
|
|
|
/**
|
|
|
数据模型数组
|
|
|
*/
|
|
|
@property (nonatomic, strong) NSMutableArray *dataArray;
|
|
|
|
|
|
+/**
|
|
|
+ 数据模型数组
|
|
|
+ */
|
|
|
+@property (nonatomic, strong) NSMutableArray *dataArray1;
|
|
|
+
|
|
|
/**
|
|
|
FMDB的封装类
|
|
|
*/
|
|
@@ -67,18 +75,19 @@
|
|
|
*/
|
|
|
- (void)addSubViews {
|
|
|
|
|
|
- _headerView = [[AlivcEditBottomHeaderView alloc]initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.bounds), 48)];
|
|
|
- [_headerView setTitle:@"滤镜" icon:nil];
|
|
|
- [_headerView hiddenButton];
|
|
|
- [self addSubview:_headerView];
|
|
|
+// _headerView = [[AlivcEditBottomHeaderView alloc]initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.bounds), 48)];
|
|
|
+// [_headerView setTitle:@"滤镜" icon:nil];
|
|
|
+// [_headerView hiddenButton];
|
|
|
+// [self addSubview:_headerView];
|
|
|
+
|
|
|
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
|
|
|
layout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
|
|
|
- layout.itemSize = CGSizeMake(52, 80);
|
|
|
- layout.sectionInset = UIEdgeInsetsMake(5, 14, 20, 14);
|
|
|
+ layout.itemSize = CGSizeMake(53, 53);
|
|
|
+ layout.sectionInset = UIEdgeInsetsMake(0, 14, 0, 14);
|
|
|
layout.minimumInteritemSpacing = 15;
|
|
|
layout.minimumLineSpacing = 15;
|
|
|
|
|
|
- _collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 62.5, ScreenWidth, 102) collectionViewLayout:layout];
|
|
|
+ _collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 30, ScreenWidth, 83) collectionViewLayout:layout];
|
|
|
_collectionView.backgroundColor = [UIColor clearColor];
|
|
|
_collectionView.showsHorizontalScrollIndicator = NO;
|
|
|
[_collectionView registerNib:[UINib nibWithNibName:@"AliyunEffectFilterCell" bundle:nil] forCellWithReuseIdentifier:@"AliyunEffectFilterCell"];
|
|
@@ -86,8 +95,24 @@
|
|
|
_collectionView.dataSource = (id<UICollectionViewDataSource>)self;
|
|
|
_collectionView.delegate = (id<UICollectionViewDelegate>)self;
|
|
|
[self addSubview:_collectionView];
|
|
|
-
|
|
|
[self reloadDataWithEffectType:AliyunEffectTypeFilter];
|
|
|
+
|
|
|
+
|
|
|
+ UICollectionViewFlowLayout *layout1 = [[UICollectionViewFlowLayout alloc] init];
|
|
|
+ layout1.scrollDirection = UICollectionViewScrollDirectionHorizontal;
|
|
|
+ layout1.itemSize = CGSizeMake(44*ScaleWidth, 44*ScaleWidth);
|
|
|
+ layout1.sectionInset = UIEdgeInsetsMake(0, 37.5*ScaleWidth, 0, 37.5*ScaleWidth);
|
|
|
+ layout1.minimumInteritemSpacing = 20*ScaleWidth;
|
|
|
+ layout1.minimumLineSpacing = 20*ScaleWidth;
|
|
|
+
|
|
|
+ _collectionView1 = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 47, ScreenWidth, 44*ScaleWidth) collectionViewLayout:layout];
|
|
|
+ _collectionView1.backgroundColor = [UIColor clearColor];
|
|
|
+ _collectionView1.showsHorizontalScrollIndicator = NO;
|
|
|
+ [_collectionView1 registerNib:[UINib nibWithNibName:@"AliyunBeautyLevelCollectionViewCell" bundle:nil] forCellWithReuseIdentifier:@"AliyunBeautyLevelCollectionViewCell"];
|
|
|
+ _collectionView1.dataSource = (id<UICollectionViewDataSource>)self;
|
|
|
+ _collectionView1.delegate = (id<UICollectionViewDelegate>)self;
|
|
|
+ [self addSubview:_collectionView1];
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
@@ -99,7 +124,7 @@
|
|
|
- (void)setHideTop:(BOOL)hideTop{
|
|
|
_hideTop = hideTop;
|
|
|
_headerView.hidden = hideTop;
|
|
|
- _collectionView.frame = CGRectMake(0, 20, ScreenWidth, 102);
|
|
|
+ _collectionView.frame = CGRectMake(0, 30, ScreenWidth, 83);
|
|
|
|
|
|
}
|
|
|
|
|
@@ -139,40 +164,54 @@
|
|
|
}
|
|
|
|
|
|
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
|
|
|
- return _dataArray.count;
|
|
|
+ if (collectionView == self.collectionView) {
|
|
|
+ return _dataArray.count;
|
|
|
+
|
|
|
+ }else {
|
|
|
+ return 5;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
|
|
|
- AliyunEffectFilterCell *cell;
|
|
|
- if (indexPath.row == 0 || indexPath.row == _dataArray.count - 1) {
|
|
|
- cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"AliyunEffectFilterFuncCell" forIndexPath:indexPath];
|
|
|
- } else {
|
|
|
- cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"AliyunEffectFilterCell" forIndexPath:indexPath];
|
|
|
+ if (collectionView == self.collectionView) {
|
|
|
+ AliyunEffectFilterCell *cell;
|
|
|
+ if (indexPath.row == 0 || indexPath.row == _dataArray.count - 1) {
|
|
|
+ cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"AliyunEffectFilterFuncCell" forIndexPath:indexPath];
|
|
|
+ } else {
|
|
|
+ cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"AliyunEffectFilterCell" forIndexPath:indexPath];
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
-
|
|
|
- AliyunEffectInfo *effectInfo = _dataArray[indexPath.row];
|
|
|
- [cell cellModel:effectInfo];
|
|
|
- if (_effectType != AliyunEffectTypeSpecialFilter) {
|
|
|
- if (indexPath.row == _selectIndex) {
|
|
|
- [cell setSelected:YES];
|
|
|
- }else{
|
|
|
- [cell setSelected:NO];
|
|
|
+ AliyunEffectInfo *effectInfo = _dataArray[indexPath.row];
|
|
|
+ [cell cellModel:effectInfo];
|
|
|
+ if (_effectType != AliyunEffectTypeSpecialFilter) {
|
|
|
+ if (indexPath.row == _selectIndex) {
|
|
|
+ [cell setSelected:YES];
|
|
|
+ }else{
|
|
|
+ [cell setSelected:NO];
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- if (_effectType == AliyunEffectTypeFilter) {
|
|
|
- if (indexPath.row == 0) {
|
|
|
- cell.imageView.contentMode = UIViewContentModeCenter;
|
|
|
- cell.imageView.image = [UIImage imageNamed:@"video_pic_filter_artwork"];
|
|
|
- cell.nameLabel.text = @"原图";
|
|
|
- }else{
|
|
|
- cell.imageView.contentMode = UIViewContentModeScaleAspectFill;
|
|
|
- cell.imageView.backgroundColor = [UIColor clearColor];
|
|
|
+ if (_effectType == AliyunEffectTypeFilter) {
|
|
|
+ if (indexPath.row == 0) {
|
|
|
+ cell.imageView.contentMode = UIViewContentModeCenter;
|
|
|
+ cell.imageView.image = [UIImage imageNamed:@"video_pic_filter_artwork"];
|
|
|
+ cell.nameLabel.text = @"原图";
|
|
|
+ }else{
|
|
|
+ cell.imageView.contentMode = UIViewContentModeScaleAspectFill;
|
|
|
+ cell.imageView.backgroundColor = [UIColor clearColor];
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+ [cell setExclusiveTouch:YES];
|
|
|
+ return cell;
|
|
|
+
|
|
|
+ }else {
|
|
|
+ AliyunBeautyLevelCollectionViewCell *cell;
|
|
|
+ cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"AliyunBeautyLevelCollectionViewCell" forIndexPath:indexPath];
|
|
|
+ cell.indexPath = indexPath;
|
|
|
+ return cell;
|
|
|
}
|
|
|
|
|
|
- [cell setExclusiveTouch:YES];
|
|
|
- return cell;
|
|
|
}
|
|
|
|
|
|
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
|