Commit 232c8741 authored by lmj_521aiau@163.com's avatar lmj_521aiau@163.com

no message

parent d98fcdd3
This diff is collapsed.
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
"scale" : "1x" "scale" : "1x"
}, },
{ {
"filename" : "global_empty_set@2x.png", "filename" : "位图@2x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"filename" : "global_empty_set@3x.png", "filename" : "位图@3x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "3x" "scale" : "3x"
} }
......
...@@ -18,22 +18,8 @@ ...@@ -18,22 +18,8 @@
[self.nextButton setTitle:ICLocalized(@"NextStep") forState:UIControlStateNormal]; [self.nextButton setTitle:ICLocalized(@"NextStep") forState:UIControlStateNormal];
NSString * clauseStr = ICLocalized(@"PrivacyMainDesc"); NSString * clauseStr = ICLocalized(@"PrivacyMainDesc");
//@"Your privacy is our concern. We intend to provide transparency and ensure user privacy. Please learn more about how we process the data that can be obtained about you or your device. ";
NSString * privacyStr = ICLocalized(@"PrivacySubDesc"); NSString * privacyStr = ICLocalized(@"PrivacySubDesc");
//@"By continuing you confirm that you acknowledge and accept our Privacy Policy."; NSString * privacy = ICLocalized(@"PrivacyPolicy");
NSString * privacy = ICLocalized(@"PrivacyPolicy"); //@"Privacy Policy.";
// NSString *language = [[NSLocale preferredLanguages] firstObject];
// if ([language containsString: @"zh"]) {
// clauseStr = @"您的隐私是我们所关切的事。我们希望提供透明度并确保隐私。请了解我们如何处理有关您或您的设备的数据。";
// privacyStr = @"继续即表示您确认您承认并接受我们的隐私政策。";
// privacy = @"隐私政策.";
// } else {
// privacyStr = @"Your privacy is our concern. We intend to provide transparency and ensure user privacy. Please learn more about how we process the data that can be obtained about you or your device. ";
// privacyStr = @"By continuing you confirm that you acknowledge and accept our Privacy Policy.";
// privacy = @"Privacy Policy.";
// }
self.mainContentLabel.text = clauseStr; self.mainContentLabel.text = clauseStr;
......
...@@ -125,19 +125,11 @@ static NSString * const ICContactsListCellID = @"ICContactsListCellID"; ...@@ -125,19 +125,11 @@ static NSString * const ICContactsListCellID = @"ICContactsListCellID";
if (idx == 0) { if (idx == 0) {
return; return;
} }
//<<<<<<< HEAD
// UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
//
// [self cancelAction];
// }];
// UIAlertAction *sureAction = [UIAlertAction actionWithTitle:@"删除" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
//=======
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:ICLocalized(@"Cancel") style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) { UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:ICLocalized(@"Cancel") style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
[self cancelAction]; [self cancelAction];
}]; }];
UIAlertAction *sureAction = [UIAlertAction actionWithTitle:ICLocalized(@"Delete") style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { UIAlertAction *sureAction = [UIAlertAction actionWithTitle:ICLocalized(@"Delete") style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
//>>>>>>> e2a86a53f3e08f550e73d196c87ffc4f254ccccf
[MobClick event:@"contact_delete_action"]; [MobClick event:@"contact_delete_action"];
for (NSArray *arr in self.sortedModelArr) { for (NSArray *arr in self.sortedModelArr) {
for (ICContactListModel *model in arr) { for (ICContactListModel *model in arr) {
...@@ -150,13 +142,9 @@ static NSString * const ICContactsListCellID = @"ICContactsListCellID"; ...@@ -150,13 +142,9 @@ static NSString * const ICContactsListCellID = @"ICContactsListCellID";
[self fetchContacts]; [self fetchContacts];
}]; }];
//<<<<<<< HEAD
// NSString *title = [NSString stringWithFormat:@"删除%ld个联系人",(long)idx];
// UIAlertController *alert = [UIAlertController alertControllerWithTitle:title message:@"联系人将从设备上删除,再删除之前会备份到设备上。" preferredStyle:UIAlertControllerStyleAlert];
//=======
NSString *title = [NSString stringWithFormat:@"%@ %ld %@",ICLocalized(@"Delete"),(long)idx,ICLocalized(@"ContactCount")]; NSString *title = [NSString stringWithFormat:@"%@ %ld %@",ICLocalized(@"Delete"),(long)idx,ICLocalized(@"ContactCount")];
UIAlertController *alert = [UIAlertController alertControllerWithTitle:title message:ICLocalized(@"DeleteDescription") preferredStyle:UIAlertControllerStyleAlert]; UIAlertController *alert = [UIAlertController alertControllerWithTitle:title message:ICLocalized(@"DeleteDescription") preferredStyle:UIAlertControllerStyleAlert];
//>>>>>>> e2a86a53f3e08f550e73d196c87ffc4f254ccccf
[alert addAction:cancelAction]; [alert addAction:cancelAction];
[alert addAction:sureAction]; [alert addAction:sureAction];
[self presentViewController:alert animated:YES completion:nil]; [self presentViewController:alert animated:YES completion:nil];
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
[self observationNetwork]; [self observationNetwork];
[UMConfigure initWithAppkey:@"5f04485d167edd874f000103" channel:@"App Store"]; [UMConfigure initWithAppkey:@"5f2a6bd6d3093221547530b2" channel:@"App Store"];
[UMConfigure setLogEnabled:true]; [UMConfigure setLogEnabled:true];
[MobClick event:@"app_start"]; [MobClick event:@"app_start"];
......
...@@ -212,12 +212,6 @@ ...@@ -212,12 +212,6 @@
// 手动清理 // 手动清理
- (IBAction)manualClearAction:(UIButton *)sender { - (IBAction)manualClearAction:(UIButton *)sender {
// [MobClick event:@"manually_clean_button"];
// ICManualCleanTableViewController *vc = [[UIStoryboard storyboardWithName:@"Main" bundle: nil] instantiateViewControllerWithIdentifier:@"ICManualCleanTableViewController"];
// vc.modalPresentationStyle = UIModalPresentationOverFullScreen;
// ICNavigationController *navc = [[ICNavigationController alloc] initWithRootViewController:vc];
// navc.modalPresentationStyle = UIModalPresentationOverFullScreen;
// [self presentViewController:navc animated:true completion:nil];
WKClearPhotoViewController *vc = [[UIStoryboard storyboardWithName:@"Main" bundle: nil] instantiateViewControllerWithIdentifier:@"WKClearPhotoViewController"]; WKClearPhotoViewController *vc = [[UIStoryboard storyboardWithName:@"Main" bundle: nil] instantiateViewControllerWithIdentifier:@"WKClearPhotoViewController"];
vc.modalPresentationStyle = UIModalPresentationOverFullScreen; vc.modalPresentationStyle = UIModalPresentationOverFullScreen;
......
//
// ICManualCleanTableViewController.h
// superCleaner
//
// Created by Mazy on 2020/7/29.
// Copyright © 2020 Mazy. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface ICManualCleanTableViewController : UITableViewController
@end
NS_ASSUME_NONNULL_END
//
// ICManualCleanTableViewController.m
// superCleaner
//
// Created by Mazy on 2020/7/29.
// Copyright © 2020 Mazy. All rights reserved.
//
#import "ICManualCleanTableViewController.h"
#import <Photos/Photos.h>
#import "ICContactsViewController.h"
#import "ICPhotoManageViewController.h"
#import "ICIAPViewController.h"
#import "ICNavigationController.h"
#import "ICCalendarManageController.h"
@interface ICManualCleanTableViewController ()
@property (weak, nonatomic) IBOutlet UIView *photoContentView;
@property (weak, nonatomic) IBOutlet UIView *contactContentView;
@property (weak, nonatomic) IBOutlet UIView *calendarContentView;
@end
@implementation ICManualCleanTableViewController
- (void)viewDidLoad {
[super viewDidLoad];
_photoContentView.layer.cornerRadius = 12;
_contactContentView.layer.cornerRadius = 12;
_calendarContentView.layer.cornerRadius = 12;
[MobClick event:@"manual_cleanup"];
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:true animated:true];
}
- (IBAction)sureAndDismissAction:(UIButton *)sender {
[self.navigationController dismissViewControllerAnimated: true completion:nil];
}
#pragma mark - Table view data source
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
switch (indexPath.row) {
case 0: {
// 获取当前App的相册授权状态
PHAuthorizationStatus authorizationStatus = [PHPhotoLibrary authorizationStatus];
// 判断授权状态
if (authorizationStatus == PHAuthorizationStatusAuthorized) {
// 如果已经授权, 获取图片
ICPhotoManageViewController *managePhotoVC = [[ICPhotoManageViewController alloc] init];
[self.navigationController pushViewController:managePhotoVC animated:true];
}
// 如果没决定, 弹出指示框, 让用户选择
else if (authorizationStatus == PHAuthorizationStatusNotDetermined) {
[PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status) {
// 如果用户选择授权, 则获取图片
if (status == PHAuthorizationStatusAuthorized) {
dispatch_async(dispatch_get_main_queue(), ^{
ICPhotoManageViewController *managePhotoVC = [[ICPhotoManageViewController alloc] init];
[self.navigationController pushViewController:managePhotoVC animated:true];
});
}
}];
} else {
[self noticeAlert];
}
}
break;
case 1:
{
[MobClick event:@"contact_click"];
ICContactsViewController *contactVC = [[ICContactsViewController alloc] init];
[self.navigationController pushViewController:contactVC animated:true];
}
break;
case 2:
{
ICCalendarManageController *calendarVC = [[ICCalendarManageController alloc] init];
[self.navigationController pushViewController:calendarVC animated:true];
}
break;
default:
break;
}
}
// 开启权限提示
- (void)noticeAlert {
UIAlertController *alert =
[UIAlertController alertControllerWithTitle: ICLocalized(@"RequiresAlbumAuthorization") //@"此功能需要相册授权"
message: ICLocalized(@"PleaseTurnOnAuthorizationSwitch") //@"请您在设置系统中打开授权开关"
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *left = [UIAlertAction actionWithTitle: ICLocalized(@"Cancel") //@"取消"
style:UIAlertActionStyleCancel
handler:nil];
UIAlertAction *right = [UIAlertAction actionWithTitle: ICLocalized(@"GoToSet") //@"前往设置"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * _Nonnull action) {
NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
if (@available(iOS 10.0, *)) {
[[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
} else {
[[UIApplication sharedApplication] openURL:url];
}
}];
[alert addAction:left];
[alert addAction:right];
[self presentViewController:alert animated:YES completion:nil];
}
@end
...@@ -15,6 +15,8 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -15,6 +15,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, strong) NSArray<ICBasePhotoModel *> *similarArr; @property (nonatomic, strong) NSArray<ICBasePhotoModel *> *similarArr;
@property (nonatomic, assign) SimilarPhotoViewType photoType; @property (nonatomic, assign) SimilarPhotoViewType photoType;
@property (nonatomic, assign) NSInteger currentlocationGroudIndex;
@end @end
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
// self.navigationItem.title = @"屏幕截图"; self.navigationItem.title = @"屏幕截图";
self.itemSource = [NSMutableArray array]; self.itemSource = [NSMutableArray array];
...@@ -128,9 +128,15 @@ ...@@ -128,9 +128,15 @@
- (void)deleteSuccessWithTemDataArr:(NSMutableArray *)temDataArr { - (void)deleteSuccessWithTemDataArr:(NSMutableArray *)temDataArr {
self.itemSource = temDataArr; self.itemSource = temDataArr;
[self.collectionView reloadData]; [self.collectionView reloadData];
if (_photoType == LocationPhoto){
NSDictionary *dict = self.photoMgr.locationArray[_currentlocationGroudIndex];
NSDictionary * newDict = @{[[dict allKeys] firstObject]:temDataArr};
self.photoMgr.locationArray[_currentlocationGroudIndex] = newDict;
}else{
self.photoMgr.snapshotArray = temDataArr; self.photoMgr.snapshotArray = temDataArr;
}
[WKClearPhotoManager shareManager].notificationStatus = WKPhotoNotificationStatusNeed; [WKClearPhotoManager shareManager].notificationStatus = WKPhotoNotificationStatusNeed;
} }
- (void)configData { - (void)configData {
...@@ -150,25 +156,10 @@ ...@@ -150,25 +156,10 @@
model.isSelected = true; model.isSelected = true;
[self.itemSource addObject:model]; [self.itemSource addObject:model];
} }
// self.itemSource = [self.similarArr mutableCopy]; // self.itemSource = [self.similarArr mutableCopy];
[self.collectionView reloadData]; [self.collectionView reloadData];
} }
//- (NSMutableArray<WKPhotoInfoItem *> *)getNewestItems {
// NSMutableArray *itemArray = [NSMutableArray array];
// for (NSDictionary *dict in self.similarArr) {
// NSArray *arr = dict.allValues.lastObject;
// for (int i = 0; i < arr.count; i++) {
// NSDictionary *infoDict = arr[i];
// WKPhotoInfoItem *item = [[WKPhotoInfoItem alloc] initWithDict:infoDict];
// [itemArray addObject:item];
// }
// }
// return itemArray;
//}
//
- (void) checkDeleteButtonIsNeedShow { - (void) checkDeleteButtonIsNeedShow {
NSMutableArray *assetArr = [NSMutableArray array]; NSMutableArray *assetArr = [NSMutableArray array];
for (ICBasePhotoModel *model in self.itemSource) { for (ICBasePhotoModel *model in self.itemSource) {
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#import "ICPhotoLocationViewController.h" #import "ICPhotoLocationViewController.h"
#import "WKClearPhotoManager.h" #import "WKClearPhotoManager.h"
#import "ICLocationPhotoListViewCell.h" #import "ICLocationPhotoListViewCell.h"
#import "WKPhotoInfoItem.h"
#import "ICNormalPhotoViewController.h" #import "ICNormalPhotoViewController.h"
#import "UIView+DHExtension.h" #import "UIView+DHExtension.h"
...@@ -49,19 +48,11 @@ ...@@ -49,19 +48,11 @@
- (void)viewWillAppear:(BOOL)animated{ - (void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated]; [super viewWillAppear:animated];
// if (first) { if (first) {
// first = NO; first = NO;
// }else{ }else{
// [self loadLocationAssets];
// }
}
- (void)loadLocationAssets {
[self.photoMgr loadLocationPhotoWithProcess:^(NSInteger current, NSInteger total) {
} completionHandler:^(BOOL success, NSError *error) {
[self.collectionView reloadData]; [self.collectionView reloadData];
}]; }
} }
#pragma mark - UICollectionViewDataSource,UICollectionViewDelegate #pragma mark - UICollectionViewDataSource,UICollectionViewDelegate
...@@ -94,7 +85,7 @@ ...@@ -94,7 +85,7 @@
for (NSArray *models in dict.allValues) { for (NSArray *models in dict.allValues) {
[items addObjectsFromArray:models]; [items addObjectsFromArray:models];
} }
vc.currentlocationGroudIndex = indexPath.row;
vc.similarArr = items; vc.similarArr = items;
vc.photoType = LocationPhoto; vc.photoType = LocationPhoto;
[self.navigationController pushViewController:vc animated:YES]; [self.navigationController pushViewController:vc animated:YES];
...@@ -116,8 +107,6 @@ ...@@ -116,8 +107,6 @@
collectionViewLayout:layout]; collectionViewLayout:layout];
_collectionView.dataSource = self; _collectionView.dataSource = self;
_collectionView.delegate = self; _collectionView.delegate = self;
// [_collectionView registerClass:[WKSimilarPhotoCell class]
// forCellWithReuseIdentifier:@"WKSimilarPhotoCell_id"];
[_collectionView registerNib:[UINib nibWithNibName:@"ICLocationPhotoListViewCell" bundle:nil] forCellWithReuseIdentifier:@"ICLocationPhotoListViewCell"]; [_collectionView registerNib:[UINib nibWithNibName:@"ICLocationPhotoListViewCell" bundle:nil] forCellWithReuseIdentifier:@"ICLocationPhotoListViewCell"];
_collectionView.backgroundColor = [UIColor whiteColor]; _collectionView.backgroundColor = [UIColor whiteColor];
......
...@@ -275,24 +275,29 @@ ...@@ -275,24 +275,29 @@
__weak typeof(self) weakSelf = self; __weak typeof(self) weakSelf = self;
[self.photoMgr loadPhotoWithProcess:^(NSInteger current, NSInteger total) { [self.photoMgr loadPhotoWithProcess:^(NSInteger current, NSInteger total) {
ICContactManageViewCell *cell = [weakSelf.tableView cellForRowAtIndexPath:[ NSIndexPath indexPathForRow:0 inSection:0]];
cell.countLabel.text = [NSString stringWithFormat:@"%lu", (unsigned long)self.photoMgr.snapshotArray.count];
NSInteger similarLiveCount = 0; NSInteger similarLiveCount = 0;
for (NSArray *items in self.photoMgr.similarLiveArray) { for (NSArray *items in self.photoMgr.similarLiveArray) {
similarLiveCount += items.count; similarLiveCount += items.count;
} }
ICContactManageViewCell *cell1 = [weakSelf.tableView cellForRowAtIndexPath:[ NSIndexPath indexPathForRow:4 inSection:0]];
cell1.countLabel.text = [NSString stringWithFormat:@"%lu", (unsigned long)similarLiveCount];
cell1.progressView.strokeStart = ((CGFloat)similarLiveCount / (CGFloat)(total / 2));
NSInteger similarCount = 0; NSInteger similarCount = 0;
for (NSArray *items in self.photoMgr.similarArray) { for (NSArray *items in self.photoMgr.similarArray) {
similarCount += items.count; similarCount += items.count;
} }
CGFloat f = (similarCount+similarLiveCount+self.photoMgr.snapshotArray.count+self.photoMgr.locationArray.count) != 0 ? similarCount/(float)(similarCount+similarLiveCount+self.photoMgr.snapshotArray.count+self.photoMgr.locationArray.count) : 0;
CGFloat ff = (similarCount+similarLiveCount+self.photoMgr.snapshotArray.count+self.photoMgr.locationArray.count) != 0 ? similarLiveCount/(float)(similarCount+similarLiveCount+self.photoMgr.snapshotArray.count+self.photoMgr.locationArray.count) : 0;
ICContactManageViewCell *cell = [weakSelf.tableView cellForRowAtIndexPath:[ NSIndexPath indexPathForRow:0 inSection:0]];
cell.countLabel.text = [NSString stringWithFormat:@"%lu", (unsigned long)self.photoMgr.snapshotArray.count];
ICContactManageViewCell *cell1 = [weakSelf.tableView cellForRowAtIndexPath:[ NSIndexPath indexPathForRow:4 inSection:0]];
cell1.countLabel.text = [NSString stringWithFormat:@"%lu", (unsigned long)similarLiveCount];
cell1.progressView.strokeStart = ff;
ICContactManageViewCell *cell2 = [weakSelf.tableView cellForRowAtIndexPath:[ NSIndexPath indexPathForRow:2 inSection:0]]; ICContactManageViewCell *cell2 = [weakSelf.tableView cellForRowAtIndexPath:[ NSIndexPath indexPathForRow:2 inSection:0]];
cell2.countLabel.text = [NSString stringWithFormat:@"%lu", (unsigned long)similarCount]; cell2.countLabel.text = [NSString stringWithFormat:@"%lu", (unsigned long)similarCount];
cell2.progressView.strokeStart = ((CGFloat)similarCount / (CGFloat)(total / 2)); cell2.progressView.strokeStart = f;
ICContactManageViewCell *cell3 = [weakSelf.tableView cellForRowAtIndexPath:[ NSIndexPath indexPathForRow:1 inSection:0]]; ICContactManageViewCell *cell3 = [weakSelf.tableView cellForRowAtIndexPath:[ NSIndexPath indexPathForRow:1 inSection:0]];
cell3.countLabel.text = [NSString stringWithFormat:@"%lu", (unsigned long)self.photoMgr.locationArray.count]; cell3.countLabel.text = [NSString stringWithFormat:@"%lu", (unsigned long)self.photoMgr.locationArray.count];
...@@ -320,7 +325,6 @@ ...@@ -320,7 +325,6 @@
self.similarPhotoArray = self.photoMgr.similarArray; self.similarPhotoArray = self.photoMgr.similarArray;
self.similarLiveArray = self.photoMgr.similarLiveArray; self.similarLiveArray = self.photoMgr.similarLiveArray;
[self loadLocationAssets]; [self loadLocationAssets];
[self.tableView reloadData]; [self.tableView reloadData];
}]; }];
} else if (self.photoMgr.currentIndex >= self.photoMgr.fetchResult.count-3) { } else if (self.photoMgr.currentIndex >= self.photoMgr.fetchResult.count-3) {
...@@ -330,6 +334,13 @@ ...@@ -330,6 +334,13 @@
[self.headerView.startTimeButton setTitle:[self stringWithDate: asset.creationDate] forState:UIControlStateNormal]; [self.headerView.startTimeButton setTitle:[self stringWithDate: asset.creationDate] forState:UIControlStateNormal];
} }
if (self.photoMgr.similarLiveArray.count) {
}
if (self.photoMgr.similarArray.count) {
}
ICContactManageViewCell *cell = [self.tableView cellForRowAtIndexPath:[ NSIndexPath indexPathForRow:0 inSection:0]]; ICContactManageViewCell *cell = [self.tableView cellForRowAtIndexPath:[ NSIndexPath indexPathForRow:0 inSection:0]];
cell.countLabel.text = [NSString stringWithFormat:@"%lu", (unsigned long)self.photoMgr.snapshotArray.count]; cell.countLabel.text = [NSString stringWithFormat:@"%lu", (unsigned long)self.photoMgr.snapshotArray.count];
...@@ -357,8 +368,6 @@ ...@@ -357,8 +368,6 @@
return; return;
} else { } else {
self.photoMgr.pauseAction = true; self.photoMgr.pauseAction = true;
// NSDate *lastYear = [[NSCalendar currentCalendar] dateByAddingUnit:NSCalendarUnitYear value:-1 toDate:[NSDate date] options:NSCalendarWrapComponents];
// self.photoMgr.startDate = lastYear;
__weak typeof(self) weakSelf = self; __weak typeof(self) weakSelf = self;
[self.photoMgr loadPhotoWithProcess:^(NSInteger current, NSInteger total) { [self.photoMgr loadPhotoWithProcess:^(NSInteger current, NSInteger total) {
...@@ -367,24 +376,29 @@ ...@@ -367,24 +376,29 @@
[self.headerView.startTimeButton setTitle:[self stringWithDate: asset.creationDate] forState:UIControlStateNormal]; [self.headerView.startTimeButton setTitle:[self stringWithDate: asset.creationDate] forState:UIControlStateNormal];
} }
ICContactManageViewCell *cell = [weakSelf.tableView cellForRowAtIndexPath:[ NSIndexPath indexPathForRow:0 inSection:0]];
cell.countLabel.text = [NSString stringWithFormat:@"%lu", (unsigned long)self.photoMgr.snapshotArray.count];
NSInteger similarLiveCount = 0; NSInteger similarLiveCount = 0;
for (NSArray *items in self.photoMgr.similarLiveArray) { for (NSArray *items in self.photoMgr.similarLiveArray) {
similarLiveCount += items.count; similarLiveCount += items.count;
} }
ICContactManageViewCell *cell1 = [weakSelf.tableView cellForRowAtIndexPath:[ NSIndexPath indexPathForRow:4 inSection:0]];
cell1.countLabel.text = [NSString stringWithFormat:@"%lu", (unsigned long)similarLiveCount];
cell1.progressView.strokeStart = ((CGFloat)similarLiveCount / (CGFloat)(total / 2));
NSInteger similarCount = 0; NSInteger similarCount = 0;
for (NSArray *items in self.photoMgr.similarArray) { for (NSArray *items in self.photoMgr.similarArray) {
similarCount += items.count; similarCount += items.count;
} }
CGFloat f = (similarCount+similarLiveCount+self.photoMgr.snapshotArray.count+self.photoMgr.locationArray.count) != 0 ? similarCount/(float)(similarCount+similarLiveCount+self.photoMgr.snapshotArray.count+self.photoMgr.locationArray.count) : 0;
CGFloat ff = (similarCount+similarLiveCount+self.photoMgr.snapshotArray.count+self.photoMgr.locationArray.count) != 0 ? similarLiveCount/(float)(similarCount+similarLiveCount+self.photoMgr.snapshotArray.count+self.photoMgr.locationArray.count) : 0;
ICContactManageViewCell *cell = [weakSelf.tableView cellForRowAtIndexPath:[ NSIndexPath indexPathForRow:0 inSection:0]];
cell.countLabel.text = [NSString stringWithFormat:@"%lu", (unsigned long)self.photoMgr.snapshotArray.count];
ICContactManageViewCell *cell1 = [weakSelf.tableView cellForRowAtIndexPath:[ NSIndexPath indexPathForRow:4 inSection:0]];
cell1.countLabel.text = [NSString stringWithFormat:@"%lu", (unsigned long)similarLiveCount];
cell1.progressView.strokeStart = ff;
ICContactManageViewCell *cell2 = [weakSelf.tableView cellForRowAtIndexPath:[ NSIndexPath indexPathForRow:2 inSection:0]]; ICContactManageViewCell *cell2 = [weakSelf.tableView cellForRowAtIndexPath:[ NSIndexPath indexPathForRow:2 inSection:0]];
cell2.countLabel.text = [NSString stringWithFormat:@"%lu", (unsigned long)similarCount]; cell2.countLabel.text = [NSString stringWithFormat:@"%lu", (unsigned long)similarCount];
cell2.progressView.strokeStart = ((CGFloat)similarCount / (CGFloat)(total / 2)); cell2.progressView.strokeStart = f;
ICContactManageViewCell *cell3 = [weakSelf.tableView cellForRowAtIndexPath:[ NSIndexPath indexPathForRow:1 inSection:0]]; ICContactManageViewCell *cell3 = [weakSelf.tableView cellForRowAtIndexPath:[ NSIndexPath indexPathForRow:1 inSection:0]];
cell3.countLabel.text = [NSString stringWithFormat:@"%lu", (unsigned long)self.photoMgr.locationArray.count]; cell3.countLabel.text = [NSString stringWithFormat:@"%lu", (unsigned long)self.photoMgr.locationArray.count];
...@@ -408,6 +422,7 @@ ...@@ -408,6 +422,7 @@
cell1.progressView.strokeStart = 0; cell1.progressView.strokeStart = 0;
cell2.progressView.strokeStart = 0; cell2.progressView.strokeStart = 0;
}); });
self.screenshotArray = self.photoMgr.snapshotArray; self.screenshotArray = self.photoMgr.snapshotArray;
self.similarPhotoArray = self.photoMgr.similarArray; self.similarPhotoArray = self.photoMgr.similarArray;
self.similarLiveArray = self.photoMgr.similarLiveArray; self.similarLiveArray = self.photoMgr.similarLiveArray;
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
@interface WKClearPhotoViewController : ICBaseViewController @interface WKClearPhotoViewController : ICBaseViewController
@property (weak, nonatomic) IBOutlet UILabel *progressLabel; @property (weak, nonatomic) IBOutlet UILabel *progressLabel;
@end @end
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
// //
#import "WKClearPhotoViewController.h" #import "WKClearPhotoViewController.h"
#import "WKClearPhotoCell.h"
#import "WKClearPhotoManager.h" #import "WKClearPhotoManager.h"
#import "MBProgressHUD.h" #import "MBProgressHUD.h"
#import "WKSimilarPhotoViewController.h" #import "WKSimilarPhotoViewController.h"
...@@ -32,10 +31,6 @@ ...@@ -32,10 +31,6 @@
@property (weak, nonatomic) IBOutlet UILabel *processTipLabel; @property (weak, nonatomic) IBOutlet UILabel *processTipLabel;
@property (weak, nonatomic) IBOutlet UIView *sepratorLineView; @property (weak, nonatomic) IBOutlet UIView *sepratorLineView;
@property (weak, nonatomic) IBOutlet UILabel *topLeftTitleLabel;
@property (weak, nonatomic) IBOutlet UIView *progressContentView;
@property (weak, nonatomic) IBOutlet UIButton *cancelButton;
@property (weak, nonatomic) IBOutlet UIButton *pauseButton; @property (weak, nonatomic) IBOutlet UIButton *pauseButton;
@property (weak, nonatomic) IBOutlet UILabel *snapshotCountLabel; @property (weak, nonatomic) IBOutlet UILabel *snapshotCountLabel;
...@@ -50,8 +45,6 @@ ...@@ -50,8 +45,6 @@
@property (weak, nonatomic) IBOutlet UIButton *similarPhotoSelectBtn; @property (weak, nonatomic) IBOutlet UIButton *similarPhotoSelectBtn;
@property (weak, nonatomic) IBOutlet UIButton *similarVideoSelectBtn; @property (weak, nonatomic) IBOutlet UIButton *similarVideoSelectBtn;
@property (weak, nonatomic) IBOutlet UIImageView *centerImageView;
@property (nonatomic, strong) LXCircle *progressView; @property (nonatomic, strong) LXCircle *progressView;
@property (weak, nonatomic) IBOutlet UIView * topView; @property (weak, nonatomic) IBOutlet UIView * topView;
...@@ -60,7 +53,6 @@ ...@@ -60,7 +53,6 @@
@property (weak, nonatomic) IBOutlet NSLayoutConstraint * topHeight; @property (weak, nonatomic) IBOutlet NSLayoutConstraint * topHeight;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint * cellHeight; @property (weak, nonatomic) IBOutlet NSLayoutConstraint * cellHeight;
@end @end
@implementation WKClearPhotoViewController @implementation WKClearPhotoViewController
...@@ -202,12 +194,7 @@ ...@@ -202,12 +194,7 @@
self.livePhotoContentView.hidden = true; self.livePhotoContentView.hidden = true;
self.similarPhotoContentView.hidden = true; self.similarPhotoContentView.hidden = true;
self.similarVideoContentView.hidden = true; self.similarVideoContentView.hidden = true;
self.progressContentView.hidden = false;
self.centerImageView.hidden = false;
self.topLeftTitleLabel.hidden = true;
self.pauseButton.hidden = true; self.pauseButton.hidden = true;
self.cancelButton.hidden = true;
self.clearAllButton.hidden = true; self.clearAllButton.hidden = true;
self.sepratorLineView.hidden = true; self.sepratorLineView.hidden = true;
self.progressView.hidden = true; self.progressView.hidden = true;
...@@ -229,13 +216,8 @@ ...@@ -229,13 +216,8 @@
self.livePhotoContentView.hidden = false; self.livePhotoContentView.hidden = false;
self.similarPhotoContentView.hidden = false; self.similarPhotoContentView.hidden = false;
self.similarVideoContentView.hidden = true; self.similarVideoContentView.hidden = true;
self.progressContentView.hidden = false;
self.progressContentView.hidden = true;
self.pauseButton.hidden = true; self.pauseButton.hidden = true;
self.cancelButton.hidden = false;
self.clearAllButton.hidden = false; self.clearAllButton.hidden = false;
self.topLeftTitleLabel.hidden = false;
self.stepTipLabel.hidden = true; self.stepTipLabel.hidden = true;
self.processTipLabel.hidden = true; self.processTipLabel.hidden = true;
self.sepratorLineView.hidden = true; self.sepratorLineView.hidden = true;
...@@ -257,18 +239,11 @@ ...@@ -257,18 +239,11 @@
[WKClearPhotoManager tipWithMessage:ICLocalized(@"DeleteSuccess")]; [WKClearPhotoManager tipWithMessage:ICLocalized(@"DeleteSuccess")];
self.centerImageView.hidden = false;
self.centerImageView.image = [UIImage imageNamed:@"photo_clear_finish_icon"];
self.topLeftTitleLabel.hidden = true;
self.pauseButton.hidden = true; self.pauseButton.hidden = true;
self.cancelButton.hidden = true;
self.sepratorLineView.hidden = true; self.sepratorLineView.hidden = true;
self.progressView.hidden = true; self.progressView.hidden = true;
self.clearAllButton.hidden = false; self.clearAllButton.hidden = false;
[self.clearAllButton removeTarget:nil action:NULL forControlEvents:UIControlEventAllEvents]; [self.clearAllButton removeTarget:nil action:NULL forControlEvents:UIControlEventAllEvents];
[self.clearAllButton setTitle:ICLocalized(@"ItsCool") forState: UIControlStateNormal]; [self.clearAllButton setTitle:ICLocalized(@"ItsCool") forState: UIControlStateNormal];
self.stepTipLabel.hidden = false; self.stepTipLabel.hidden = false;
self.processTipLabel.hidden = false; self.processTipLabel.hidden = false;
...@@ -381,7 +356,6 @@ ...@@ -381,7 +356,6 @@
[weakSelf updateUI]; [weakSelf updateUI];
if (self.photoMgr.fetchResult.count <= 0) { if (self.photoMgr.fetchResult.count <= 0) {
self.topLeftTitleLabel.text = ICLocalized(@"CleaningPaused"); //@"清理已暂停";
[self.clearAllButton setTitle:ICLocalized(@"ContinueSearching") forState:UIControlStateNormal]; [self.clearAllButton setTitle:ICLocalized(@"ContinueSearching") forState:UIControlStateNormal];
self.stepTipLabel.text = ICLocalized(@"NoFilesRemove"); //@"无文件可删除"; self.stepTipLabel.text = ICLocalized(@"NoFilesRemove"); //@"无文件可删除";
self.processTipLabel.text = ICLocalized(@"ContinueSearching"); //@"什么也没找到,继续搜索。"; self.processTipLabel.text = ICLocalized(@"ContinueSearching"); //@"什么也没找到,继续搜索。";
......
...@@ -327,8 +327,10 @@ ...@@ -327,8 +327,10 @@
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
ICPhotoViewerController *viewer = [[UIStoryboard storyboardWithName:@"Main" bundle: nil] instantiateViewControllerWithIdentifier:@"ICPhotoViewerController"]; ICPhotoViewerController *viewer = [[UIStoryboard storyboardWithName:@"Main" bundle: nil] instantiateViewControllerWithIdentifier:@"ICPhotoViewerController"];
viewer.itemSource = self.modelArray; // viewer.itemSource = self.modelArray;
NSArray *arr = self.itemSource[indexPath.section]; NSArray *arr = self.itemSource[indexPath.section];
viewer.currentIndex = indexPath.row;
viewer.itemSource = arr.mutableCopy;
ICBasePhotoModel *item = arr[indexPath.row]; ICBasePhotoModel *item = arr[indexPath.row];
viewer.photoItem = item; viewer.photoItem = item;
viewer.photoType = self.photoType; viewer.photoType = self.photoType;
......
//
// WKClearPhotoCell.h
// WuKongClearPhotoDemo
//
// Created by ZhangJingHao2345 on 2018/3/8.
// Copyright © 2018年 ZhangJingHao2345. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "WKClearPhotoItem.h"
@interface WKClearPhotoCell : UITableViewCell
- (void)bindWithMode:(WKClearPhotoItem *)item;
@end
//
// WKClearPhotoCell.m
// WuKongClearPhotoDemo
//
// Created by ZhangJingHao2345 on 2018/3/8.
// Copyright © 2018年 ZhangJingHao2345. All rights reserved.
//
#import "WKClearPhotoCell.h"
@interface WKClearPhotoCell ()
@end
@implementation WKClearPhotoCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
self.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
return self;
}
- (void)bindWithMode:(WKClearPhotoItem *)item {
self.textLabel.text = item.name;
self.detailTextLabel.text = [NSString stringWithFormat:@"%@ 可省 %@", item.detail, item.saveStr];
}
@end
...@@ -13,22 +13,21 @@ class GSPregressView: UIView { ...@@ -13,22 +13,21 @@ class GSPregressView: UIView {
@IBInspectable public var strokeColor: UIColor = UIColor(red: 39/255.0, green: 197/255.0, blue: 158/255.0, alpha: 0.1) { @IBInspectable public var strokeColor: UIColor = UIColor(red: 39/255.0, green: 197/255.0, blue: 158/255.0, alpha: 0.1) {
didSet { didSet {
// self.colorMaskLayer.strokeColor = strokeColor.cgColor // self.colorMaskLayer.strokeColor = strokeColor.cgColor
self.colorMaskLayer.strokeColor = massColor.cgColor self.backgroundColor = massColor.withAlphaComponent(0.15)
} }
} }
@IBInspectable public var strokeStart: CGFloat = 1 { @IBInspectable public var strokeStart: CGFloat = 1 {
didSet { didSet {
self.colorMaskLayer.strokeEnd = strokeStart self.colorMaskLayer.frame = CGRect.init(x: 0, y: 0, width: self.frame.size.width*strokeStart, height: self.frame.size.height)
} }
} }
private lazy var colorMaskLayer = CAShapeLayer() @objc var colorMaskLayer = CAGradientLayer()
override init(frame: CGRect) { override init(frame: CGRect) {
super.init(frame: frame) super.init(frame: frame)
setupColorMaskLayer() setupColorMaskLayer()
} }
required init?(coder aDecoder: NSCoder) { required init?(coder aDecoder: NSCoder) {
...@@ -37,29 +36,19 @@ class GSPregressView: UIView { ...@@ -37,29 +36,19 @@ class GSPregressView: UIView {
} }
/// 设置遮挡图层 /// 设置遮挡图层
fileprivate func generateMaskLayer() -> CAShapeLayer { fileprivate func generateMaskLayer() -> CAGradientLayer {
let maskLayer = CAShapeLayer() let maskLayer = CAGradientLayer()
maskLayer.lineWidth = bounds.height maskLayer.frame = CGRect.zero
let path = UIBezierPath() maskLayer.colors = [massColor.cgColor, massColor.cgColor]
path.move(to: CGPoint(x: 0, y: bounds.height * 0.5)) maskLayer.startPoint = CGPoint.init(x: 0, y: 0)
path.addLine(to: CGPoint(x: self.frame.width, y: bounds.height * 0.5)) maskLayer.endPoint = CGPoint.init(x: 1, y: 0.5)
maskLayer.path = path.cgPath maskLayer.cornerRadius = self.layer.cornerRadius;
maskLayer.fillColor = self.strokeColor.cgColor //UIColor.clear.cgColor // 填充色为透明
maskLayer.strokeColor = UIColor.red.cgColor //self.strokeColor.cgColor
return maskLayer return maskLayer
} }
/// 设置颜色遮挡图层 /// 设置颜色遮挡图层
fileprivate func setupColorMaskLayer() { fileprivate func setupColorMaskLayer() {
let colorMaskLayer = generateMaskLayer() colorMaskLayer = generateMaskLayer()
// self.layer.addSublayer(colorMaskLayer)
layer.insertSublayer(colorMaskLayer, at: 0) layer.insertSublayer(colorMaskLayer, at: 0)
self.colorMaskLayer = colorMaskLayer
self.colorMaskLayer.strokeStart = 0
self.colorMaskLayer.strokeEnd = 1
}
/// 动画
@objc func animationWithStrokeEnd(strokeEnd: CGFloat) {
self.colorMaskLayer.strokeEnd = strokeEnd //1 - strokeEnd
} }
} }
...@@ -12,6 +12,6 @@ ...@@ -12,6 +12,6 @@
-(instancetype)initWithFrame:(CGRect)frame lineWidth:(CGFloat)lineWidth; -(instancetype)initWithFrame:(CGRect)frame lineWidth:(CGFloat)lineWidth;
@property(nonatomic,assign)CGFloat progress; @property(nonatomic, assign) CGFloat progress;
@end @end
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string> <string>zh_CN</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string> <string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
......
...@@ -181,3 +181,8 @@ ...@@ -181,3 +181,8 @@
"ManageReminders" = "管理提醒"; "ManageReminders" = "管理提醒";
"ManageCalendar" = "日历管理"; "ManageCalendar" = "日历管理";
"Manage" = "管理"; "Manage" = "管理";
"NoSimilarMotionPhoto" = "无相似照片";
"NoSimilarPhoto" = "无相似动态照片";
"NoSimilarVideo" = "无相似视频";
"NoSimilarMotionPhoto" = "无相似连拍照片";
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment