Commit 6e9fa4c3 authored by yqz's avatar yqz

111

parent e8a0ce1e
......@@ -124,6 +124,10 @@ class BaseNavViewController:UINavigationController ,UIGestureRecognizerDelegate
super.pushViewController(viewController, animated: animated)
}
override var childForStatusBarStyle: UIViewController?{
return topViewController
}
deinit {
NotificationCenter.default.removeObserver(self)
......
......@@ -135,7 +135,7 @@ class AdvTipDeleteView : UIView {
override init(frame: CGRect) {
super.init(frame: frame)
self.backgroundColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.5000)
// self.backgroundColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.5000)
self.addSubview(self.tipView)
self.tipView.addSubview(self.closeButton)
self.tipView.addSubview(self.tipTitle)
......@@ -196,7 +196,7 @@ class AdvTipDeleteView : UIView {
}
override func removeFromSuperview() {
UIView.animate(withDuration: 0.2) {
UIView.animate(withDuration: AniDuration) {
// 更新约束
self.backgroundColor = .clear
self.centerYConstraint?.update(offset: self.height + 205)
......@@ -278,9 +278,9 @@ extension AdvTipDeleteView : UICollectionViewDataSource, UICollectionViewDelegat
}
// 先显示背景,然后延迟显示弹框
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.01) {
UIView.animate(withDuration: 0.2) {
UIView.animate(withDuration: AniDuration) {
// 更新约束
self.centerYConstraint?.update(offset: 0)
self.layoutIfNeeded()
......@@ -322,6 +322,7 @@ extension AdvTipDeleteView : UICollectionViewDataSource, UICollectionViewDelegat
@objc func closeButtonAction(){
deleteButtonClickCallback(false,-10)
self.removeFromSuperview()
}
......
......@@ -29,14 +29,10 @@ struct AdvTipSelectModel {
}
class AdvTipSelectView : UIView {
class AdvTipSelectView : UIViewController {
var selectClickCallback : (Bool)->Void = {isSrue in }
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
var selectType : TipSelectType?
......@@ -53,8 +49,6 @@ class AdvTipSelectView : UIView {
return view
}()
lazy var closeButton : UIButton = {
let view = UIButton(type: .custom)
view.setImage(UIImage(named: "icon_close_pop_purple"), for: .normal)
......@@ -121,12 +115,14 @@ class AdvTipSelectView : UIView {
}()
override init(frame: CGRect) {
super.init(frame: frame)
self.backgroundColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.5000)
self.addSubview(self.tipView)
override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = .clear
setup()
}
func setup() -> Void {
self.view.addSubview(self.tipView)
self.tipView.addSubview(self.closeButton)
self.tipView.addSubview(self.logoView)
self.tipView.addSubview(self.tipTitle)
......@@ -142,7 +138,8 @@ class AdvTipSelectView : UIView {
make.centerX.equalToSuperview()
make.width.equalTo(345)
make.height.equalTo(432)
centerYConstraint = make.centerY.equalToSuperview().offset(self.height + 220).constraint
make.centerY.equalToSuperview()
// centerYConstraint = make.centerY.equalToSuperview().offset(self.height + 220).constraint
}
self.closeButton.snp.makeConstraints { make in
......@@ -184,25 +181,28 @@ class AdvTipSelectView : UIView {
}
// 先显示背景,然后延迟显示弹框
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
UIView.animate(withDuration: 0.1) {
// 更新约束
self.centerYConstraint?.update(offset: 0)
self.layoutIfNeeded()
}
}
// DispatchQueue.main.asyncAfter(deadline: .now() + 0.01) {
// UIView.animate(withDuration: 0.4) {
// // 更新约束
// self.centerYConstraint?.update(offset: 0)
// self.layoutIfNeeded()
// }
// }
}
override func removeFromSuperview() {
UIView.animate(withDuration: 0.2) {
// 更新约束
self.backgroundColor = .clear
self.centerYConstraint?.update(offset: self.height + 220)
self.layoutIfNeeded()
}completion: { _ in
super.removeFromSuperview()
}
}
// override func removeFromSuperview() {
// UIView.animate(withDuration: AniDuration) {
// // 更新约束
//// self.backgroundColor = .clear
//// self.centerYConstraint?.update(offset: self.height + 220)
//// self.layoutIfNeeded()
// var frame = self.bounds
// frame.origin.y = frame.height
// self.frame = frame
// }completion: { _ in
// super.removeFromSuperview()
// }
// }
}
......@@ -238,14 +238,16 @@ extension AdvTipSelectView{
self.secondButton.setTitle(self.tipSelectModel?.deleteLessText, for: .normal)
}
@objc func closeButtonAction(){
self.removeFromSuperview()
self.selectClickCallback(false)
// self.removeFromSuperview()
}
@objc func buttonSureSelectAction(){
self.selectClickCallback(true)
self.removeFromSuperview()
// self.removeFromSuperview()
}
@objc func buttonCancelSelectAction(){
self.removeFromSuperview()
self.selectClickCallback(false)
// self.removeFromSuperview()
}
}
......@@ -67,15 +67,20 @@ class ChargeInfoViewController:BaseViewController {
// 再次判断下
if IAPManager.share.isSubscribed == false {
// 弹出提示框
let alertView = AdvTipSelectView(frame: self.view.bounds)
let alertView = AdvTipSelectView()
alertView.selectType = .selectTypeSetAnimation
alertView.getOtherInfoByType()
self.view.addSubview(alertView)
alertView.modalPresentationStyle = .overFullScreen
self.view.showBlur()
self.present(alertView, animated: true)
alertView.selectClickCallback = {isSure in
self.popAdverTisement()
AdvManager.shared.finisedCallBack = {
self.setAnimation()
alertView.dismiss(animated: true)
self.view.hideBlur()
if isSure {
self.popAdverTisement()
AdvManager.shared.finisedCallBack = {
self.setAnimation()
}
}
}
}else{
......@@ -230,5 +235,5 @@ class ChargeInfoViewController:BaseViewController {
func popAdverTisement(){
AdvManager.shared.showInterstitialAd(vc: self)
}
}
......@@ -315,15 +315,22 @@ extension CompressController:WaterfallMutiSectionDelegate,UICollectionViewDataSo
HomePayViewController.show {
if IAPManager.share.isSubscribed == false{
// 弹出提示框
let alertView = AdvTipSelectView(frame: self.view.bounds)
self.view.showBlur()
var frame = self.view.bounds
frame.origin.y = frame.height
let alertView = AdvTipSelectView()
alertView.selectType = .selectTypeCompressPhoto
alertView.getOtherInfoByType()
self.view.addSubview(alertView)
alertView.modalPresentationStyle = .overFullScreen
self.present(alertView, animated: true)
alertView.selectClickCallback = {isSure in
self.popAdverTisement()
AdvManager.shared.finisedCallBack = {
self.jumpToNextPage()
self.view.hideBlur()
alertView.dismiss(animated: true)
if isSure {
self.popAdverTisement()
AdvManager.shared.finisedCallBack = {
self.jumpToNextPage()
}
}
}
}else {
......
......@@ -53,7 +53,7 @@ class ContactAllViewController : BaseViewController {
}
}
override func viewDidLoad() {
super.viewDidLoad()
......
......@@ -235,7 +235,11 @@ extension ContactBackupDetailViewController:UITableViewDelegate,UITableViewDataS
func alertRestore() {
// 是否确实需要恢复
let alertVc = ContactBacRestoreAlertView(frame: self.view.bounds)
alertVc.alpha = 0
self.view.addSubview(alertVc)
UIView.animate(withDuration: AniDuration - 0.2) {
alertVc.alpha = 1
}
alertVc.sureCallBack = {
ContactManager.performAtomicRestore(self.dataSourceModel) { success, error in
if success {
......
......@@ -84,6 +84,10 @@ class ContactBackupViewController : BaseViewController {
// 再次请求数据 重新刷新页面
let buAlertVc = ContactBackUpCompletedAlertView(frame: self.view.bounds)
self.view.addSubview(buAlertVc)
buAlertVc.alpha = 0
UIView.animate(withDuration: AniDuration - 0.2) {
buAlertVc.alpha = 1
}
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
buAlertVc.removeFromSuperview()
self.updateCurrentPageData()
......@@ -93,6 +97,10 @@ class ContactBackupViewController : BaseViewController {
}else {
let buAlertVc = ContactBackUpNoDataAlertView(frame: (cWindow?.bounds)!)
cWindow?.addSubview(buAlertVc)
buAlertVc.alpha = 0
UIView.animate(withDuration: AniDuration - 0.2) {
buAlertVc.alpha = 1
}
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
buAlertVc.removeFromSuperview()
}
......
......@@ -272,18 +272,43 @@ extension ContactAllView : UITableViewDataSource,UITableViewDelegate {
func alertWhenDeleteSomeOne() {
// 删除之前弹出是否需要备份
let alertVc = ContactBackupAlertView()
alertVc.frame = (self.responderViewController()?.view.bounds)!
self.responderViewController()?.view.showBlur()
self.responderViewController()?.view.addSubview(alertVc)
alertVc.frame = CGRectMake(0, ScreenH, ScreenW, ScreenH)
UIView.animate(withDuration: AniDuration) {
alertVc.frame = CGRectMake(0, 0, ScreenW, ScreenH)
}
alertVc.sureCallBack = {[weak self] isSure in
guard let self else {return}
if isSure {
backupContactsByselect {
self.responderViewController()?.view.hideBlur()
DispatchQueue.main.asyncAfter(deadline: .now() + AniDuration) {
if isSure {
self.backupContactsByselect {
// 删除之前弹出是否真的需要删除
let alertVc = ContactDeleteAlertView()
alertVc.frame = (self.responderViewController()?.view.bounds)!
alertVc.alpha = 0
cWindow?.addSubview(alertVc)
UIView.animate(withDuration: AniDuration - 0.2) {
alertVc.alpha = 1
}
alertVc.sureCallBack = {[weak self] isSure in
guard let self else {return}
if isSure {
// 提示是否删除
self.deleteContacts()
}
}
}
}else{
// 删除之前弹出是否真的需要删除
let alertVc = ContactDeleteAlertView()
alertVc.frame = (self.responderViewController()?.view.bounds)!
cWindow?.addSubview(alertVc)
alertVc.alpha = 0
UIView.animate(withDuration: AniDuration - 0.2) {
alertVc.alpha = 1
}
alertVc.sureCallBack = {[weak self] isSure in
guard let self else {return}
if isSure {
......@@ -292,19 +317,6 @@ extension ContactAllView : UITableViewDataSource,UITableViewDelegate {
}
}
}
}else{
// 删除之前弹出是否真的需要删除
let alertVc = ContactDeleteAlertView()
alertVc.frame = (self.responderViewController()?.view.bounds)!
cWindow?.addSubview(alertVc)
alertVc.sureCallBack = {[weak self] isSure in
guard let self else {return}
if isSure {
// 提示是否删除
self.deleteContacts()
}
}
}
}
}
......@@ -317,7 +329,11 @@ extension ContactAllView : UITableViewDataSource,UITableViewDelegate {
// 备份成功
DispatchQueue.main.async {
let buAlertVc = ContactBackUpCompletedAlertView(frame: (cWindow?.bounds)!)
buAlertVc.alpha = 0
cWindow?.addSubview(buAlertVc)
UIView.animate(withDuration: AniDuration-0.2) {
buAlertVc.alpha = 1
}
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
buAlertVc.removeFromSuperview()
success()
......@@ -364,8 +380,16 @@ extension ContactAllView : UITableViewDataSource,UITableViewDelegate {
// 删除完成 弹窗
let buAlertVc = ContactBackUpDeleteCompletedAlertView(frame: (cWindow?.bounds)!)
cWindow?.addSubview(buAlertVc)
buAlertVc.alpha = 0
UIView.animate(withDuration: AniDuration - 0.2) {
buAlertVc.alpha = 1
}
DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
buAlertVc.removeFromSuperview()
UIView.animate(withDuration: AniDuration - 0.2) {
buAlertVc.alpha = 0
} completion: { su in
buAlertVc.removeFromSuperview()
}
}
break
case .failure(.contactNotFound(let missing)):
......
......@@ -130,8 +130,16 @@ extension ContactBackUpNormalView : UITableViewDelegate,UITableViewDataSource{
// 弹框提示成功
let buAlertVc = ContactBackUpDeleteCompletedAlertView(frame: (cWindow?.bounds)!)
cWindow?.addSubview(buAlertVc)
buAlertVc.alpha = 0
UIView.animate(withDuration: AniDuration - 0.2) {
buAlertVc.alpha = 1
}
DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
buAlertVc.removeFromSuperview()
UIView.animate(withDuration: AniDuration - 0.2) {
buAlertVc.alpha = 0
} completion: { su in
buAlertVc.removeFromSuperview()
}
}
// 成功之后给上游发消息
if self.dataSourceModel.count <= 0 {
......@@ -157,6 +165,10 @@ extension ContactBackUpNormalView : UITableViewDelegate,UITableViewDataSource{
let alertVc = ContactDeleteAlertView()
alertVc.frame = (self?.responderViewController()?.view.bounds)!
self?.responderViewController()?.view.addSubview(alertVc)
alertVc.alpha = 0
UIView.animate(withDuration: AniDuration - 0.2) {
alertVc.alpha = 1
}
alertVc.sureCallBack = { isSure in
self?.dataSourceModel.remove(at: indexPath.section)
// 删除整个部分而不是特定行
......@@ -182,8 +194,16 @@ extension ContactBackUpNormalView : UITableViewDelegate,UITableViewDataSource{
DispatchQueue.main.async {
let buAlertVc = ContactBackUpCompletedAlertView(frame: (cWindow?.bounds)!)
cWindow?.addSubview(buAlertVc)
buAlertVc.alpha = 0
UIView.animate(withDuration: AniDuration-0.2) {
buAlertVc.alpha = 1
}
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
buAlertVc.removeFromSuperview()
UIView.animate(withDuration: AniDuration-0.2) {
buAlertVc.alpha = 0
} completion: { su in
buAlertVc.removeFromSuperview()
}
}
// 再次请求数据 重新刷新页面
self.updateData()
......@@ -192,15 +212,31 @@ extension ContactBackUpNormalView : UITableViewDelegate,UITableViewDataSource{
}else {
let buAlertVc = ContactBackUpNoDataAlertView(frame: (cWindow?.bounds)!)
cWindow?.addSubview(buAlertVc)
buAlertVc.alpha = 0
UIView.animate(withDuration: AniDuration-0.2) {
buAlertVc.alpha = 1
}
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
buAlertVc.removeFromSuperview()
UIView.animate(withDuration: AniDuration-0.2) {
buAlertVc.alpha = 0
} completion: { su in
buAlertVc.removeFromSuperview()
}
}
}
}else {
let buAlertVc = ContactBackUpNoDataAlertView(frame: (cWindow?.bounds)!)
cWindow?.addSubview(buAlertVc)
buAlertVc.alpha = 0
UIView.animate(withDuration: AniDuration-0.2) {
buAlertVc.alpha = 1
}
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
buAlertVc.removeFromSuperview()
UIView.animate(withDuration: AniDuration-0.2) {
buAlertVc.alpha = 0
} completion: { su in
buAlertVc.removeFromSuperview()
}
}
}
}
......
......@@ -14,7 +14,7 @@ class ContactBackupAlertView : UIView {
// 懒加载背景视图
private lazy var backgroundView: UIView = {
let view = UIView()
view.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 0.4000)
view.backgroundColor = .clear//UIColor(red: 1, green: 1, blue: 1, alpha: 0.4000)
return view
}()
......@@ -76,7 +76,7 @@ class ContactBackupAlertView : UIView {
override init(frame: CGRect) {
super.init(frame: frame)
self.backgroundColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.5000)
self.backgroundColor = .clear//UIColor(red: 0, green: 0, blue: 0, alpha: 0.5000)
setupViews()
}
......@@ -128,12 +128,20 @@ class ContactBackupAlertView : UIView {
}
@objc private func dismissAlert() {
self.removeFromSuperview()
UIView.animate(withDuration: AniDuration) {
self.frame = CGRect(x: 0, y: ScreenH, width: ScreenW, height: ScreenH)
} completion: { su in
self.removeFromSuperview()
}
sureCallBack(false)
}
@objc private func sureAlert() {
self.removeFromSuperview()
UIView.animate(withDuration: AniDuration) {
self.frame = CGRect(x: 0, y: ScreenH, width: ScreenW, height: ScreenH)
} completion: { su in
self.removeFromSuperview()
}
sureCallBack(true)
}
}
......@@ -155,11 +155,20 @@ class ContactDeleteAlertView : UIView {
}
@objc private func dismissAlert() {
self.removeFromSuperview()
UIView.animate(withDuration: AniDuration-0.2) {
self.alpha = 0
} completion: { su in
self.removeFromSuperview()
}
}
@objc private func sureAlert() {
self.removeFromSuperview()
sureCallBack(true)
UIView.animate(withDuration: AniDuration-0.2) {
self.alpha = 0
} completion: { su in
self.sureCallBack(true)
self.removeFromSuperview()
}
}
}
......@@ -155,11 +155,19 @@ class ContactMergeAlertView : UIView {
}
@objc private func dismissAlert() {
self.removeFromSuperview()
UIView.animate(withDuration: AniDuration-0.2) {
self.alpha = 0
} completion: { su in
self.removeFromSuperview()
}
}
@objc private func sureAlert() {
self.removeFromSuperview()
sureCallBack()
UIView.animate(withDuration: AniDuration-0.2) {
self.alpha = 0
} completion: { su in
self.removeFromSuperview()
self.sureCallBack()
}
}
}
......@@ -104,8 +104,16 @@ class ContactDupPreNormalView : UIView {
// 弹框提示成功
let buAlertVc = ContactBackUpDeleteCompletedAlertView(frame: (cWindow?.bounds)!)
cWindow?.addSubview(buAlertVc)
buAlertVc.alpha = 0
UIView.animate(withDuration: AniDuration-0.2) {
buAlertVc.alpha = 1
}
DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
buAlertVc.removeFromSuperview()
UIView.animate(withDuration: AniDuration-0.2) {
buAlertVc.alpha = 0
} completion: { su in
buAlertVc.removeFromSuperview()
}
// 返回重复项
}
self.responderViewController()?.navigationController?.popViewController(animated: true)
......
......@@ -68,6 +68,10 @@ extension MergeButtonView {
let mergeAlertView : ContactMergeAlertView = ContactMergeAlertView()
mergeAlertView.frame = (self.responderViewController()?.view.bounds)!
cWindow?.addSubview(mergeAlertView)
mergeAlertView.alpha = 0
UIView.animate(withDuration: AniDuration-0.2) {
mergeAlertView.alpha = 1
}
mergeAlertView.sureCallBack = {
self.mergeCallBack()
}
......@@ -76,18 +80,25 @@ extension MergeButtonView {
func alertWhenMergeContact() {
// 删除之前弹出是否需要备份
let alertVc = ContactBackupAlertView()
alertVc.frame = (self.responderViewController()?.view.bounds)!
self.responderViewController()?.view.showBlur()
alertVc.frame = CGRectMake(0, ScreenH, ScreenW, ScreenH)//(self.responderViewController()?.view.bounds)!
self.responderViewController()?.view.addSubview(alertVc)
UIView.animate(withDuration: AniDuration) {
alertVc.frame = CGRectMake(0, 0, ScreenW, ScreenH)
}
alertVc.sureCallBack = {[weak self] isSure in
guard let self else {return}
if isSure {
backupContactsByselect {
// 备份完成后开始合并
self.responderViewController()?.view.hideBlur()
DispatchQueue.main.asyncAfter(deadline: .now()+AniDuration) {
if isSure {
self.backupContactsByselect {
// 备份完成后开始合并
self.showMeegeAlert(self)
}
}else{
self.showMeegeAlert(self)
}
}else{
showMeegeAlert(self)
}
}
}
......@@ -117,9 +128,17 @@ extension MergeButtonView {
DispatchQueue.main.async {
let buAlertVc = ContactBackUpCompletedAlertView(frame: (cWindow?.bounds)!)
cWindow?.addSubview(buAlertVc)
buAlertVc.alpha = 0
UIView.animate(withDuration: AniDuration-0.2) {
buAlertVc.alpha = 1
}
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
buAlertVc.removeFromSuperview()
success()
UIView.animate(withDuration: AniDuration-0.2) {
buAlertVc.alpha = 0
} completion: { su in
buAlertVc.removeFromSuperview()
success()
}
}
}
}else{
......
......@@ -189,7 +189,10 @@ extension ContactNormalIncomView : UITableViewDataSource,UITableViewDelegate {
let alertVc = ContactDeleteAlertView()
alertVc.frame = (self.responderViewController()?.view.bounds)!
cWindow?.addSubview(alertVc)
alertVc.alpha = 0
UIView.animate(withDuration: AniDuration - 0.2) {
alertVc.alpha = 1
}
alertVc.sureCallBack = {[weak self] isSure in
guard let self else {return}
if isSure {
......@@ -221,8 +224,16 @@ extension ContactNormalIncomView : UITableViewDataSource,UITableViewDelegate {
// 删除完成 弹窗
let buAlertVc = ContactBackUpDeleteCompletedAlertView(frame: (cWindow?.bounds)!)
cWindow?.addSubview(buAlertVc)
buAlertVc.alpha = 0
UIView.animate(withDuration: AniDuration - 0.2) {
buAlertVc.alpha = 1
}
DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
buAlertVc.removeFromSuperview()
UIView.animate(withDuration: AniDuration-0.2) {
buAlertVc.alpha = 0
} completion: { su in
buAlertVc.removeFromSuperview()
}
}
break
case .failure(.contactNotFound(let missing)):
......
......@@ -84,8 +84,7 @@ class HomeInfoViewController:BaseViewController {
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
PMLoadingHUD.share.disMiss()
// 结束之后是否弹出评价页面
SystemCommentManager.showCommentPage()
// 更新免费次数
if isAfterAdv == false {
......@@ -122,6 +121,7 @@ class HomeInfoViewController:BaseViewController {
// 显示弹出框
func showPopView(popView: AdvTipDeleteView){
self.view.showBlur()
self.view.addSubview(popView)
}
......@@ -223,8 +223,12 @@ class HomeInfoViewController:BaseViewController {
view.deleteButtonClickCallback = {[weak self] isMore,deleteCount in
self?.view.hideBlur()
guard let self else {return}
let finalyDeleteArray = array
if deleteCount < 0 {
return
}
let finalyDeleteArray = array
var tempArr : [AssetModel] = []
for item in finalyDeleteArray {
if tempArr.count < deleteCount {
......@@ -251,7 +255,6 @@ class HomeInfoViewController:BaseViewController {
}
}else {
deleteOp(imgs: array ,isAfterAdv: false)
}
}
......@@ -330,6 +333,11 @@ class HomeInfoViewController:BaseViewController {
vc.fileSzie = fileSize
vc.fileCount = fileCount
vc.modalPresentationStyle = .fullScreen
vc.closeCall = { [weak self] in
guard let self = self else { return }
// 结束之后是否弹出评价页面
SystemCommentManager.showCommentPage(self.view)
}
self.present(vc, animated: true)
}
}
......
......@@ -628,8 +628,8 @@ extension HomePhotosDetailViewController:WaterfallMutiSectionDelegate,UICollecti
// 显示弹出框
func showPopView(popView: AdvTipDeleteView){
self.view.showBlur()
self.view.addSubview(popView)
}
......@@ -722,6 +722,10 @@ extension HomePhotosDetailViewController:WaterfallMutiSectionDelegate,UICollecti
}
}
view.deleteButtonClickCallback = {isMore,deleteCount in
self.view.hideBlur()
if deleteCount < 0 {
return
}
if isMore == true {
if IAPManager.share.isSubscribed == false {
self.popAdverTisement()
......@@ -765,7 +769,7 @@ extension HomePhotosDetailViewController:WaterfallMutiSectionDelegate,UICollecti
print("删除文件成功")
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
PMLoadingHUD.share.disMiss()
SystemCommentManager.showCommentPage()
if isAfterAdv == false {
self.updateFreeTimes()
}
......@@ -802,6 +806,10 @@ extension HomePhotosDetailViewController:WaterfallMutiSectionDelegate,UICollecti
vc.fileSzie = fileSize
vc.fileCount = fileCount
vc.modalPresentationStyle = .fullScreen
vc.closeCall = { [weak self] in
guard let self = self else { return }
SystemCommentManager.showCommentPage(self.view)
}
self.present(vc, animated: true)
}
}
......
......@@ -527,8 +527,8 @@ extension HomeVideoDetailController:WaterfallMutiSectionDelegate,UICollectionVie
// 显示弹出框
func showPopView(popView: AdvTipDeleteView){
self.view.showBlur()
self.view.addSubview(popView)
}
......@@ -623,6 +623,10 @@ extension HomeVideoDetailController:WaterfallMutiSectionDelegate,UICollectionVie
}
}
view.deleteButtonClickCallback = {isMore,deleteCount in
self.view.hideBlur()
if deleteCount < 0 {
return
}
if isMore == true{
if IAPManager.share.isSubscribed == false {
self.popAdverTisement()
......@@ -671,8 +675,7 @@ extension HomeVideoDetailController:WaterfallMutiSectionDelegate,UICollectionVie
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
PMLoadingHUD.share.disMiss()
print("删除文件成功")
// 如果是看广告删除的,且还有免费次数
SystemCommentManager.showCommentPage()
if isAfterAdv == false {
self.updateFreeTimes()
......@@ -699,6 +702,11 @@ extension HomeVideoDetailController:WaterfallMutiSectionDelegate,UICollectionVie
vc.fileCount = fileCount
vc.modalPresentationStyle = .fullScreen
self.present(vc, animated: true)
vc.closeCall = { [weak self] in
guard let self = self else { return }
// 如果是看广告删除的,且还有免费次数
SystemCommentManager.showCommentPage(self.view)
}
}
}
......
......@@ -181,11 +181,13 @@ class HomeViewController:BaseViewController {
view.addSubview(homeView!)
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
barHidden = false
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
if !isShowCharge {
if BatteryMonitorManager.shared.getBatteryIsCharging() {
// 从字典里面取 如果有
......@@ -199,7 +201,6 @@ class HomeViewController:BaseViewController {
}
isShowCharge = true
}
homeView?.viewModel.reloadTrashAndKeep()
}
......
......@@ -130,7 +130,7 @@ class ResourceFilterBoxView : UIView {
}
override func removeFromSuperview() {
UIView.animate(withDuration: 0.3) {
UIView.animate(withDuration: AniDuration) {
// 更新约束
self.backView.backgroundColor = .clear
self.selectedViewBottomConstraint?.update(offset: 440)
......@@ -201,8 +201,8 @@ class ResourceFilterBoxView : UIView {
}
// 先显示背景,然后延迟显示弹框
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
UIView.animate(withDuration: 0.1) {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.01) {
UIView.animate(withDuration: AniDuration) {
// 更新约束
self.selectedViewBottomConstraint?.update(offset: 0)
self.layoutIfNeeded()
......
......@@ -42,16 +42,18 @@ class MaintaiDetailViewController: BaseViewController {
guard let weakSelf = self else { return }
weakSelf.removeFromKeep()
weakSelf.maintaiTipsAlertView.disMiss()
weakSelf.view.hideBlur()
}
maintaiTipsAlertView.cancelBlock = {[weak self] in
guard let weakSelf = self else { return }
weakSelf.isSelectAll = false
weakSelf.view.hideBlur()
}
maintaiBottomView.removeMaintaiBlock = {[weak self] in
guard let weakSelf = self else { return }
weakSelf.view.showBlur()
weakSelf.maintaiTipsAlertView.show()
}
......@@ -73,6 +75,7 @@ class MaintaiDetailViewController: BaseViewController {
@objc func removeAll(){
isSelectAll = true
maintaiTipsAlertView.show()
self.view.showBlur()
}
......
......@@ -38,17 +38,19 @@ class MaintainViewListController: BaseViewController {
guard let weakSelf = self else { return }
weakSelf.removeFromKeep()
weakSelf.maintaiTipsAlertView.disMiss()
weakSelf.view.hideBlur()
}
maintaiTipsAlertView.cancelBlock = {[weak self] in
guard let weakSelf = self else { return }
weakSelf.isSelectAll = false
weakSelf.view.hideBlur()
}
maintaiBottomView.removeMaintaiBlock = {[weak self] in
guard let weakSelf = self else { return }
weakSelf.maintaiTipsAlertView.show()
weakSelf.view.showBlur()
}
removeBtn = UIButton()
......@@ -69,6 +71,7 @@ class MaintainViewListController: BaseViewController {
@objc func removeAll(){
isSelectAll = true
maintaiTipsAlertView.show()
self.view.showBlur()
}
......
......@@ -15,7 +15,7 @@ class MaintaiTipsAlertView: UIView {
override func awakeFromNib() {
super.awakeFromNib()
frame = CGRectMake(0, 0, ScreenW, ScreenH)
frame = CGRectMake(0, ScreenH, ScreenW, ScreenH)
}
@IBAction func confirmClick(_ sender: Any) {
......@@ -28,10 +28,19 @@ class MaintaiTipsAlertView: UIView {
func disMiss(){
cancelBlock?()
self.removeFromSuperview()
UIView.animate(withDuration: AniDuration) {
self.frame = CGRectMake(0, ScreenH, ScreenW, ScreenH)
} completion: { su in
if su {
self.removeFromSuperview()
}
}
}
func show(){
KEYWINDOW()?.addSubview(self)
UIView.animate(withDuration: AniDuration) {
self.frame = CGRectMake(0, 0, ScreenW, ScreenH)
}
}
}
......@@ -87,7 +87,7 @@
</view>
</subviews>
<viewLayoutGuide key="safeArea" id="Sg0-yf-Vq3"/>
<color key="backgroundColor" red="0.066666666666666666" green="0.066666666666666666" blue="0.066666666666666666" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="Sg0-yf-Vq3" firstAttribute="trailing" secondItem="SyR-iC-5WC" secondAttribute="trailing" constant="16" id="3rm-dW-0Hp"/>
<constraint firstItem="SyR-iC-5WC" firstAttribute="centerY" secondItem="p11-ka-d5j" secondAttribute="centerY" id="Pm6-OB-Ccw"/>
......@@ -97,7 +97,7 @@
</view>
</objects>
<resources>
<image name="ic_list_setting" width="28" height="28"/>
<image name="ic_list_setting" width="28.333333969116211" height="28"/>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
......
......@@ -11,11 +11,14 @@ class CustomRate{
// 自定义初始化方法
func show() {
let view = Bundle.main.loadNibNamed("CustomRateView", owner: nil)?.last as! CustomRateView
view.frame = CGRect.init(x: 0, y: 0, width:ScreenW, height: ScreenH)
view.show()
}
lazy var view: CustomRateView = {
let view = Bundle.main.loadNibNamed("CustomRateView", owner: nil)?.last as! CustomRateView
view.frame = CGRect.init(x: 0, y: ScreenH, width:ScreenW, height: ScreenH)
return view
}()
}
......@@ -25,6 +28,8 @@ class CustomRateView: UIView {
@IBOutlet weak var bgView: UIView!
@IBOutlet weak var okBtn: UIButton!
var callblock:(()->Void) = {}
override func awakeFromNib() {
super.awakeFromNib()
okBtn.layer.cornerRadius = 15
......@@ -47,9 +52,9 @@ class CustomRateView: UIView {
private func viewRemoveAction(){
DispatchQueue.main.async {
self.alpha = 1
UIView.animate(withDuration: 0.2) {
self.alpha = 0
self.callblock()
UIView.animate(withDuration: AniDuration) {
self.frame = CGRect.init(x: 0, y: ScreenH, width:ScreenW, height: ScreenH)
}completion: { _ in
self.removeFromSuperview()
}
......@@ -57,11 +62,14 @@ class CustomRateView: UIView {
}
func show(){
// DispatchQueue.main.async {
KEYWINDOW()?.addSubview(self)
self.alpha = 0
UIView.animate(withDuration: 0.2) {
self.alpha = 1
}
self.frame = CGRect.init(x: 0, y: ScreenH, width:ScreenW, height: ScreenH)
UIView.animate(withDuration: AniDuration) {
self.frame = CGRect.init(x: 0, y: 0, width:ScreenW, height: ScreenH)
}
// }
}
}
......@@ -78,7 +78,7 @@
</view>
</subviews>
<viewLayoutGuide key="safeArea" id="LTt-HW-XdR"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="eO0-mO-cv0" firstAttribute="leading" secondItem="LTt-HW-XdR" secondAttribute="leading" constant="15" id="EOH-0c-Twg"/>
<constraint firstItem="LTt-HW-XdR" firstAttribute="trailing" secondItem="eO0-mO-cv0" secondAttribute="trailing" constant="15" id="TZF-xM-ND5"/>
......
......@@ -17,6 +17,9 @@ class DelSuccessViewController: UIViewController {
@IBOutlet weak var delText: UILabel!
@IBOutlet weak var conTitle: UILabel!
var closeCall:(()->Void) = {}
var delType:String = "photo"
var fileCount:Int = 0
......@@ -69,7 +72,9 @@ class DelSuccessViewController: UIViewController {
@IBAction func closeClick(_ sender: Any) {
vibrate()
self.dismiss(animated: true)
self.dismiss(animated: true) {
self.closeCall()
}
}
......
......@@ -51,7 +51,6 @@ class PMShowImgVideoController: BaseViewController {
override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = UIColor(red: 0.95, green: 0.96, blue: 0.99, alpha: 1)
}
......@@ -62,9 +61,13 @@ class PMShowImgVideoController: BaseViewController {
make.top.equalTo(titleView.snp.bottom).offset(20)
make.bottom.equalToSuperview().inset(100 + (cWindow?.safeAreaInsets.bottom ?? 0))
}
self.bottItems.snp.makeConstraints { make in
make.left.right.equalTo(MaxCollection)
self.backView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.top.equalTo(MaxCollection.snp.bottom)
}
self.bottItems.snp.makeConstraints { make in
make.left.right.equalToSuperview().inset(20)
make.top.equalToSuperview()
make.bottom.equalToSuperview().offset(-(cWindow?.safeAreaInsets.bottom ?? 0))
}
self.view.layoutIfNeeded()
......@@ -93,6 +96,7 @@ class PMShowImgVideoController: BaseViewController {
let col = UICollectionView(frame: CGRect(), collectionViewLayout: flowlayout)
col.delegate = self;
col.dataSource = self;
col.isPagingEnabled = true
col.showsHorizontalScrollIndicator = false
col.backgroundColor = .clear
col.isPagingEnabled = true
......@@ -115,9 +119,16 @@ class PMShowImgVideoController: BaseViewController {
col.register(PMShowItemCell.self, forCellWithReuseIdentifier: PMShowItemCellID)
col.register(UICollectionViewCell.self, forCellWithReuseIdentifier: "UICollectionViewCell")
col.showsHorizontalScrollIndicator = false
view.addSubview(col)
backView.addSubview(col)
return col
}()
private lazy var backView: UIView = {
let v = UIView()
v.backgroundColor = .white
view.addSubview(v)
return v
}()
}
......@@ -129,7 +140,6 @@ extension PMShowImgVideoController : UICollectionViewDelegate,UICollectionViewDa
let offsetx = MaxCollection.contentOffset.x
let width = collectView.width
let current:Int = Int(offsetx / width)
// currentIdx = current
bottItems.scrollToItem(at: IndexPath(row: current, section: 0), at: .left, animated: true)
}
}
......@@ -221,7 +231,8 @@ extension PMShowImgVideoController : UICollectionViewDelegate,UICollectionViewDa
self.homeDataSource?[indexPath.row].isSeleted = true
self.selectSet.add(indexPath.row)
}
self.MaxCollection.reloadData()
// self.MaxCollection.reloadData()
cell.isCurrent = selectSet.contains(indexPath.row)
self.bottItems.reloadData()
}
return cell
......@@ -240,7 +251,8 @@ extension PMShowImgVideoController : UICollectionViewDelegate,UICollectionViewDa
self.homeDataSource?[indexPath.row].isSeleted = true
self.selectSet.add(indexPath.row)
}
self.MaxCollection.reloadData()
// self.MaxCollection.reloadData()
cell.isCurrent = selectSet.contains(indexPath.row)
self.bottItems.reloadData()
}
return cell
......
......@@ -110,6 +110,7 @@ class SecretSetViewController: BaseViewController, UITextFieldDelegate {
if secretType == .del {
// UserDefaults.standard.set("", forKey: SecretViewController.psKey)
SettingConfiguration.share.config.secret = ""
SettingConfiguration.share.config.faceId = false
let alert = UIAlertController(title: nil, message: "The PIN has been deleted", preferredStyle: .alert)
self.present(alert, animated: true)
DispatchQueue.main.asyncAfter(deadline: .now() + 1.5) {
......
......@@ -27,7 +27,7 @@ class SettingViewHeaderCell : UITableViewCell {
label.text = "Phone Manager Pro Edition"
}
label.font = UIFont(name: "PingFang SC-Bold", size: 18)
label.font = UIFont.systemFont(ofSize: 18, weight: .bold)
label.textColor = UIColor(red: 0.2, green: 0.2, blue: 0.2, alpha: 1)
label.textAlignment = .center
return label
......@@ -102,7 +102,7 @@ class SettingViewHeaderCell : UITableViewCell {
make.right.equalToSuperview().offset(-15)
make.top.equalTo(fLabel.snp.bottom).offset(4)
if IAPManager.share.isSubscribed == false {
make.height.equalTo(20)
make.height.greaterThanOrEqualTo(20)
}else{
make.height.equalTo(42)
}
......
......@@ -173,12 +173,13 @@ class SettingViewController : BaseViewController , UITableViewDelegate, UITableV
break
case settingLabels.RemoveAfterImport.rawValue:
SettingConfiguration.share.config.removeImg = !SettingConfiguration.share.config.removeImg
tableView.reloadRows(at: [indexPath], with: .none)
tableView.reloadData()
let cell:SettingSwitchCell = tableView.cellForRow(at: indexPath) as? SettingSwitchCell ?? SettingSwitchCell()
cell.openImageView.isSelected = SettingConfiguration.share.config.removeImg
vibrate()
break
case settingLabels.Widgets.rawValue:
var callblock:(()->Void) = {[weak self] in
let callblock:(()->Void) = {[weak self] in
guard let self = self else { return }
let widget = WidgetViewController()
self.navigationController?.pushViewController(widget, animated: true)
......@@ -216,8 +217,8 @@ class SettingViewController : BaseViewController , UITableViewDelegate, UITableV
break
case settingLabels.Vibration.rawValue:
SettingConfiguration.share.config.vibration = !(SettingConfiguration.share.config.vibration ?? false)
tableView.reloadRows(at: [indexPath], with: .none)
tableView.reloadData()
let cell:SettingSwitchCell = tableView.cellForRow(at: indexPath) as? SettingSwitchCell ?? SettingSwitchCell()
cell.openImageView.isSelected = SettingConfiguration.share.config.vibration ?? false
vibrate(true)
break
case settingLabels.Resumepurchase.rawValue:
......@@ -278,14 +279,16 @@ class SettingViewController : BaseViewController , UITableViewDelegate, UITableV
PMFaceIDManger.authenticateWithFaceID(reason: "Unlock privacy space") {[weak self] success, error in
if success {
SettingConfiguration.share.config.faceId = !(SettingConfiguration.share.config.faceId ?? false)
self?.tableView.reloadData()
// self?.tableView.reloadData()
let cell:SettingSwitchCell = self?.tableView.cellForRow(at: indexPath) as? SettingSwitchCell ?? SettingSwitchCell()
cell.openImageView.isSelected = SettingConfiguration.share.config.faceId ?? false
}
}
}
}else{
SettingConfiguration.share.config.faceId = false
self.tableView.reloadRows(at: [indexPath], with: .none)
tableView.reloadData()
let cell:SettingSwitchCell = tableView.cellForRow(at: indexPath) as? SettingSwitchCell ?? SettingSwitchCell()
cell.openImageView.isSelected = SettingConfiguration.share.config.faceId ?? false
}
}
......@@ -295,8 +298,8 @@ class SettingViewController : BaseViewController , UITableViewDelegate, UITableV
seting.Callback = {[weak self] success in
guard let self = self else { return }
if success {
self.modelData = getSettingViewInfo()
self.tableView.reloadData()
// self.modelData = getSettingViewInfo()
// self.tableView.reloadData()
}
}
self.navigationController?.pushViewController(seting, animated: true)
......
......@@ -227,11 +227,14 @@ extension EmailFilterController : UITableViewDelegate,UITableViewDataSource {
let keyword = EmailKeywordController()
keyword.modalPresentationStyle = .overFullScreen
keyword.callblock = { text in
var keywords = EmailFilterManager.share.keyword
keywords.append(text)
if text.count > 0 {
var keywords = EmailFilterManager.share.keyword
keywords.append(text)
EmailFilterManager.share.keyword = keywords
tableView.reloadData()
}
self.view.hideBlur()
EmailFilterManager.share.keyword = keywords
tableView.reloadData()
}
self.present(keyword, animated: true)
}
......
......@@ -99,6 +99,7 @@ class EmailKeywordController: UIViewController {
}
}
}else{
self.callblock("")
self.dismiss(animated: true)
}
}
......
......@@ -116,14 +116,19 @@ extension EmailCleanListView : UITableViewDataSource,UITableViewDelegate {
// 再次判断下
if IAPManager.share.isSubscribed == false {
// 弹出提示框
let alertView = AdvTipSelectView(frame: self.bounds)
let alertView = AdvTipSelectView()
alertView.selectType = .selectTypeSetAnimation
alertView.getOtherInfoByType()
self.addSubview(alertView)
self.showBlur()
self.responderViewController()?.present(alertView, animated: true)
alertView.selectClickCallback = {isSure in
self.popAdverTisement()
AdvManager.shared.finisedCallBack = {
callblock()
alertView.dismiss(animated: true)
self.hideBlur()
if isSure {
self.popAdverTisement()
AdvManager.shared.finisedCallBack = {
callblock()
}
}
}
}else{
......
......@@ -165,14 +165,19 @@ extension EmailContentView :UITableViewDelegate,UITableViewDataSource{
// 再次判断下
if IAPManager.share.isSubscribed == false {
// 弹出提示框
let alertView = AdvTipSelectView(frame: self.bounds)
let alertView = AdvTipSelectView()
alertView.selectType = .selectTypeSetAnimation
alertView.getOtherInfoByType()
self.addSubview(alertView)
self.showBlur()
self.responderViewController()?.present(alertView, animated: true)
alertView.selectClickCallback = {isSure in
self.popAdverTisement()
AdvManager.shared.finisedCallBack = {
callblock()
alertView.dismiss(animated: true)
self.hideBlur()
if isSure {
self.popAdverTisement()
AdvManager.shared.finisedCallBack = {
callblock()
}
}
}
}else{
......
......@@ -17,7 +17,7 @@ class SystemCommentManager {
/// 弹窗评论
class func showCommentPage(){
class func showCommentPage(_ view:UIView){
if let date = UserDefaults.standard.object(forKey: SHOW_COMMENT_DATE){
// 如果是有时间,判断和当前时间是不是一致的,如果是一致
let calendar = Calendar.current
......@@ -34,18 +34,23 @@ class SystemCommentManager {
if let isCommentInCurrentDay = UserDefaults.standard.object(forKey: SHOW_COMMENT_IN_CURRENT_DAY){
let temp : Bool = isCommentInCurrentDay as! Bool
if !temp {
showAction()
showAction(view)
}
}else{
showAction()
showAction(view)
}
}
}
/// 显示评价弹窗操作
private class func showAction(){
private class func showAction(_ view : UIView){
DispatchQueue.main.async {
CustomRate().show()
let rate = CustomRate()
view.showBlur()
rate.view.callblock = {
view.hideBlur()
}
rate.show()
}
UserDefaults.standard.set(true, forKey: SHOW_COMMENT_IN_CURRENT_DAY)
UserDefaults.standard.set(Date(), forKey: SHOW_COMMENT_DATE)
......
......@@ -33,6 +33,8 @@ let iconWH:CGFloat = 28
let marginLR:CGFloat = 15
let AniDuration:CGFloat = 0.4
//颜色
let launchColor:String = "#7F33FF"
......
......@@ -210,13 +210,13 @@ extension UIView {
func showBlur() -> Void {
self.addSubview(blur)
blur.frame = self.bounds
UIView.animate(withDuration: 0.4) {
UIView.animate(withDuration: AniDuration) {
self.blur.alpha = 1
}
}
func hideBlur() -> Void {
UIView.animate(withDuration: 0.4) {
UIView.animate(withDuration: AniDuration) {
self.blur.alpha = 0
} completion: { su in
self.blur.removeFromSuperview()
......
......@@ -249,5 +249,7 @@
<array>
<string>processing</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<true/>
</dict>
</plist>
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