Commit c91e1482 authored by yqz's avatar yqz

优化

parent 0d56e7a2
{
"images" : [
{
"filename" : "ic_close_similar.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ic_close_similar@2x.png",
"filename" : "Frame_1171276341@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_close_similar@3x.png",
"filename" : "Frame_1171276341@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
{
"images" : [
{
"filename" : "ic_close_similar.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ic_close_similar@2x.png",
"filename" : "Frame_1171276341@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_close_similar@3x.png",
"filename" : "Frame_1171276341@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
......@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "Group_1@2x.png",
"filename" : "Group_1171275249@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group_1@3x.png",
"filename" : "Group_1171275249@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
......@@ -38,7 +38,7 @@ class CustomDupHeaderView : UITableViewHeaderFooterView {
if self.selectStatus {
selectLabel.text = "Select All"
}else{
selectLabel.text = "Deselect All"
selectLabel.text = "Unselect all"
}
let tap = UITapGestureRecognizer()
......@@ -78,7 +78,7 @@ extension CustomDupHeaderView {
@objc func cellSelectTap(){
if self.selectStatus {
self.subLabel.text = "Deselect All"
self.subLabel.text = "Unselect all"
}else {
self.subLabel.text = "Select All"
}
......
......@@ -86,7 +86,7 @@ class SelectAllButton : UIView {
private func updateText() {
imageView.image = isSelected ? UIImage(named: "ic_close_similar") : UIImage(named: "ic_check_similar")
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 ? "Deselect All" : "Select All"
label.text = isSelected ? "Unselect all" : "Select All"
// 强制布局更新以适应新文本
setNeedsLayout()
......
......@@ -201,7 +201,7 @@ extension ContactDupNormalView : UITableViewDelegate,UITableViewDataSource{
if let tempData = self.selectData[String(section)] {
if tempData.count == self.dataSourceModel[section].count{
// 改变UI
view.subLabel.text = "Deselect All"
view.subLabel.text = "Unselect all"
}else {
view.subLabel.text = "Select All"
}
......
......@@ -97,6 +97,9 @@
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="2 Similar" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="IhS-Gp-baN">
<rect key="frame" x="0.0" y="0.0" width="317" height="16"/>
<constraints>
<constraint firstAttribute="height" constant="16" id="eb1-DU-oKO"/>
</constraints>
<fontDescription key="fontDescription" type="boldSystem" pointSize="16"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
......@@ -109,6 +112,9 @@
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="2 Similar" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="GIs-vI-kWE">
<rect key="frame" x="0.0" y="224" width="317" height="16.333333333333343"/>
<constraints>
<constraint firstAttribute="height" constant="16.329999999999998" id="9nH-oa-mxO"/>
</constraints>
<fontDescription key="fontDescription" type="boldSystem" pointSize="16"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
......@@ -163,7 +169,7 @@
<rect key="frame" x="40" y="5" width="313" height="603.33333333333337"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="tips_sreenshot" translatesAutoresizingMaskIntoConstraints="NO" id="zkZ-Px-VS8">
<rect key="frame" x="25.666666666666629" y="0.0" width="262" height="376"/>
<rect key="frame" x="26.333333333333371" y="0.0" width="260.33333333333331" height="374"/>
<constraints>
<constraint firstAttribute="width" secondItem="zkZ-Px-VS8" secondAttribute="height" multiplier="262:376" id="BtW-U1-uWU"/>
</constraints>
......@@ -326,7 +332,7 @@
<image name="tips_photos" width="262" height="306"/>
<image name="tips_similar_1" width="317" height="178.33332824707031"/>
<image name="tips_similar_2" width="317" height="178"/>
<image name="tips_sreenshot" width="262" height="376"/>
<image name="tips_sreenshot" width="244" height="374"/>
<image name="tips_video" width="262" height="306"/>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
......
//
// PMKeepListAlert.swift
// PhoneManager
//
// Created by edy on 2025/5/21.
//
import UIKit
class PMKeepListAlert: UIViewController {
var CallBlock:(()->Void)?
class var isHint:Bool{
set {
UserDefaults.standard.set(newValue, forKey: "PMKeepListAlertKey")
UserDefaults.standard.synchronize()
}
get{
return UserDefaults.standard.object(forKey: "PMKeepListAlertKey") as? Bool ?? false
}
}
override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = .clear
}
@IBAction func sureActions(_ sender: Any) {
guard let call = CallBlock else { return }
call()
self.dismiss(animated: true)
}
func show(_ call:@escaping (()->Void)) -> Void {
CallBlock = call
self.modalPresentationStyle = .overFullScreen
cWindow?.rootViewController?.present(self, animated: true)
}
}
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="PMKeepListAlert" customModule="PhoneManager" customModuleProvider="target">
<connections>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="B1J-nX-M3q">
<rect key="frame" x="28" y="293.66666666666669" width="337" height="265.00000000000006"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" alignment="center" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="Ueh-B7-hWk">
<rect key="frame" x="0.0" y="24" width="337" height="217"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ic_list_setting" translatesAutoresizingMaskIntoConstraints="NO" id="rs0-yB-u5r">
<rect key="frame" x="142.33333333333334" y="0.0" width="52.333333333333343" height="52"/>
</imageView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="equalCentering" spacing="24" translatesAutoresizingMaskIntoConstraints="NO" id="h9O-7b-s0R">
<rect key="frame" x="45" y="72" width="247" height="145"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="equalSpacing" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="eX4-Ad-TS2">
<rect key="frame" x="0.0" y="0.0" width="247" height="75"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="It has been added to the reserved list" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7UJ-3b-QMP">
<rect key="frame" x="0.0" y="0.0" width="247" height="38.333333333333336"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="16"/>
<color key="textColor" red="0.066666666666666666" green="0.066666666666666666" blue="0.066666666666666666" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="This photo will no longer be shown to you. You can manage this list in &quot;Settings&quot;." textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="eHU-Fj-F18">
<rect key="frame" x="0.0" y="46.333333333333314" width="247" height="28.666666666666671"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="12"/>
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ZWx-A7-NHk">
<rect key="frame" x="0.0" y="99" width="247" height="46"/>
<color key="backgroundColor" red="0.0" green="0.50980392156862742" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="width" constant="247" id="1T6-ht-7hA"/>
<constraint firstAttribute="height" constant="46" id="zii-lK-niY"/>
</constraints>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="18"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="Sure"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="Radius">
<real key="value" value="23"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="sureActions:" destination="-1" eventType="touchUpInside" id="ruW-6q-iyj"/>
</connections>
</button>
</subviews>
</stackView>
</subviews>
</stackView>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="Ueh-B7-hWk" secondAttribute="bottom" constant="24" id="2L7-RI-FEX"/>
<constraint firstItem="Ueh-B7-hWk" firstAttribute="top" secondItem="B1J-nX-M3q" secondAttribute="top" constant="24" id="OSF-Th-BAm"/>
<constraint firstItem="Ueh-B7-hWk" firstAttribute="leading" secondItem="B1J-nX-M3q" secondAttribute="leading" id="xnt-Zp-k8L"/>
<constraint firstAttribute="trailing" secondItem="Ueh-B7-hWk" secondAttribute="trailing" id="znQ-8r-LKQ"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="Radius">
<real key="value" value="12"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
</subviews>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="B1J-nX-M3q" firstAttribute="centerY" secondItem="i5M-Pr-FkT" secondAttribute="centerY" id="GEa-l1-i6T"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="B1J-nX-M3q" secondAttribute="trailing" constant="28" id="baG-Ab-XsQ"/>
<constraint firstItem="B1J-nX-M3q" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="28" id="xNr-Ec-FCf"/>
</constraints>
<point key="canvasLocation" x="131" y="-11"/>
</view>
</objects>
<resources>
<image name="ic_list_setting" width="52.333332061767578" height="52"/>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
......@@ -23,28 +23,32 @@ class VideoViewController: UIViewController {
setupPlayer()
}
var player:AVPlayer?
func setupPlayer() {
// 1. 创建播放器
if let url = self.url {
let player = AVPlayer(url: url)
player.isMuted = true
// 2. 配置播放器控制器
playerViewController.player = player
playerViewController.delegate = self
playerViewController.showsPlaybackControls = true
playerViewController.player?.isMuted = true
// 3. 添加到当前视图
addChild(playerViewController)
view.addSubview(playerViewController.view)
playerViewController.view.frame = view.bounds
playerViewController.didMove(toParent: self)
// 4. 自动播放
if self.isAutoPlay {
player.play()
self.player = AVPlayer(url: url)
self.player?.isMuted = true
self.player?.volume = 0
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
// 2. 配置播放器控制器
self.playerViewController.player = self.player
self.playerViewController.delegate = self
self.playerViewController.showsPlaybackControls = true
self.playerViewController.player?.isMuted = true
// 3. 添加到当前视图
self.addChild(self.playerViewController)
self.view.addSubview(self.playerViewController.view)
self.playerViewController.view.frame = self.view.bounds
self.playerViewController.didMove(toParent: self)
// 4. 自动播放
if self.isAutoPlay {
self.player?.play()
self.player?.isMuted = true
}
}
}
}
}
......
......@@ -21,7 +21,7 @@ class HomeInfoViewController:BaseViewController {
btn.setImage(UIImage.init(named: "ic_check_similar"), for: .normal)
btn.setTitle("Select All", for: .normal)
btn.setImage(UIImage.init(named: "ic_close_similar"), for: .selected)
btn.setTitle("Deselect All", 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)
......
......@@ -436,6 +436,16 @@ class PhotoRemoveViewController: BaseViewController {
Singleton.shared.keepList[type] = [self.dataModel[currentIndex]]
}
}
DispatchQueue.main.asyncAfter(deadline: .now() + 0.31) {
if PMKeepListAlert.isHint == false {
PMKeepListAlert.isHint = true
let alert = PMKeepListAlert()
self.view.showBlur()
alert.show {
self.view.hideBlur()
}
}
}
}
func clearSigtonTrashData(){
......
......@@ -407,7 +407,14 @@ extension HomeInfoView:UITableViewDataSource,UITableViewDelegate {
self.keepAllNoDataCallBack()
}
}
if PMKeepListAlert.isHint == false {
PMKeepListAlert.isHint = true
let alert = PMKeepListAlert()
self.responderViewController()?.view.showBlur()
alert.show {
self.responderViewController()?.view.hideBlur()
}
}
}
cell.type = self.type
......
......@@ -18,7 +18,6 @@ class PhotosRemoveBaseView: UIView {
var innerVideoController : VideoViewController?
func reload(index:Int) -> Void {
if let url = url {
if self.innerVideoController == nil {
......@@ -27,13 +26,23 @@ class PhotosRemoveBaseView: UIView {
vc.isAutoPlay = index == 0
vc.url = url
self.imageView.removeFromSuperview()
self.addSubview(vc.view)
vc.view.snp.makeConstraints { make in
make.left.top.bottom.right.equalToSuperview()
}
vc.setupPlayer()
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
vc.playerViewController.player?.isMuted = true
vc.playerViewController.player?.volume = 0
vc.player?.isMuted = true
vc.player?.volume = 0
}
}
}else {
self.innerVideoController?.playerViewController.player?.play()
self.innerVideoController?.player?.isMuted = true
self.innerVideoController?.player?.volume = 0
}
}
}
......
......@@ -37,7 +37,7 @@ class VideoDetaiNavView : UIView {
btn.setImage(UIImage.init(named: "ic_check_similar"), for: .normal)
btn.setTitle("Select All", for: .normal)
btn.setImage(UIImage.init(named: "ic_close_similar"), for: .selected)
btn.setTitle("Deselect All", 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)
......
......@@ -58,7 +58,7 @@ class HomeInfoTableViewCell:UITableViewCell {
seletedAllBtn = UIButton()
seletedAllBtn?.titleLabel?.font = UIFont.systemFont(ofSize: 14, weight: .bold)
seletedAllBtn?.setTitle("Select All", for: .normal)
seletedAllBtn?.setTitle("Deselect All", for: .selected)
seletedAllBtn?.setTitle("Unselect all", for: .selected)
seletedAllBtn?.setTitleColor(UIColor.colorWithHex(hexStr: mColor), for: .normal)
seletedAllBtn?.sizeToFit()
......
......@@ -55,7 +55,7 @@
<constraint firstAttribute="width" constant="85" id="6LD-4Y-C7t" customClass="ScreenWidthRatioConstraint" customModule="PhoneManager" customModuleProvider="target"/>
<constraint firstAttribute="height" constant="21" id="YL8-Mf-YdS" customClass="ScreenWidthRatioConstraint" customModule="PhoneManager" customModuleProvider="target"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="12"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
......
......@@ -208,8 +208,9 @@ class HomePayView:UIView {
self.addSubview(contentView2!)
contentView2?.snp.makeConstraints({ make in
make.top.equalTo(tipsView.snp.bottom).offset(12)
make.centerX.equalToSuperview()
make.width.equalToSuperview().offset(-30)
// make.centerX.equalToSuperview()
// make.width.equalToSuperview().offset(-32)
make.left.right.equalToSuperview().inset(15)
make.height.equalTo(60.RH())
})
payButton?.snp.makeConstraints({ make in
......@@ -244,7 +245,7 @@ class HomePayView:UIView {
contentView2Switch?.snp.makeConstraints { make in
make.right.equalToSuperview().offset(-16)
make.centerY.equalToSuperview()
make.width.equalTo(69)
make.width.equalTo(46)
make.height.equalTo(28)
}
contentView2Switch?.addTarget(self, action: #selector(switchValueChanged(_:)), for: .valueChanged)
......@@ -422,7 +423,7 @@ class HomePayView:UIView {
trailTitle = UILabel()
trailTitle.text = "" //"Free for 7 days, then $6.99/week"
trailTitle.textColor = UIColor.colorWithHex(hexStr: black3Color)
trailTitle.textColor = UIColor.colorWithHex(hexStr: black6Color)
trailTitle.font = UIFont.scaledSystemFont(ofSize: 12, weight: .regular)
tipsView.addSubview(trailTitle)
trailTitle.snp.makeConstraints { make in
......
......@@ -205,21 +205,24 @@ class PMShowImgVideoController: BaseViewController {
}else{
self.imageVideoPath.remove(at: self.currentIdx)
self.MaxCollection.deleteItems(at: [IndexPath(row: self.currentIdx, section: 0)])
self.bottItems.deleteItems(at: [IndexPath(row: self.currentIdx, section: 0)])
if ((self.imageVideoPath.count) == self.currentIdx){
self.currentIdx -= 1
}
bottItems.scrollToItem(at: IndexPath(row: self.currentIdx, section: 0), at: .left, animated: true)
self.view.layoutIfNeeded()
self.MaxCollection.reloadData()
self.bottItems.reloadData()
DispatchQueue.main.async {
self.bottItems.reloadData()
}
}
}
// if SettingConfiguration.share.config.removeImg {
PMAlert(messsage:"These photos or videos will be deleted from your private space" , action: ["Cancel","Delete"] , complate: { alert, selectidx in
if selectidx == 1 {
DelCallBlock()
}
alert.dismiss(animated: true)
})
PMAlert(messsage:"These photos or videos will be deleted from your private space" , action: ["Cancel","Delete"] , complate: { alert, selectidx in
if selectidx == 1 {
DelCallBlock()
}
alert.dismiss(animated: true)
})
// }else{
// DelCallBlock()
// }
......@@ -296,7 +299,9 @@ extension PMShowImgVideoController : UICollectionViewDelegate,UICollectionViewDa
collectionView.reloadData()
}else{
self.currentIdx = indexPath.row;
self.MaxCollection.scrollToItem(at: indexPath, at: .centeredHorizontally, animated: true)
if indexPath.row >= imageVideoPath.count{
self.MaxCollection.scrollToItem(at: indexPath, at: .centeredHorizontally, animated: true)
}
}
}
}
......
......@@ -143,7 +143,6 @@ class SecretViewController: BaseViewController {
set.Callback = { cr in
set.dismiss(animated: true)
}
set.modalPresentationStyle = .fullScreen
self.present(set, animated: true)
}else{
......@@ -242,9 +241,9 @@ class SecretViewController: BaseViewController {
private lazy var bottomm: SecretBottomView = {
let b = SecretBottomView()
view.addSubview(b)
b.callback = { [weak self] in
b.callback = { [weak self] idx in
guard let self = self else { return }
if b.state == .add {
if idx < 0 {
if IAPManager.share.isSubscribed == false {
// 添加的时候需要先弹出广告
if AdvManager.shared.advTimeAfterInAPP <= 0{
......@@ -277,6 +276,15 @@ class SecretViewController: BaseViewController {
self.AddImagePicker(idx)
}
}
}else if idx == 0 {
let all = self.selectArray.allObjects.sorted { a, b in
guard let ia = a as? Int,
let ib = b as? Int else { return false }
return ia > ib
}
if let name = self.dataSource.first {
}
}else{
// 删除图片的时候不弹广告和内购
self.deleteData()
......@@ -296,7 +304,7 @@ class SecretViewController: BaseViewController {
btn.setImage(UIImage.init(named: "ic_check_similar"), for: .normal)
btn.setTitle("Select All", for: .normal)
btn.setImage(UIImage.init(named: "ic_close_similar"), for: .selected)
btn.setTitle("Deselect All", 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)
......
......@@ -16,11 +16,16 @@ class SecretBottomView: UIView {
override init(frame: CGRect) {
super.init(frame: frame)
addSubview(stack)
addSubview(but)
but.snp.makeConstraints { make in
make.height.equalTo(46)
make.top.left.right.equalToSuperview().inset(15)
}
stack.snp.makeConstraints { make in
make.left.right.top.equalToSuperview().inset(15)
make.height.equalTo(46)
}
layer.insertSublayer(clayer, at: 0)
}
......@@ -39,11 +44,21 @@ class SecretBottomView: UIView {
return l
}()
var callback:(()->Void)?
var callback:((Int)->Void)?
@objc func AddNew() -> Void {
guard (callback != nil) else {return}
callback!()
callback!(-1)
}
@objc func shareAction() -> Void {
guard (callback != nil) else {return}
callback!(0)
}
@objc func delAction() -> Void {
guard (callback != nil) else {return}
callback!(1)
}
private lazy var but: UIButton = {
......@@ -57,15 +72,54 @@ class SecretBottomView: UIView {
return b
}()
private lazy var share: UIButton = {
let b = UIButton(type: .custom)
b.backgroundColor = .colorWithHex(hexStr: "#F2F6FC")
b.layer.cornerRadius = 46/2.0
b.clipsToBounds = true
b.setTitle("Share", for: .normal)
b.titleLabel?.font = UIFont.systemFont(ofSize: 14, weight: .medium)
b.setImage(UIImage(named: "ic_Share_secret"), for: .normal)
b.setTitleColor(UIColor.colorWithHex(hexStr: "#333333"), for: .normal)
b.addTarget(self, action: #selector(shareAction), for: .touchUpInside)
return b
}()
private lazy var del: UIButton = {
let b = UIButton(type: .custom)
b.backgroundColor = .colorWithHex(hexStr: "#F2F6FC")
b.layer.cornerRadius = 46/2.0
b.clipsToBounds = true
b.setTitle("Delete", for: .normal)
b.setTitleColor(UIColor.colorWithHex(hexStr: "#333333"), for: .normal)
b.titleLabel?.font = UIFont.systemFont(ofSize: 14, weight: .medium)
b.setImage(UIImage(named: "ic_Del_secret"), for: .normal)
b.addTarget(self, action: #selector(delAction), for: .touchUpInside)
return b
}()
private lazy var stack: UIStackView = {
let st = UIStackView()
st.isHidden = true
addSubview(st)
st.spacing = 15
st.distribution = .fillEqually
st.addArrangedSubview(share)
st.addArrangedSubview(del)
return st
}()
var state:SecretState = .add {
didSet{
if state == .add {
but.setTitle("Add New", for: .normal)
but.setImage(UIImage(named: "ic_add_secret"), for: .normal)
}else{
but.setTitle("Delete", for: .normal)
but.setImage(UIImage(), for: .normal)
}
but.isHidden = !(state == .add)
stack.isHidden = (state == .add)
// if state == .add {
// but.setTitle("Add New", for: .normal)
// but.setImage(UIImage(named: "ic_add_secret"), for: .normal)
// }else{
// but.setTitle("Delete", for: .normal)
// but.setImage(UIImage(), for: .normal)
// }
}
}
......
......@@ -99,7 +99,7 @@ class EmailCleanListController: BaseViewController {
btn.setImage(UIImage.init(named: "ic_check_similar"), for: .normal)
btn.setTitle("Select All", for: .normal)
btn.setImage(UIImage.init(named: "ic_close_similar"), for: .selected)
btn.setTitle("Deselect All", 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)
......
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