|
|
@@ -54,6 +54,7 @@
|
|
|
if (self =[self init]) {
|
|
|
if (!array) {
|
|
|
self.itemTypeArray = array;
|
|
|
+
|
|
|
}
|
|
|
else{
|
|
|
//未传入则不填充;
|
|
|
@@ -86,13 +87,13 @@
|
|
|
,...以此类推
|
|
|
}
|
|
|
*/
|
|
|
- NSArray *iconArray = @[@"itemtype_SyncContact",@"itemType_Recycle",@"itemType_Theme",@"itemType_Developing"];
|
|
|
- NSArray *titleArray = @[@"通讯录",@"照片",@"文档",@"视频",@"音频"];
|
|
|
- self.itemTypeArray = @[@(CSFileTypeAll),@(CSFileTypePic),@(CSFileTypeDoc),@(CSFileTypeVideo),@(CSFileTypeAudio)];
|
|
|
+ //NSArray *iconArray = @[@"itemtype_SyncContact",@"itemType_Recycle",@"itemType_Theme",@"itemType_Developing"];
|
|
|
+ //NSArray *titleArray = @[@"通讯录",@"照片",@"文档",@"视频",@"音频"];
|
|
|
+ //self.itemTypeArray = @[@(CSFileTypeAll),@(CSFileTypePic),@(CSFileTypeDoc),@(CSFileTypeVideo),@(CSFileTypeAudio)];
|
|
|
|
|
|
//实际多少页
|
|
|
- NSInteger pageCount = (iconArray.count / (LineNum * RowNum));
|
|
|
- if (iconArray.count % (LineNum * RowNum) != 0) {
|
|
|
+ NSInteger pageCount = (_itemTypeArray.count / (LineNum * RowNum));
|
|
|
+ if (_itemTypeArray.count % (LineNum * RowNum) != 0) {
|
|
|
pageCount += 1;
|
|
|
}
|
|
|
self.utilityPagesCount = pageCount;
|
|
|
@@ -171,11 +172,11 @@
|
|
|
cell.utilityOperateBlock = ^(ItemType type)
|
|
|
{
|
|
|
|
|
|
- if (weakself.utilityOperateBlock && weakself.currentPageIndex * (LineNum * RowNum - 1) + type < weakself.fileTypeArray.count) {
|
|
|
+ if (weakself.utilityOperateBlock && weakself.currentPageIndex * (LineNum * RowNum - 1) + type < weakself.itemTypeArray.count) {
|
|
|
|
|
|
- NSNumber *typeNum = weakself.fileTypeArray[weakself.currentPageIndex * (LineNum * RowNum - 1) + type];
|
|
|
+ NSNumber *typeNum = weakself.itemTypeArray[weakself.currentPageIndex * (LineNum * RowNum - 1) + type];
|
|
|
|
|
|
- weakself.utilityOperateBlock((CSFileType)typeNum.integerValue);
|
|
|
+ weakself.utilityOperateBlock((ItemType)typeNum.integerValue);
|
|
|
}
|
|
|
};
|
|
|
|
|
|
@@ -193,7 +194,7 @@
|
|
|
#pragma mark - uicollectionviewlayoutdatasource
|
|
|
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath
|
|
|
{
|
|
|
- return CGSizeMake(UtilityCellWidth ,OnePageUtilityCellHeight);
|
|
|
+ return CGSizeMake(UtilityCellWidth ,UtilityCellHeight);
|
|
|
}
|
|
|
|
|
|
-(UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger)section
|
|
|
@@ -238,24 +239,24 @@
|
|
|
|
|
|
@end
|
|
|
|
|
|
-@interface CSFileOnePageUtilityCell()
|
|
|
-@property (nonatomic , weak)CSFileOnePageUtilityView *pageUtilityView;
|
|
|
+@interface PageUtilityCell()
|
|
|
+@property (nonatomic , weak)PageUtilityView *pageUtilityView;
|
|
|
@end
|
|
|
-@implementation CSFileOnePageUtilityCell
|
|
|
+@implementation PageUtilityCell
|
|
|
- (instancetype)initWithFrame:(CGRect)frame
|
|
|
{
|
|
|
if (self = [super initWithFrame:frame]) {
|
|
|
|
|
|
- CSFileOnePageUtilityView *pageUtilityView = [[CSFileOnePageUtilityView alloc]init];
|
|
|
+ PageUtilityView *pageUtilityView = [[PageUtilityView alloc]init];
|
|
|
|
|
|
|
|
|
__weak typeof(self)weakself = self;
|
|
|
|
|
|
- pageUtilityView.utilityOperateBlock = ^(CSFileType csFileType){
|
|
|
+ pageUtilityView.utilityOperateBlock = ^(ItemType itemtype){
|
|
|
|
|
|
if (weakself.utilityOperateBlock) {
|
|
|
|
|
|
- weakself.utilityOperateBlock(csFileType);
|
|
|
+ weakself.utilityOperateBlock(itemtype);
|
|
|
}
|
|
|
|
|
|
};
|
|
|
@@ -267,8 +268,12 @@
|
|
|
return self;
|
|
|
}
|
|
|
|
|
|
+- (void)setUitilityIconsArray:(NSDictionary *)itemListDic{
|
|
|
+ NSArray *array
|
|
|
+}
|
|
|
- (void)setUitilityIconsArray:(NSArray *)iconArray titlesArray:(NSArray *)titleArray
|
|
|
{
|
|
|
+
|
|
|
[self.pageUtilityView setUitilityIconsArray:iconArray titlesArray:titleArray];
|
|
|
}
|
|
|
|
|
|
@@ -281,13 +286,13 @@
|
|
|
@end
|
|
|
|
|
|
|
|
|
-@interface CSFileOnePageUtilityView()
|
|
|
+@interface PageUtilityView()
|
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
-@implementation CSFileOnePageUtilityView
|
|
|
+@implementation PageUtilityView
|
|
|
- (instancetype)init
|
|
|
{
|
|
|
if(self = [super init])
|
|
|
@@ -324,7 +329,7 @@
|
|
|
- (void)utilityAction:(CustomButton *)btn
|
|
|
{
|
|
|
if (self.utilityOperateBlock) {
|
|
|
- self.utilityOperateBlock((CSFileType)btn.tag);
|
|
|
+ self.utilityOperateBlock((ItemType)btn.tag);
|
|
|
}
|
|
|
}
|
|
|
|