Commit cb6d4961 authored by yqz's avatar yqz

优化

parent 5ce1c1ce
{ {
"images" : [ "images" : [
{ {
"filename" : "img_phone_battery_02.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"filename" : "img_phone_battery_02@2x.png", "filename" : "Group_1171275124@2x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"filename" : "img_phone_battery_02@3x.png", "filename" : "Group_1171275124@3x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "3x" "scale" : "3x"
} }
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ic-select-new-All-n@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic-select-new-All-n@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ic-select-new-All-s@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic-select-new-All-s@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
"scale" : "1x" "scale" : "1x"
}, },
{ {
"filename" : "Frame_1171276341@2x.png", "filename" : "Frame_1171276354@2x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"filename" : "Frame_1171276341@3x.png", "filename" : "Frame_1171276354@3x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "3x" "scale" : "3x"
} }
......
{ {
"images" : [ "images" : [
{ {
"filename" : "ic_check_similar.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"filename" : "ic_check_similar@2x.png", "filename" : "Frame@2x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"filename" : "ic_check_similar@3x.png", "filename" : "Frame@3x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "3x" "scale" : "3x"
} }
......
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
"scale" : "1x" "scale" : "1x"
}, },
{ {
"filename" : "Frame_1171276341@2x.png", "filename" : "Frame_1171276354@2x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"filename" : "Frame_1171276341@3x.png", "filename" : "Frame_1171276354@3x.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "3x" "scale" : "3x"
} }
......
...@@ -88,20 +88,23 @@ class ChargeGuideController : BaseViewController,UIScrollViewDelegate,UINavigati ...@@ -88,20 +88,23 @@ class ChargeGuideController : BaseViewController,UIScrollViewDelegate,UINavigati
if i==0 { if i==0 {
view.detailTipTitleLabel.isHidden = false view.detailTipTitleLabel.isHidden = false
// 在滑动的第一个添加一个button // 在滑动的第一个添加一个button
let jumpButton = UIButton(type: .custom) // let jumpButton = UIButton(type: .custom)
jumpButton.setTitle("Open shortcut command", for: .normal) // jumpButton.setTitle("Open shortcut command", for: .normal)
jumpButton.setTitleColor(.white, for: .normal) // jumpButton.setTitleColor(.white, for: .normal)
jumpButton.backgroundColor = UIColor(red: 0, green: 0.51, blue: 1, alpha: 1) // jumpButton.backgroundColor = UIColor(red: 0, green: 0.51, blue: 1, alpha: 1)
jumpButton.layer.cornerRadius = 25 // jumpButton.layer.cornerRadius = 25
jumpButton.clipsToBounds = true // jumpButton.clipsToBounds = true
view.addSubview(jumpButton) // view.addSubview(jumpButton)
jumpButton.snp.makeConstraints { make in // jumpButton.snp.makeConstraints { make in
make.left.equalToSuperview().offset(32) // make.left.equalToSuperview().offset(32)
make.right.equalToSuperview().offset(-32) // make.right.equalToSuperview().offset(-32)
make.height.equalTo(50) // make.height.equalTo(50)
make.bottom.equalToSuperview().offset(-122 * RScreenH()) // make.bottom.equalToSuperview().offset(-122 * RScreenH())
} // }
jumpButton.addTarget(self, action: #selector(jumpButtonAction), for: .touchUpInside) // jumpButton.addTarget(self, action: #selector(jumpButtonAction), for: .touchUpInside)
let tap = UITapGestureRecognizer(target: self, action: #selector(jumpButtonAction(_:)))
view.guideView.isUserInteractionEnabled = true
view.guideView.addGestureRecognizer(tap)
}else { }else {
view.detailTipTitleLabel.isHidden = true view.detailTipTitleLabel.isHidden = true
} }
...@@ -132,13 +135,20 @@ class ChargeGuideController : BaseViewController,UIScrollViewDelegate,UINavigati ...@@ -132,13 +135,20 @@ class ChargeGuideController : BaseViewController,UIScrollViewDelegate,UINavigati
self.navigationController?.popViewController(animated: true) self.navigationController?.popViewController(animated: true)
} }
@objc func jumpButtonAction(){ @objc func jumpButtonAction(_ ges:UIGestureRecognizer){
let point = ges.location(in: ges.view)
var frame = ges.view?.frame ?? CGRect()
frame.origin.y = (frame.height) - 205
frame.size.height = 100
if CGRectContainsPoint(frame, point) {
if let url = URL(string: "shortcuts://") { if let url = URL(string: "shortcuts://") {
if UIApplication.shared.canOpenURL(url) { if UIApplication.shared.canOpenURL(url) {
UIApplication.shared.open(url, options: [:], completionHandler: nil) UIApplication.shared.open(url, options: [:], completionHandler: nil)
} }
} }
} }
}
func navigationController(_ navigationController: UINavigationController, animationControllerFor operation: UINavigationController.Operation, from fromVC: UIViewController, to toVC: UIViewController) -> UIViewControllerAnimatedTransitioning? { func navigationController(_ navigationController: UINavigationController, animationControllerFor operation: UINavigationController.Operation, from fromVC: UIViewController, to toVC: UIViewController) -> UIViewControllerAnimatedTransitioning? {
if operation == .pop { if operation == .pop {
......
...@@ -80,7 +80,6 @@ class ChargeGuideNormalView : UIView{ ...@@ -80,7 +80,6 @@ class ChargeGuideNormalView : UIView{
make.centerX.equalToSuperview() make.centerX.equalToSuperview()
make.width.equalTo(316) make.width.equalTo(316)
make.height.equalTo(534) make.height.equalTo(534)
} }
} }
......
...@@ -12,7 +12,7 @@ import UIKit ...@@ -12,7 +12,7 @@ import UIKit
class ContactIncompleteViewController : BaseViewController { class ContactIncompleteViewController : BaseViewController {
private var widthConstraint: Constraint? // private var widthConstraint: Constraint?
var dataSourceModel : [ContactModel]? var dataSourceModel : [ContactModel]?
...@@ -78,7 +78,7 @@ class ContactIncompleteViewController : BaseViewController { ...@@ -78,7 +78,7 @@ class ContactIncompleteViewController : BaseViewController {
self.selectAllButton.snp.makeConstraints { make in self.selectAllButton.snp.makeConstraints { make in
make.right.equalTo(-15 * RScreenW()) make.right.equalTo(-15 * RScreenW())
make.centerY.equalTo(self.navView.backButton.snp.centerY) make.centerY.equalTo(self.navView.backButton.snp.centerY)
widthConstraint = make.width.equalTo(115).constraint // widthConstraint = make.width.equalTo(115).constraint
make.height.equalTo(32) make.height.equalTo(32)
} }
...@@ -86,17 +86,17 @@ class ContactIncompleteViewController : BaseViewController { ...@@ -86,17 +86,17 @@ class ContactIncompleteViewController : BaseViewController {
// 选择之后,更新宽度约束的常量值 // 选择之后,更新宽度约束的常量值
if isSelected { if isSelected {
self.normalView.selectedContacts = self.normalView.dataSourceModel self.normalView.selectedContacts = self.normalView.dataSourceModel
self.widthConstraint?.update(offset: 131) // self.widthConstraint?.update(offset: 131)
}else { }else {
self.normalView.selectedContacts.removeAll() self.normalView.selectedContacts.removeAll()
self.widthConstraint?.update(offset: 115) // self.widthConstraint?.update(offset: 115)
} }
self.normalView.updateDeleteButtonStatus() self.normalView.updateDeleteButtonStatus()
// 强制重新布局 // 强制重新布局
UIView.animate(withDuration: 0.3) { // UIView.animate(withDuration: 0.3) {
self.selectAllButton.setNeedsLayout() // self.selectAllButton.setNeedsLayout()
self.selectAllButton.layoutIfNeeded() // self.selectAllButton.layoutIfNeeded()
} // }
self.normalView.tableView.reloadData() self.normalView.tableView.reloadData()
} }
self.normalView.dataClearCallBack = { self.normalView.dataClearCallBack = {
......
...@@ -74,9 +74,9 @@ class ContactsDupViewController : BaseViewController { ...@@ -74,9 +74,9 @@ class ContactsDupViewController : BaseViewController {
self.navView.addSubview(self.selectAllButton) self.navView.addSubview(self.selectAllButton)
self.selectAllButton.snp.makeConstraints { make in self.selectAllButton.snp.makeConstraints { make in
make.right.equalTo(-15 * RScreenW()) make.right.equalToSuperview().offset(-15)
make.centerY.equalTo(self.navView.backButton.snp.centerY) make.centerY.equalTo(self.navView.backButton.snp.centerY)
widthConstraint = make.width.equalTo(115).constraint // widthConstraint = make.width.equalTo(115).constraint
make.height.equalTo(32) make.height.equalTo(32)
} }
...@@ -88,21 +88,21 @@ class ContactsDupViewController : BaseViewController { ...@@ -88,21 +88,21 @@ class ContactsDupViewController : BaseViewController {
DispatchQueue.main.async { DispatchQueue.main.async {
// 选择之后,更新宽度约束的常量值 // 选择之后,更新宽度约束的常量值
if isSelected { if isSelected {
self.widthConstraint?.update(offset: 131) // self.widthConstraint?.update(offset: 131)
if let data = self.dataSourceModel { if let data = self.dataSourceModel {
for(index,item) in data.enumerated(){ for(index,item) in data.enumerated(){
self.normalView.selectData[String(index)] = item self.normalView.selectData[String(index)] = item
} }
} }
}else { }else {
self.widthConstraint?.update(offset: 115) // self.widthConstraint?.update(offset: 115)
self.normalView.selectData = [:] self.normalView.selectData = [:]
} }
// 强制重新布局 // 强制重新布局
UIView.animate(withDuration: 0.3) { // UIView.animate(withDuration: 0.3) {
self.selectAllButton.setNeedsLayout() // self.selectAllButton.setNeedsLayout()
self.selectAllButton.layoutIfNeeded() // self.selectAllButton.layoutIfNeeded()
} // }
self.normalView.tableView.reloadData() self.normalView.tableView.reloadData()
} }
} }
...@@ -111,11 +111,11 @@ class ContactsDupViewController : BaseViewController { ...@@ -111,11 +111,11 @@ class ContactsDupViewController : BaseViewController {
DispatchQueue.main.async { DispatchQueue.main.async {
// 选择之后,更新宽度约束的常量值 // 选择之后,更新宽度约束的常量值
if changed { if changed {
self.widthConstraint?.update(offset: 131) // self.widthConstraint?.update(offset: 131)
self.selectAllButton.isSelected = true self.selectAllButton.isSelected = true
}else { }else {
self.widthConstraint?.update(offset: 115) self.widthConstraint?.update(offset: 115)
self.selectAllButton.isSelected = false // self.selectAllButton.isSelected = false
} }
} }
} }
......
...@@ -88,16 +88,21 @@ class SelectAllButton : UIView { ...@@ -88,16 +88,21 @@ class SelectAllButton : UIView {
label.textColor = isSelected ? UIColor(red: 0.4, green: 0.4, blue: 0.4, alpha: 1) : UIColor(red: 0, green: 0.51, blue: 1, alpha: 1) label.textColor = isSelected ? UIColor(red: 0.4, green: 0.4, blue: 0.4, alpha: 1) : UIColor(red: 0, green: 0.51, blue: 1, alpha: 1)
label.text = isSelected ? "Unselect all" : "Select All" label.text = isSelected ? "Unselect all" : "Select All"
// 强制布局更新以适应新文本 // // 强制布局更新以适应新文本
setNeedsLayout() // UIView.animate(withDuration: 0.1) {
layoutIfNeeded() // self.setNeedsLayout()
// self.layoutIfNeeded()
// }
} }
@objc func selectClick(){ @objc func selectClick(){
self.isUserInteractionEnabled = false
self.isSelected = !self.isSelected self.isSelected = !self.isSelected
tapCallback(self.isSelected) tapCallback(self.isSelected)
DispatchQueue.main.asyncAfter(deadline: .now()+0.01) {
self.isUserInteractionEnabled = true
}
} }
} }
...@@ -12,25 +12,31 @@ class HomeInfoViewController:BaseViewController { ...@@ -12,25 +12,31 @@ class HomeInfoViewController:BaseViewController {
private var type:PhotsFileType? private var type:PhotsFileType?
lazy var seletedAllBtn:UIButton = { lazy var seletedAllBtn:SelectAllButton = {
let view = SelectAllButton()
let btn:UIButton = UIButton(frame: CGRect(x: 0, y: 0, width: 115, height: 32)) view.clipsToBounds = true
view.layer.cornerRadius = 16
btn.addTarget(self, action: #selector(seletedAllBtnClick), for: .touchUpInside) view.tapCallback = {[weak self] isselect in
btn.backgroundColor = UIColor.colorWithHex(hexStr: "#F2F6FC") self?.seletedAllBtnClick()
btn.setImage(UIImage.init(named: "ic_check_similar"), for: .normal) }
btn.setTitle("Select All", for: .normal) return view
btn.setImage(UIImage.init(named: "ic_close_similar"), for: .selected) // let btn:UIButton = UIButton(type: .custom)//(frame: CGRect(x: 0, y: 0, width: 115, height: 32))
btn.setTitle("Unselect all", for: .selected) //
btn.setTitleColor(UIColor.colorWithHex(hexStr: mColor), for: .normal) // btn.addTarget(self, action: #selector(seletedAllBtnClick), for: .touchUpInside)
btn.setTitleColor(UIColor.colorWithHex(hexStr: black3Color), for: .selected) // btn.backgroundColor = UIColor.colorWithHex(hexStr: "#F2F6FC")
btn.titleLabel?.font = UIFont.systemFont(ofSize: 14, weight: .bold) // btn.setImage(UIImage.init(named: "ic_check_similar"), for: .normal)
// btn.setTitle("Select All", for: .normal)
btn.layer.cornerRadius = btn.height / 2 // btn.setImage(UIImage.init(named: "ic_close_similar"), for: .selected)
btn.layer.masksToBounds = true // btn.setTitle("Unselect all", for: .selected)
btn.changBtnWithStytl(btnStyle: .defalut, margin: 8) // btn.setTitleColor(UIColor.colorWithHex(hexStr: mColor), for: .normal)
// btn.setTitleColor(UIColor.colorWithHex(hexStr: black3Color), for: .selected)
return btn // btn.titleLabel?.font = UIFont.systemFont(ofSize: 14, weight: .bold)
//
// btn.layer.cornerRadius = btn.height / 2
// btn.layer.masksToBounds = true
// btn.changBtnWithStytl(btnStyle: .defalut, margin: 8)
//
// return btn
}() }()
lazy var tablewView:HomeInfoView = { lazy var tablewView:HomeInfoView = {
...@@ -63,8 +69,8 @@ class HomeInfoViewController:BaseViewController { ...@@ -63,8 +69,8 @@ class HomeInfoViewController:BaseViewController {
guard let self else {return} guard let self else {return}
self.seletedAllBtn.isSelected = cS self.seletedAllBtn.isSelected = cS
self.seletedAllBtn.width = cS ? 131 : 115 // self.seletedAllBtn.width = cS ? 131 : 115
seletedAllBtn.x = titleView.width - marginLR - seletedAllBtn.width // seletedAllBtn.x = titleView.width - marginLR - seletedAllBtn.width
} }
} }
} }
...@@ -325,6 +331,10 @@ class HomeInfoViewController:BaseViewController { ...@@ -325,6 +331,10 @@ class HomeInfoViewController:BaseViewController {
configSelectAll() configSelectAll()
} }
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
seletedAllBtn.isHidden = (self.ids?.count ?? 0 <= 0)
}
// 删除成功页面 // 删除成功页面
func showDeleteSuccess(fileCount:Int,fileSize:Int64){ func showDeleteSuccess(fileCount:Int,fileSize:Int64){
...@@ -392,10 +402,14 @@ class HomeInfoViewController:BaseViewController { ...@@ -392,10 +402,14 @@ class HomeInfoViewController:BaseViewController {
super.addViews() super.addViews()
seletedAllBtn.x = titleView.width - marginLR - seletedAllBtn.width // seletedAllBtn.x = titleView.width - marginLR - seletedAllBtn.width
seletedAllBtn.centerY = navCenterY // seletedAllBtn.centerY = navCenterY
titleView.addSubview(seletedAllBtn) titleView.addSubview(seletedAllBtn)
seletedAllBtn.snp.makeConstraints { make in
make.right.equalToSuperview().offset(-marginLR)
make.centerY.equalTo(titleView.backBtn.snp.centerY)
make.height.equalTo(32)
}
titleLabel.x = titleView.backBtn.width + titleView.backBtn.x + 10 titleLabel.x = titleView.backBtn.width + titleView.backBtn.x + 10
titleLabel.centerY = navCenterY titleLabel.centerY = navCenterY
...@@ -445,8 +459,8 @@ class HomeInfoViewController:BaseViewController { ...@@ -445,8 +459,8 @@ class HomeInfoViewController:BaseViewController {
func configSelectAll(){ func configSelectAll(){
seletedAllBtn.isSelected = true seletedAllBtn.isSelected = true
self.seletedAllBtn.width = seletedAllBtn.isSelected ? 131 : 115 // self.seletedAllBtn.width = seletedAllBtn.isSelected ? 131 : 115
seletedAllBtn.x = titleView.width - marginLR - seletedAllBtn.width // seletedAllBtn.x = titleView.width - marginLR - seletedAllBtn.width
tablewView.changeALlValue(isSeleted: seletedAllBtn.isSelected) tablewView.changeALlValue(isSeleted: seletedAllBtn.isSelected)
} }
...@@ -457,9 +471,9 @@ class HomeInfoViewController:BaseViewController { ...@@ -457,9 +471,9 @@ class HomeInfoViewController:BaseViewController {
guard let self else {return} guard let self else {return}
seletedAllBtn.isSelected = !seletedAllBtn.isSelected // seletedAllBtn.isSelected = !seletedAllBtn.isSelected
self.seletedAllBtn.width = seletedAllBtn.isSelected ? 131 : 115 // self.seletedAllBtn.width = seletedAllBtn.isSelected ? 131 : 115
seletedAllBtn.x = titleView.width - marginLR - seletedAllBtn.width // seletedAllBtn.x = titleView.width - marginLR - seletedAllBtn.width
tablewView.changeALlValue(isSeleted: seletedAllBtn.isSelected) tablewView.changeALlValue(isSeleted: seletedAllBtn.isSelected)
} }
......
...@@ -240,6 +240,8 @@ class HomePhotosDetailViewController : BaseViewController { ...@@ -240,6 +240,8 @@ class HomePhotosDetailViewController : BaseViewController {
}else{ }else{
self.collectionView.frame = CGRect(x: marginLR, y: self.videoDetailNavView!.height, width: self.view.width - 2 * marginLR, height: self.view.height - self.videoDetailNavView!.height) self.collectionView.frame = CGRect(x: marginLR, y: self.videoDetailNavView!.height, width: self.view.width - 2 * marginLR, height: self.view.height - self.videoDetailNavView!.height)
} }
self.videoDetailNavView?.startSelectButton.isHidden = (self.resourceData.count <= 0)
} }
} }
...@@ -450,6 +452,8 @@ extension HomePhotosDetailViewController:WaterfallMutiSectionDelegate,UICollecti ...@@ -450,6 +452,8 @@ extension HomePhotosDetailViewController:WaterfallMutiSectionDelegate,UICollecti
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "HomePhotosDetailCollectionCell", for: indexPath) as! HomePhotosDetailCollectionCell let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "HomePhotosDetailCollectionCell", for: indexPath) as! HomePhotosDetailCollectionCell
cell.resourceIdent = self.resourceData[indexPath.row] cell.resourceIdent = self.resourceData[indexPath.row]
cell.saveSizeView.isHidden = mediaType != .Other
// 这里做缓存 // 这里做缓存
cell.backImageView.image = UIImage() cell.backImageView.image = UIImage()
self.getImageFromCache(model: self.resourceData[indexPath.row]) {[weak self] image in self.getImageFromCache(model: self.resourceData[indexPath.row]) {[weak self] image in
...@@ -573,7 +577,8 @@ extension HomePhotosDetailViewController:WaterfallMutiSectionDelegate,UICollecti ...@@ -573,7 +577,8 @@ extension HomePhotosDetailViewController:WaterfallMutiSectionDelegate,UICollecti
header.countLabel.attributedText = header.getAttrText(fullText: "\(self.resourceData.count) Photos") header.countLabel.attributedText = header.getAttrText(fullText: "\(self.resourceData.count) Photos")
header.modelTitlelabel.text = self.mediaType?.rawValue header.modelTitlelabel.text = self.mediaType?.rawValue
currentHeaderView = header currentHeaderView = header
header.filterButton.isHidden = (self.resourceData.count <= 0)
header.countLabel.isHidden = (self.resourceData.count <= 0)
header.sortViewSubmitCallBack = {[weak self] filterModel in header.sortViewSubmitCallBack = {[weak self] filterModel in
guard let self else {return} guard let self else {return}
PhotoManager.shared.reloadTrashAndKeep() PhotoManager.shared.reloadTrashAndKeep()
......
...@@ -316,6 +316,7 @@ class HomeVideoDetailController :BaseViewController { ...@@ -316,6 +316,7 @@ class HomeVideoDetailController :BaseViewController {
}else{ }else{
self.collectionView.frame = CGRect(x: marginLR, y: self.videoDetailNavView!.height, width: self.view.width - 2 * marginLR, height: self.view.height - self.videoDetailNavView!.height) self.collectionView.frame = CGRect(x: marginLR, y: self.videoDetailNavView!.height, width: self.view.width - 2 * marginLR, height: self.view.height - self.videoDetailNavView!.height)
} }
self.videoDetailNavView?.startSelectButton.isHidden = (self.resourceData.count <= 0)
} }
} }
...@@ -496,6 +497,9 @@ extension HomeVideoDetailController:WaterfallMutiSectionDelegate,UICollectionVie ...@@ -496,6 +497,9 @@ extension HomeVideoDetailController:WaterfallMutiSectionDelegate,UICollectionVie
currentHeaderView = header currentHeaderView = header
header.compressionTipView.reloadData() header.compressionTipView.reloadData()
header.sizeLabel.attributedText = header.getAttrText(fullText: "\(self.resourceData.count) Videos") header.sizeLabel.attributedText = header.getAttrText(fullText: "\(self.resourceData.count) Videos")
header.sizeLabel.isHidden = (self.resourceData.count <= 0)
header.filterButton.isHidden = (self.resourceData.count <= 0)
header.compressionTipView.isHidden = (PhotoManager.shared.permissionStatus != .authorized)
header.sortViewSubmitCallBack = {[weak self] filterModel in header.sortViewSubmitCallBack = {[weak self] filterModel in
guard let self else {return} guard let self else {return}
PhotoManager.shared.reloadTrashAndKeep() PhotoManager.shared.reloadTrashAndKeep()
...@@ -738,6 +742,7 @@ extension HomeVideoDetailController:WaterfallMutiSectionDelegate,UICollectionVie ...@@ -738,6 +742,7 @@ extension HomeVideoDetailController:WaterfallMutiSectionDelegate,UICollectionVie
} }
} }
self.addTrashView() self.addTrashView()
} }
} }
......
...@@ -47,7 +47,8 @@ class HomeInfoView :UIView { ...@@ -47,7 +47,8 @@ class HomeInfoView :UIView {
let sview:HomeInfoTitleView = HomeInfoTitleView(frame: CGRect(x: 0, y: 0, width: width, height: 84)) let sview:HomeInfoTitleView = HomeInfoTitleView(frame: CGRect(x: 0, y: 0, width: width, height: 84))
sview.titleLabel.text = self.titleText sview.titleLabel.text = self.titleText
sview.type = self.type sview.type = self.type
sview.filterButton.isHidden = self.type != .similar && self.type != .SimilarVideos sview.filterButton.isHidden = (self.type != .similar && self.type != .SimilarVideos || (ids?.count ?? 0 <= 0))
sview.numberLabel.isHidden = (ids?.count ?? 0 <= 0)
return sview return sview
}() }()
...@@ -314,7 +315,8 @@ class HomeInfoView :UIView { ...@@ -314,7 +315,8 @@ class HomeInfoView :UIView {
tableView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: deleteView.isHidden ? 12 : deleteView.height + 12 , right: 0) tableView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: deleteView.isHidden ? 12 : deleteView.height + 12 , right: 0)
self.nextRowButton.isHidden = !self.isShowNextRowButton() self.nextRowButton.isHidden = !self.isShowNextRowButton()
headerView.filterButton.isHidden = (self.type != .similar && self.type != .SimilarVideos || (ids?.count ?? 0 <= 0))
headerView.numberLabel.isHidden = (ids?.count ?? 0 <= 0)
} }
} }
......
...@@ -131,7 +131,7 @@ class PhotosRemoveBaseView: UIView { ...@@ -131,7 +131,7 @@ class PhotosRemoveBaseView: UIView {
self.rightButton.alpha = 0 self.rightButton.alpha = 0
self.maskTempleteView.backgroundColor = UIColor(red: 0.95, green: 0.21, blue: 0.21, alpha: 0.4000) self.maskTempleteView.backgroundColor = UIColor(red: 0.95, green: 0.21, blue: 0.21, alpha: 0.4000)
self.addSubview(self.maskTempleteView) self.addSubview(self.maskTempleteView)
self.bringSubviewToFront(self.leftButton)
} }
func showRightButton() { func showRightButton() {
...@@ -140,6 +140,7 @@ class PhotosRemoveBaseView: UIView { ...@@ -140,6 +140,7 @@ class PhotosRemoveBaseView: UIView {
}else { }else {
self.rightButton.center = imageView.center self.rightButton.center = imageView.center
} }
self.bringSubviewToFront(self.rightButton)
UIView.animate(withDuration: 0.2) { UIView.animate(withDuration: 0.2) {
self.rightButton.alpha = 1 self.rightButton.alpha = 1
self.maskTempleteView.backgroundColor = UIColor(red: 0.26, green: 0.78, blue: 0.41, alpha: 0.4000) self.maskTempleteView.backgroundColor = UIColor(red: 0.26, green: 0.78, blue: 0.41, alpha: 0.4000)
......
...@@ -29,22 +29,30 @@ class VideoDetaiNavView : UIView { ...@@ -29,22 +29,30 @@ class VideoDetaiNavView : UIView {
return button return button
}() }()
lazy var seletedAllBtn:UIButton = { lazy var seletedAllBtn:SelectAllButton = {
let btn:UIButton = UIButton(frame: CGRect(x: 0, y: 0, width: 115, height: 32)) let view = SelectAllButton()
btn.isSelected = false view.clipsToBounds = true
btn.backgroundColor = UIColor.colorWithHex(hexStr: "#F2F6FC") view.layer.cornerRadius = 16
btn.setImage(UIImage.init(named: "ic_check_similar"), for: .normal) view.tapCallback = {[weak self] isselect in
btn.setTitle("Select All", for: .normal) self?.seletedAllBtnClick()
btn.setImage(UIImage.init(named: "ic_close_similar"), for: .selected) }
btn.setTitle("Unselect all", for: .selected) return view
btn.setTitleColor(UIColor.colorWithHex(hexStr: mColor), for: .normal)
btn.setTitleColor(UIColor.colorWithHex(hexStr: black3Color), for: .selected) // let btn:UIButton = UIButton(frame: CGRect(x: 0, y: 0, width: 115, height: 32))
btn.titleLabel?.font = UIFont.systemFont(ofSize: 14, weight: .bold) // btn.isSelected = false
btn.changBtnWithStytl(btnStyle: .defalut, margin: 8) // btn.backgroundColor = UIColor.colorWithHex(hexStr: "#F2F6FC")
btn.addTarget(self, action: #selector(seletedAllBtnClick), for: .touchUpInside) // btn.setImage(UIImage.init(named: "ic_check_similar"), for: .normal)
btn.layer.cornerRadius = btn.height / 2 // btn.setTitle("Select All", for: .normal)
return btn // btn.setImage(UIImage.init(named: "ic_close_similar"), for: .selected)
// btn.setTitle("Unselect all", for: .selected)
// btn.setTitleColor(UIColor.colorWithHex(hexStr: mColor), for: .normal)
// btn.setTitleColor(UIColor.colorWithHex(hexStr: black3Color), for: .selected)
// btn.titleLabel?.font = UIFont.systemFont(ofSize: 14, weight: .bold)
// btn.changBtnWithStytl(btnStyle: .defalut, margin: 8)
// btn.addTarget(self, action: #selector(seletedAllBtnClick), for: .touchUpInside)
// btn.layer.cornerRadius = btn.height / 2
// return btn
}() }()
override init(frame: CGRect) { override init(frame: CGRect) {
...@@ -69,8 +77,15 @@ class VideoDetaiNavView : UIView { ...@@ -69,8 +77,15 @@ class VideoDetaiNavView : UIView {
self.addSubview(self.seletedAllBtn) self.addSubview(self.seletedAllBtn)
seletedAllBtn.x = marginLR // seletedAllBtn.x = marginLR
seletedAllBtn.centerY = navCenterY // seletedAllBtn.centerY = navCenterY
seletedAllBtn.snp.makeConstraints { make in
make.left.equalToSuperview().offset(marginLR)
make.height.equalTo(32)
make.centerY.equalTo(navCenterY)
}
backButton.snp.makeConstraints { make in backButton.snp.makeConstraints { make in
make.centerY.equalTo(navCenterY) make.centerY.equalTo(navCenterY)
...@@ -97,9 +112,9 @@ class VideoDetaiNavView : UIView { ...@@ -97,9 +112,9 @@ class VideoDetaiNavView : UIView {
DispatchQueue.main.async {[weak self] in DispatchQueue.main.async {[weak self] in
guard let self else {return} guard let self else {return}
seletedAllBtn.isSelected = !seletedAllBtn.isSelected // seletedAllBtn.isSelected = !seletedAllBtn.isSelected
self.seletedAllBtn.width = seletedAllBtn.isSelected ? 131 : 115 // self.seletedAllBtn.width = seletedAllBtn.isSelected ? 131 : 115
seletedAllBtn.x = marginLR // seletedAllBtn.x = marginLR
self.selectAllCallBack(seletedAllBtn.isSelected) self.selectAllCallBack(seletedAllBtn.isSelected)
} }
...@@ -112,6 +127,7 @@ class VideoDetaiNavView : UIView { ...@@ -112,6 +127,7 @@ class VideoDetaiNavView : UIView {
seletedAllBtn.isSelected = true seletedAllBtn.isSelected = true
seletedAllBtnClick() seletedAllBtnClick()
} }
backButton.isHidden = self.startSelectButton.isSelected
self.startSelectCallBack(self.startSelectButton.isSelected) self.startSelectCallBack(self.startSelectButton.isSelected)
} }
} }
...@@ -27,12 +27,45 @@ class HomePhotosDetailCollectionCell : UICollectionViewCell { ...@@ -27,12 +27,45 @@ class HomePhotosDetailCollectionCell : UICollectionViewCell {
} }
} }
var resourceIdent : AssetModel? var resourceIdent : AssetModel? {
didSet {
let sizeKB : Double = Double((resourceIdent?.assetSize ?? 0) / 1000)
if sizeKB < 1000{
self.saveSizeLabel.text = String(format: "%.2f KB" ,sizeKB)
}else if sizeKB < (1000 * 1000) && sizeKB > 1000{
self.saveSizeLabel.text = String(format: "%.2f MB" ,sizeKB/1000)
}else{
self.saveSizeLabel.text = String(format: "%.2f GB" ,sizeKB/(1000 * 1000))
}
}
}
var currentOrder : Int = 0 var currentOrder : Int = 0
lazy var saveSizeView: UIView = {
let view = UIView()
view.layer.masksToBounds = true
view.layer.cornerRadius = 12
view.backgroundColor = UIColor(red: 0, green: 0.51, blue: 1, alpha: 1)
return view
}()
lazy var saveSizeLabel: UILabel = {
let view = UILabel()
view.textAlignment = .left
view.textColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1)
view.font = UIFont.systemFont(ofSize: 12, weight: .semibold)
view.text = "0.0MB"
return view
}()
lazy var moreImageView: UIImageView = {
let view = UIImageView()
view.image = UIImage(named: "Frame 9")
view.backgroundColor = .clear
return view
}()
lazy var backImageView: UIImageView = { lazy var backImageView: UIImageView = {
let view = UIImageView() let view = UIImageView()
...@@ -91,6 +124,11 @@ class HomePhotosDetailCollectionCell : UICollectionViewCell { ...@@ -91,6 +124,11 @@ class HomePhotosDetailCollectionCell : UICollectionViewCell {
self.addSubview(self.selectImageView) self.addSubview(self.selectImageView)
self.addSubview(self.extensionView) self.addSubview(self.extensionView)
self.addSubview(self.saveSizeView)
self.saveSizeView.addSubview(self.saveSizeLabel)
self.saveSizeView.addSubview(self.moreImageView)
self.backImageView.snp.makeConstraints { make in self.backImageView.snp.makeConstraints { make in
make.left.right.height.width.equalToSuperview() make.left.right.height.width.equalToSuperview()
} }
...@@ -104,6 +142,23 @@ class HomePhotosDetailCollectionCell : UICollectionViewCell { ...@@ -104,6 +142,23 @@ class HomePhotosDetailCollectionCell : UICollectionViewCell {
make.bottom.right.equalToSuperview().offset(-6) make.bottom.right.equalToSuperview().offset(-6)
make.height.width.equalTo(18) make.height.width.equalTo(18)
} }
self.saveSizeView.snp.makeConstraints { make in
make.left.top.equalToSuperview().offset(6)
make.height.equalTo(24)
make.width.equalTo(100)
}
self.saveSizeLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(11)
make.centerY.equalToSuperview()
make.height.equalTo(17)
}
self.moreImageView.snp.makeConstraints { make in
make.right.equalToSuperview().offset(-10)
make.centerY.equalToSuperview()
make.height.width.equalTo(16)
}
} }
required init?(coder: NSCoder) { required init?(coder: NSCoder) {
......
...@@ -20,10 +20,10 @@ class HomePayDueView: UIView { ...@@ -20,10 +20,10 @@ class HomePayDueView: UIView {
override func awakeFromNib() { override func awakeFromNib() {
super.awakeFromNib() super.awakeFromNib()
freeTime.layer.cornerRadius = 8 freeTime.layer.cornerRadius = 10.5
freeTime.layer.masksToBounds = true freeTime.layer.masksToBounds = true
saveL.layer.cornerRadius = 8 saveL.layer.cornerRadius = 10.5
saveL.layer.masksToBounds = true saveL.layer.masksToBounds = true
dueDay.font = UIFont.scaledSystemFont(ofSize: 14, weight: .bold) dueDay.font = UIFont.scaledSystemFont(ofSize: 14, weight: .bold)
...@@ -32,9 +32,9 @@ class HomePayDueView: UIView { ...@@ -32,9 +32,9 @@ class HomePayDueView: UIView {
priceL.font = UIFont.scaledSystemFont(ofSize: 12, weight: .regular) priceL.font = UIFont.scaledSystemFont(ofSize: 12, weight: .regular)
freeTime.font = UIFont.scaledSystemFont(ofSize: 12, weight: .regular) freeTime.font = UIFont.scaledSystemFont(ofSize: 12, weight: .bold)
saveL.font = UIFont.scaledSystemFont(ofSize: 14, weight: .bold) saveL.font = UIFont.scaledSystemFont(ofSize: 12, weight: .bold)
freePrice.font = UIFont.scaledSystemFont(ofSize: 12, weight: .regular) freePrice.font = UIFont.scaledSystemFont(ofSize: 12, weight: .regular)
...@@ -73,7 +73,7 @@ class HomePayDueView: UIView { ...@@ -73,7 +73,7 @@ class HomePayDueView: UIView {
saveL.isHidden = false saveL.isHidden = false
priceL.text = "\(pord1.localizedPrice)" priceL.text = "\(pord1.localizedPrice)"
priceL.font = UIFont.scaledSystemFont(ofSize: 14, weight: .regular) priceL.font = UIFont.scaledSystemFont(ofSize: 12, weight: .regular)
} }
} }
......
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
<constraint firstAttribute="height" constant="21" id="HGB-v2-yhW" customClass="ScreenWidthRatioConstraint" customModule="PhoneManager" customModuleProvider="target"/> <constraint firstAttribute="height" constant="21" id="HGB-v2-yhW" customClass="ScreenWidthRatioConstraint" customModule="PhoneManager" customModuleProvider="target"/>
<constraint firstAttribute="width" constant="85" id="eSe-ik-cPa" customClass="ScreenWidthRatioConstraint" customModule="PhoneManager" customModuleProvider="target"/> <constraint firstAttribute="width" constant="85" id="eSe-ik-cPa" customClass="ScreenWidthRatioConstraint" customModule="PhoneManager" customModuleProvider="target"/>
</constraints> </constraints>
<fontDescription key="fontDescription" type="boldSystem" pointSize="14"/> <fontDescription key="fontDescription" type="boldSystem" pointSize="12"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
......
...@@ -245,8 +245,8 @@ class HomePayView:UIView { ...@@ -245,8 +245,8 @@ class HomePayView:UIView {
contentView2Switch?.snp.makeConstraints { make in contentView2Switch?.snp.makeConstraints { make in
make.right.equalToSuperview().offset(-16) make.right.equalToSuperview().offset(-16)
make.centerY.equalToSuperview() make.centerY.equalToSuperview()
make.width.equalTo(46) // make.width.equalTo(46)
make.height.equalTo(28) // make.height.equalTo(28)
} }
contentView2Switch?.addTarget(self, action: #selector(switchValueChanged(_:)), for: .valueChanged) contentView2Switch?.addTarget(self, action: #selector(switchValueChanged(_:)), for: .valueChanged)
...@@ -430,12 +430,13 @@ class HomePayView:UIView { ...@@ -430,12 +430,13 @@ class HomePayView:UIView {
make.left.equalTo(16) make.left.equalTo(16)
make.right.equalTo(-16) make.right.equalTo(-16)
make.top.equalTo(subTitle.snp.bottom).offset(8.RH()) make.top.equalTo(subTitle.snp.bottom).offset(8.RH())
make.bottom.equalToSuperview().offset(-16)
} }
tipsView.snp.makeConstraints { make in tipsView.snp.makeConstraints { make in
make.top.equalTo(titleLabel2!.snp.bottom).offset(230.RH()) make.top.equalTo(titleLabel2!.snp.bottom).offset(230.RH())
make.left.right.equalToSuperview().inset(12) make.left.right.equalToSuperview().inset(marginLR)
make.height.equalTo(110.RH()) // make.height.equalTo(110.RH())
} }
payDueView.snp.makeConstraints { make in payDueView.snp.makeConstraints { make in
......
...@@ -162,9 +162,15 @@ class SecretViewController: BaseViewController { ...@@ -162,9 +162,15 @@ class SecretViewController: BaseViewController {
secretDesc.text = "0 Photos, 0 Videos" secretDesc.text = "0 Photos, 0 Videos"
secretCollect.register(SecretFirstCell.self, forCellWithReuseIdentifier: SecretFirstCellID) secretCollect.register(SecretFirstCell.self, forCellWithReuseIdentifier: SecretFirstCellID)
seletedAllBtn.x = titleView.width - marginLR - seletedAllBtn.width // seletedAllBtn.x = titleView.width - marginLR - seletedAllBtn.width
seletedAllBtn.centerY = navCenterY // seletedAllBtn.centerY = navCenterY
titleView.addSubview(seletedAllBtn) titleView.addSubview(seletedAllBtn)
seletedAllBtn.snp.makeConstraints { make in
make.right.equalToSuperview().inset(marginLR)
make.height.equalTo(32)
make.centerY.equalTo(titleView.backBtn.snp.centerY)
}
secretTL.snp.makeConstraints { make in secretTL.snp.makeConstraints { make in
make.left.equalToSuperview().inset(UIEdgeInsets(top: 72.RW(), left: 15.RW(), bottom: 0, right: 0)) make.left.equalToSuperview().inset(UIEdgeInsets(top: 72.RW(), left: 15.RW(), bottom: 0, right: 0))
...@@ -281,10 +287,19 @@ class SecretViewController: BaseViewController { ...@@ -281,10 +287,19 @@ class SecretViewController: BaseViewController {
let all = self.selectArray.allObjects.sorted { a, b in let all = self.selectArray.allObjects.sorted { a, b in
guard let ia = a as? Int, guard let ia = a as? Int,
let ib = b as? Int else { return false } let ib = b as? Int else { return false }
return ia > ib return ia < ib
}
if let idx = all.first as? Int,
let name = self.dataSource[idx] as? String {
let url = "SecretIm".document().appendingPathComponent(name)
if name.hasSuffix(".png") {
let urls = "".af() + "/SecretIm/" + name
if let icon = UIImage(contentsOfFile: urls) {
PhoneShare([icon], parent: self)
}
}else{
PhoneShare([url], parent: self)
} }
if let name = self.dataSource.first {
} }
}else{ }else{
// 删除图片的时候不弹广告和内购 // 删除图片的时候不弹广告和内购
...@@ -298,24 +313,31 @@ class SecretViewController: BaseViewController { ...@@ -298,24 +313,31 @@ class SecretViewController: BaseViewController {
return b return b
}() }()
private lazy var seletedAllBtn:UIButton = { private lazy var seletedAllBtn:SelectAllButton = {
let btn:UIButton = UIButton(frame: CGRect(x: 0, y: 0, width: 115, height: 32)) let view = SelectAllButton()
btn.addTarget(self, action: #selector(seletedAllBtnClick), for: .touchUpInside) view.clipsToBounds = true
btn.backgroundColor = UIColor.colorWithHex(hexStr: "#F2F6FC") view.layer.cornerRadius = 16
btn.setImage(UIImage.init(named: "ic_check_similar"), for: .normal) view.tapCallback = {[weak self] isselect in
btn.setTitle("Select All", for: .normal) self?.seletedAllBtnClick()
btn.setImage(UIImage.init(named: "ic_close_similar"), for: .selected) }
btn.setTitle("Unselect all", for: .selected) return view
btn.setTitleColor(UIColor.colorWithHex(hexStr: mColor), for: .normal) // let btn:UIButton = UIButton(frame: CGRect(x: 0, y: 0, width: 115, height: 32))
btn.setTitleColor(UIColor.colorWithHex(hexStr: black3Color), for: .selected) // btn.addTarget(self, action: #selector(seletedAllBtnClick), for: .touchUpInside)
btn.titleLabel?.font = UIFont.systemFont(ofSize: 14, weight: .bold) // btn.backgroundColor = UIColor.colorWithHex(hexStr: "#F2F6FC")
btn.addTarget(self, action: #selector(seletedAllBtnClick), for: .touchUpInside) // btn.setImage(UIImage.init(named: "ic_check_similar"), for: .normal)
// btn.setTitle("Select All", for: .normal)
btn.layer.cornerRadius = btn.height / 2 // btn.setImage(UIImage.init(named: "ic_close_similar"), for: .selected)
btn.layer.masksToBounds = true // btn.setTitle("Unselect all", for: .selected)
btn.changBtnWithStytl(btnStyle: .defalut, margin: 8) // btn.setTitleColor(UIColor.colorWithHex(hexStr: mColor), for: .normal)
// btn.setTitleColor(UIColor.colorWithHex(hexStr: black3Color), for: .selected)
return btn // btn.titleLabel?.font = UIFont.systemFont(ofSize: 14, weight: .bold)
// btn.addTarget(self, action: #selector(seletedAllBtnClick), for: .touchUpInside)
//
// btn.layer.cornerRadius = btn.height / 2
// btn.layer.masksToBounds = true
// btn.changBtnWithStytl(btnStyle: .defalut, margin: 8)
//
// return btn
}() }()
deinit { deinit {
...@@ -369,9 +391,9 @@ extension SecretViewController : UICollectionViewDelegate,UICollectionViewDataSo ...@@ -369,9 +391,9 @@ extension SecretViewController : UICollectionViewDelegate,UICollectionViewDataSo
@objc private func seletedAllBtnClick() { @objc private func seletedAllBtnClick() {
DispatchQueue.main.async {[weak self] in DispatchQueue.main.async {[weak self] in
guard let self else {return} guard let self else {return}
seletedAllBtn.isSelected = !seletedAllBtn.isSelected // seletedAllBtn.isSelected = !seletedAllBtn.isSelected
self.seletedAllBtn.width = seletedAllBtn.isSelected ? 131 : 115 // self.seletedAllBtn.width = seletedAllBtn.isSelected ? 131 : 115
seletedAllBtn.x = titleView.width - marginLR - seletedAllBtn.width // seletedAllBtn.x = titleView.width - marginLR - seletedAllBtn.width
let sets = NSMutableSet() let sets = NSMutableSet()
if seletedAllBtn.isSelected { if seletedAllBtn.isSelected {
for i in 0..<dataSource.count { for i in 0..<dataSource.count {
......
...@@ -110,7 +110,7 @@ class SettingViewHeaderCell : UITableViewCell { ...@@ -110,7 +110,7 @@ class SettingViewHeaderCell : UITableViewCell {
self.preButtonImageView.snp.makeConstraints { make in self.preButtonImageView.snp.makeConstraints { make in
make.width.height.equalTo(46) make.width.height.equalTo(46)
make.left.equalToSuperview().offset(6) make.left.equalToSuperview().offset(-56)
make.top.equalToSuperview() make.top.equalToSuperview()
} }
...@@ -124,8 +124,23 @@ class SettingViewHeaderCell : UITableViewCell { ...@@ -124,8 +124,23 @@ class SettingViewHeaderCell : UITableViewCell {
make.centerX.equalToSuperview() make.centerX.equalToSuperview()
make.top.equalTo(self.sLabel.snp.bottom).offset(20) make.top.equalTo(self.sLabel.snp.bottom).offset(20)
} }
self.layoutIfNeeded()
if IAPManager.share.isSubscribed == false {
}
} }
// lazy var basic: CABasicAnimation = {
// let basic = CABasicAnimation(keyPath: "position.x")
// basic.fromValue = -50
// basic.toValue = self.moreButton.width + 10
// basic.repeatCount = .infinity
// preButtonImageView.layer.add(basic, forKey: "position")
// return basic
// }()
required init?(coder: NSCoder) { required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented") fatalError("init(coder:) has not been implemented")
} }
......
...@@ -52,6 +52,10 @@ class SettingViewController : BaseViewController , UITableViewDelegate, UITableV ...@@ -52,6 +52,10 @@ class SettingViewController : BaseViewController , UITableViewDelegate, UITableV
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.section == 0 { if indexPath.section == 0 {
let cell : SettingViewHeaderCell = tableView.dequeueReusableCell(withIdentifier: "SettingViewHeaderCell",for: indexPath) as! SettingViewHeaderCell let cell : SettingViewHeaderCell = tableView.dequeueReusableCell(withIdentifier: "SettingViewHeaderCell",for: indexPath) as! SettingViewHeaderCell
if IAPManager.share.isSubscribed == false {
// cell.basic.duration = 1.5
// cell.preButtonImageView.startAnimating()
}
return cell return cell
}else{ }else{
let model : SettingModel = modelData![indexPath.section] let model : SettingModel = modelData![indexPath.section]
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<rect key="frame" x="15" y="0.0" width="326" height="89"/> <rect key="frame" x="15" y="0.0" width="326" height="89"/>
<subviews> <subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="XwR-Ch-R1t"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="XwR-Ch-R1t">
<rect key="frame" x="6" y="15" width="44" height="44"/> <rect key="frame" x="6" y="15.000000000000004" width="44" height="44.333333333333343"/>
<constraints> <constraints>
<constraint firstAttribute="width" constant="44" id="waN-0f-ZFP"/> <constraint firstAttribute="width" constant="44" id="waN-0f-ZFP"/>
</constraints> </constraints>
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
</connections> </connections>
</button> </button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="G" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Lkh-fE-u5M"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="G" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Lkh-fE-u5M">
<rect key="frame" x="50" y="17" width="40" height="40"/> <rect key="frame" x="50" y="17.333333333333329" width="40" height="40"/>
<color key="backgroundColor" red="0.0" green="0.50980392156862742" blue="1" alpha="1" colorSpace="calibratedRGB"/> <color key="backgroundColor" red="0.0" green="0.50980392156862742" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<constraints> <constraints>
<constraint firstAttribute="width" constant="40" id="WQp-b1-7L9"/> <constraint firstAttribute="width" constant="40" id="WQp-b1-7L9"/>
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</userDefinedRuntimeAttributes> </userDefinedRuntimeAttributes>
</label> </label>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="equalSpacing" spacing="2" translatesAutoresizingMaskIntoConstraints="NO" id="tF1-pU-1Ak"> <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="equalSpacing" spacing="2" translatesAutoresizingMaskIntoConstraints="NO" id="tF1-pU-1Ak">
<rect key="frame" x="100" y="15.333333333333332" width="216" height="53.333333333333343"/> <rect key="frame" x="100" y="15.666666666666668" width="216" height="53.333333333333329"/>
<subviews> <subviews>
<stackView opaque="NO" contentMode="scaleToFill" distribution="equalSpacing" alignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="aXC-da-48n"> <stackView opaque="NO" contentMode="scaleToFill" distribution="equalSpacing" alignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="aXC-da-48n">
<rect key="frame" x="0.0" y="0.0" width="216" height="19.333333333333332"/> <rect key="frame" x="0.0" y="0.0" width="216" height="19.333333333333332"/>
...@@ -73,14 +73,14 @@ ...@@ -73,14 +73,14 @@
</view> </view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Social Media" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="49v-3u-EtJ"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Social Media" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="49v-3u-EtJ">
<rect key="frame" x="8" y="0.0" width="93" height="19.333333333333332"/> <rect key="frame" x="8" y="0.0" width="93" height="19.333333333333332"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/> <fontDescription key="fontDescription" type="boldSystem" pointSize="16"/>
<nil key="textColor"/> <color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
</subviews> </subviews>
</stackView> </stackView>
<stackView opaque="NO" contentMode="scaleToFill" distribution="equalSpacing" spacing="2" translatesAutoresizingMaskIntoConstraints="NO" id="5Cl-XH-rD8"> <stackView opaque="NO" contentMode="scaleToFill" distribution="equalSpacing" spacing="2" translatesAutoresizingMaskIntoConstraints="NO" id="5Cl-XH-rD8">
<rect key="frame" x="101" y="3.3333333333333339" width="115" height="13.000000000000002"/> <rect key="frame" x="101" y="3.0000000000000018" width="115" height="12.999999999999998"/>
<subviews> <subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="11 Nov" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2zo-ld-bPP"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="11 Nov" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2zo-ld-bPP">
<rect key="frame" x="0.0" y="0.0" width="85" height="13"/> <rect key="frame" x="0.0" y="0.0" width="85" height="13"/>
...@@ -110,15 +110,15 @@ ...@@ -110,15 +110,15 @@
</subviews> </subviews>
</stackView> </stackView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Google Payments:您的付款处于暂停状..." textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="8Mr-iL-2qm"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Google Payments:您的付款处于暂停状..." textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="8Mr-iL-2qm">
<rect key="frame" x="0.0" y="21.333333333333329" width="216" height="15.666666666666664"/> <rect key="frame" x="0.0" y="21.333333333333336" width="216" height="15.666666666666664"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/> <fontDescription key="fontDescription" type="system" weight="medium" pointSize="13"/>
<color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/> <color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Google Payments:您的付款处于暂停状..." textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="S8d-tj-cjO"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Google Payments:您的付款处于暂停状..." textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="S8d-tj-cjO">
<rect key="frame" x="0.0" y="39" width="216" height="14.333333333333336"/> <rect key="frame" x="0.0" y="39" width="216" height="14.333333333333336"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/> <fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" red="0.70196078431372544" green="0.70196078431372544" blue="0.70196078431372544" alpha="1" colorSpace="calibratedRGB"/> <color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
</subviews> </subviews>
...@@ -166,7 +166,7 @@ ...@@ -166,7 +166,7 @@
</objects> </objects>
<resources> <resources>
<image name="ic_emial_start" width="13" height="13.333333015441895"/> <image name="ic_emial_start" width="13" height="13.333333015441895"/>
<image name="ic_sel_com" width="24" height="24"/> <image name="ic_sel_com" width="24" height="24.333333969116211"/>
<image name="ic_unsel_com_red" width="24" height="24"/> <image name="ic_unsel_com_red" width="24" height="24"/>
<image name="icon_left_setting_grey" width="20" height="20"/> <image name="icon_left_setting_grey" width="20" height="20"/>
</resources> </resources>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<constraints> <constraints>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="60" id="q5h-W4-mcE"/> <constraint firstAttribute="height" relation="greaterThanOrEqual" constant="60" id="q5h-W4-mcE"/>
</constraints> </constraints>
<fontDescription key="fontDescription" type="boldSystem" pointSize="14"/> <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="16"/>
<color key="textColor" red="0.20000001789999999" green="0.20000001789999999" blue="0.20000001789999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="textColor" red="0.20000001789999999" green="0.20000001789999999" blue="0.20000001789999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
<userDefinedRuntimeAttributes> <userDefinedRuntimeAttributes>
......
...@@ -25,8 +25,8 @@ ...@@ -25,8 +25,8 @@
<constraints> <constraints>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="72" id="g5j-o3-20E"/> <constraint firstAttribute="height" relation="greaterThanOrEqual" constant="72" id="g5j-o3-20E"/>
</constraints> </constraints>
<fontDescription key="fontDescription" type="boldSystem" pointSize="14"/> <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="16"/>
<nil key="textColor"/> <color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="u6a-TR-UVD"> <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="u6a-TR-UVD">
...@@ -56,12 +56,12 @@ ...@@ -56,12 +56,12 @@
</userDefinedRuntimeAttributes> </userDefinedRuntimeAttributes>
</view> </view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="AcA-F1-B4u"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="AcA-F1-B4u">
<rect key="frame" x="0.0" y="99" width="136" height="45"/> <rect key="frame" x="0.0" y="99" width="151" height="45"/>
<color key="backgroundColor" red="0.94901960784313721" green="0.96470588235294119" blue="0.9882352941176471" alpha="1" colorSpace="calibratedRGB"/> <color key="backgroundColor" red="0.94901960784313721" green="0.96470588235294119" blue="0.9882352941176471" alpha="1" colorSpace="calibratedRGB"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="45" id="Xtx-DS-XGd"/> <constraint firstAttribute="height" constant="45" id="Xtx-DS-XGd"/>
</constraints> </constraints>
<fontDescription key="fontDescription" type="system" pointSize="14"/> <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="16"/>
<inset key="contentEdgeInsets" minX="10" minY="10" maxX="20" maxY="10"/> <inset key="contentEdgeInsets" minX="10" minY="10" maxX="20" maxY="10"/>
<inset key="titleEdgeInsets" minX="5" minY="0.0" maxX="-5" maxY="0.0"/> <inset key="titleEdgeInsets" minX="5" minY="0.0" maxX="-5" maxY="0.0"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/> <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<constraints> <constraints>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="50" id="BJb-Xh-MSY"/> <constraint firstAttribute="height" relation="greaterThanOrEqual" constant="50" id="BJb-Xh-MSY"/>
</constraints> </constraints>
<fontDescription key="fontDescription" type="boldSystem" pointSize="14"/> <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="16"/>
<color key="textColor" red="0.20000001789999999" green="0.20000001789999999" blue="0.20000001789999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="textColor" red="0.20000001789999999" green="0.20000001789999999" blue="0.20000001789999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
<userDefinedRuntimeAttributes> <userDefinedRuntimeAttributes>
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
</tableViewCell> </tableViewCell>
</objects> </objects>
<resources> <resources>
<image name="ic_sel_com" width="24" height="24"/> <image name="ic_sel_com" width="24" height="24.333333969116211"/>
<image name="ic_unsel_com_red" width="24" height="24"/> <image name="ic_unsel_com_red" width="24" height="24"/>
</resources> </resources>
</document> </document>
...@@ -35,16 +35,15 @@ class EmailCleanListController: BaseViewController { ...@@ -35,16 +35,15 @@ class EmailCleanListController: BaseViewController {
@objc func seletedAllBtnClick() { @objc func seletedAllBtnClick() {
DispatchQueue.main.async {[weak self] in DispatchQueue.main.async {[weak self] in
guard let self else {return} guard let self else {return}
seletedAllBtn.isUserInteractionEnabled = false // seletedAllBtn.isSelected = !seletedAllBtn.isSelected
seletedAllBtn.isSelected = !seletedAllBtn.isSelected // UIView.animate(withDuration: 0.2) {
UIView.animate(withDuration: 0.2) { // self.seletedAllBtn.width = self.seletedAllBtn.isSelected ? 131 : 115
self.seletedAllBtn.width = self.seletedAllBtn.isSelected ? 131 : 115 // self.seletedAllBtn.x = self.titleView.width - marginLR - self.seletedAllBtn.width
self.seletedAllBtn.x = self.titleView.width - marginLR - self.seletedAllBtn.width // } completion: { su in
} completion: { su in // if su {
if su { // self.seletedAllBtn.isUserInteractionEnabled = true
self.seletedAllBtn.isUserInteractionEnabled = true // }
} // }
}
tableView.changeSelectAll(seletedAllBtn.isSelected) tableView.changeSelectAll(seletedAllBtn.isSelected)
} }
} }
...@@ -60,15 +59,20 @@ class EmailCleanListController: BaseViewController { ...@@ -60,15 +59,20 @@ class EmailCleanListController: BaseViewController {
make.bottom.equalToSuperview() make.bottom.equalToSuperview()
} }
titleView.addSubview(seletedAllBtn) titleView.addSubview(seletedAllBtn)
seletedAllBtn.centerY = navCenterY seletedAllBtn.snp.makeConstraints { make in
seletedAllBtn.x = titleView.width - marginLR - seletedAllBtn.width make.right.equalToSuperview().inset(marginLR)
make.height.equalTo(32)
make.centerY.equalTo(titleView.backBtn.snp.centerY)
}
// seletedAllBtn.centerY = navCenterY
// seletedAllBtn.x = titleView.width - marginLR - seletedAllBtn.width
} }
lazy var titleLabel: UILabel = { lazy var titleLabel: UILabel = {
let label = UILabel() let label = UILabel()
label.text = "" label.text = ""
label.font = UIFont.systemFont(ofSize: 20, weight: .bold) label.font = UIFont.systemFont(ofSize: 20, weight: .bold)
label.textColor = .black label.textColor = UIColor.colorWithHex(hexStr: "#333333")
label.textAlignment = .left label.textAlignment = .left
view.addSubview(label) view.addSubview(label)
return label return label
...@@ -92,20 +96,27 @@ class EmailCleanListController: BaseViewController { ...@@ -92,20 +96,27 @@ class EmailCleanListController: BaseViewController {
return tab return tab
}() }()
private lazy var seletedAllBtn:UIButton = { private lazy var seletedAllBtn:SelectAllButton = {
let btn:UIButton = UIButton(frame: CGRect(x: 0, y: 0, width: 115, height: 32)) let view = SelectAllButton()
btn.addTarget(self, action: #selector(seletedAllBtnClick), for: .touchUpInside) view.clipsToBounds = true
btn.backgroundColor = UIColor.colorWithHex(hexStr: "#F2F6FC") view.layer.cornerRadius = 16
btn.setImage(UIImage.init(named: "ic_check_similar"), for: .normal) view.tapCallback = {[weak self] isselect in
btn.setTitle("Select All", for: .normal) self?.seletedAllBtnClick()
btn.setImage(UIImage.init(named: "ic_close_similar"), for: .selected) }
btn.setTitle("Unselect all", for: .selected) return view
btn.setTitleColor(UIColor.colorWithHex(hexStr: mColor), for: .normal) // let btn:UIButton = UIButton(frame: CGRect(x: 0, y: 0, width: 115, height: 32))
btn.setTitleColor(UIColor.colorWithHex(hexStr: black3Color), for: .selected) // btn.addTarget(self, action: #selector(seletedAllBtnClick), for: .touchUpInside)
btn.titleLabel?.font = UIFont.systemFont(ofSize: 14, weight: .bold) // btn.backgroundColor = UIColor.colorWithHex(hexStr: "#F2F6FC")
btn.layer.cornerRadius = btn.height / 2 // btn.setImage(UIImage.init(named: "ic_check_similar"), for: .normal)
btn.layer.masksToBounds = true // btn.setTitle("Select All", for: .normal)
btn.changBtnWithStytl(btnStyle: .defalut, margin: 8) // btn.setImage(UIImage.init(named: "ic_close_similar"), for: .selected)
return btn // btn.setTitle("Unselect all", for: .selected)
// btn.setTitleColor(UIColor.colorWithHex(hexStr: mColor), for: .normal)
// btn.setTitleColor(UIColor.colorWithHex(hexStr: black3Color), for: .selected)
// btn.titleLabel?.font = UIFont.systemFont(ofSize: 14, weight: .bold)
// btn.layer.cornerRadius = btn.height / 2
// btn.layer.masksToBounds = true
// btn.changBtnWithStytl(btnStyle: .defalut, margin: 8)
// return btn
}() }()
} }
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