Commit ed8f8528 authored by yqz's avatar yqz

优化

parent 18dcf1a5
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ic_Del_secret@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_Del_secret@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ic_Share_secret@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_Share_secret@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
......@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "tu3@2x.png",
"filename" : "Group_1171275242@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "tu3@3x.png",
"filename" : "Group_1171275242@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
......@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "tu4@2x.png",
"filename" : "Group_1171275243@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "tu4@3x.png",
"filename" : "Group_1171275243@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
......@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "sreenshot@2x.png",
"filename" : "Group_1@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "sreenshot@3x.png",
"filename" : "Group_1@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
......@@ -41,7 +41,7 @@ class ChargeVideoPlayingView: UIView {
}
self.player = AVPlayer(url: url)
self.player?.isMuted = true
self.playerLayer = AVPlayerLayer(player: self.player)
self.playerLayer?.frame = self.bounds
......
......@@ -43,6 +43,7 @@ class PreVideoController : BaseViewController {
DispatchQueue.main.async {
self.player = AVPlayer(url: avAsset.url)
self.player?.isMuted = true
self.playerLayer = AVPlayerLayer(player: self.player)
self.playerLayer?.frame = CGRect(x: 0, y: self.titleView.height, width: self.view.width, height: self.view.height - self.titleView.height)
self.view.layer.addSublayer(self.playerLayer!)
......
......@@ -88,8 +88,8 @@
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="hlo-KY-MjE">
<rect key="frame" x="393" y="0.0" width="393" height="613.33333333333337"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="equalSpacing" spacing="18" translatesAutoresizingMaskIntoConstraints="NO" id="2Yh-GL-Q2t">
<rect key="frame" x="40" y="41.333333333333314" width="313" height="530.66666666666674"/>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="equalSpacing" spacing="15" translatesAutoresizingMaskIntoConstraints="NO" id="2Yh-GL-Q2t">
<rect key="frame" x="40" y="24" width="313" height="565.33333333333337"/>
<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="313" height="19.333333333333332"/>
......@@ -98,25 +98,25 @@
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="tips_similar_1" translatesAutoresizingMaskIntoConstraints="NO" id="kvj-jW-PoF">
<rect key="frame" x="0.0" y="37.333333333333314" width="313" height="152.66666666666666"/>
<rect key="frame" x="0.0" y="34.333333333333343" width="313" height="175.66666666666666"/>
<constraints>
<constraint firstAttribute="width" secondItem="kvj-jW-PoF" secondAttribute="height" multiplier="281:137" id="IaD-TY-qFl"/>
<constraint firstAttribute="width" secondItem="kvj-jW-PoF" secondAttribute="height" multiplier="317:178" id="IaD-TY-qFl"/>
</constraints>
</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="207.99999999999997" width="313" height="19.333333333333343"/>
<rect key="frame" x="0.0" y="225" width="313" height="19.333333333333343"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="16"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="tips_similar_2" translatesAutoresizingMaskIntoConstraints="NO" id="x0D-ou-xRd">
<rect key="frame" x="0.0" y="245.33333333333331" width="313" height="152.33333333333331"/>
<rect key="frame" x="0.0" y="259.33333333333331" width="313" height="176"/>
<constraints>
<constraint firstAttribute="width" secondItem="x0D-ou-xRd" secondAttribute="height" multiplier="281:137" id="J9F-Fe-BXn"/>
<constraint firstAttribute="width" secondItem="x0D-ou-xRd" secondAttribute="height" multiplier="317:178" id="J9F-Fe-BXn"/>
</constraints>
</imageView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="equalSpacing" alignment="center" spacing="18" translatesAutoresizingMaskIntoConstraints="NO" id="jsL-Yg-DRw">
<rect key="frame" x="0.0" y="415.66666666666663" width="313" height="115"/>
<rect key="frame" x="0.0" y="450.33333333333337" width="313" height="115"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Similar photos" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="qDj-bm-OSE">
<rect key="frame" x="73.000000000000014" y="0.0" width="167.33333333333337" height="30"/>
......@@ -147,16 +147,16 @@
<rect key="frame" x="786" y="0.0" width="393" height="613.33333333333337"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="equalSpacing" spacing="55" translatesAutoresizingMaskIntoConstraints="NO" id="4BK-NH-6jQ">
<rect key="frame" x="40" y="40" width="313" height="533.33333333333337"/>
<rect key="frame" x="40" y="-3" width="313" height="619.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="0.0" y="0.0" width="313" height="363.33333333333331"/>
<rect key="frame" x="0.0" y="0.0" width="313" height="449.33333333333331"/>
<constraints>
<constraint firstAttribute="width" secondItem="zkZ-Px-VS8" secondAttribute="height" multiplier="341:396" id="BtW-U1-uWU"/>
<constraint firstAttribute="width" secondItem="zkZ-Px-VS8" secondAttribute="height" multiplier="262:376" id="BtW-U1-uWU"/>
</constraints>
</imageView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="equalSpacing" alignment="center" spacing="18" translatesAutoresizingMaskIntoConstraints="NO" id="PHa-RC-gM7">
<rect key="frame" x="0.0" y="418.33333333333337" width="313" height="115"/>
<rect key="frame" x="0.0" y="504.33333333333337" width="313" height="115"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="ScreenShot" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hAl-SL-XaU">
<rect key="frame" x="88" y="0.0" width="137" height="30"/>
......@@ -302,9 +302,9 @@
<image name="tips_duplicates_1" width="281" height="137.33332824707031"/>
<image name="tips_duplicates_2" width="281" height="137.33332824707031"/>
<image name="tips_photos" width="262" height="306"/>
<image name="tips_similar_1" width="281" height="137.33332824707031"/>
<image name="tips_similar_2" width="281" height="137.33332824707031"/>
<image name="tips_sreenshot" width="341" height="396"/>
<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_video" width="262" height="306"/>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
......
......@@ -27,7 +27,7 @@ class VideoViewController: UIViewController {
// 1. 创建播放器
if let url = self.url {
let player = AVPlayer(url: url)
player.isMuted = true
// 2. 配置播放器控制器
playerViewController.player = player
playerViewController.delegate = self
......
......@@ -74,6 +74,7 @@ class MaintaiDetialVideoCell: UITableViewCell {
lazy var videoPlayer:AVPlayer = {
let palyer = AVPlayer.init()
palyer.volume = 0
palyer.isMuted = true
return palyer
}()
......
......@@ -31,7 +31,7 @@ class PMShowItemCell: UICollectionViewCell {
return ic
}()
private lazy var selectBtn: UIButton = {
lazy var selectBtn: UIButton = {
let select = UIButton(type: .custom)
select.setImage(UIImage(named: "Frame 7"), for: .normal)
select.setImage(UIImage(named: "Frame 8"), for: .selected)
......
......@@ -76,7 +76,8 @@ class PMShowImgVideoController: BaseViewController {
self.MaxCollection.snp.makeConstraints { make in
make.left.right.equalToSuperview().inset(20)
make.top.equalTo(titleView.snp.bottom).offset(20)
make.bottom.equalToSuperview().inset(100 + (cWindow?.safeAreaInsets.bottom ?? 0))
make.bottom.equalTo(bottItems.snp.top)
// make.bottom.equalToSuperview().inset(100 + (cWindow?.safeAreaInsets.bottom ?? 0))
}
self.backView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
......@@ -84,7 +85,15 @@ class PMShowImgVideoController: BaseViewController {
}
self.bottItems.snp.makeConstraints { make in
make.left.right.equalToSuperview().inset(20)
make.top.equalToSuperview()
// make.top.equalToSuperview()
make.height.equalTo(100)
// make.bottom.equalToSuperview().offset(-(cWindow?.safeAreaInsets.bottom ?? 0))
make.bottom.equalTo(self.bottomBtns.snp.top)
}
let height:CGFloat = (state == .secret ? 78 : 0)
self.bottomBtns.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.height.equalTo(height)
make.bottom.equalToSuperview().offset(-(cWindow?.safeAreaInsets.bottom ?? 0))
}
self.view.layoutIfNeeded()
......@@ -158,6 +167,26 @@ class PMShowImgVideoController: BaseViewController {
return col
}()
private lazy var bottomBtns: SecretShowImgDetailView = {
let btns = SecretShowImgDetailView()
btns.backgroundColor = .white
backView.addSubview(btns)
btns.secretCallBack = {[weak self] selectIdx in
guard let self = self else { return }
var items = []
if selectIdx == 0 {
if let cell:PMShowImgCell = MaxCollection.cellForItem(at: IndexPath(row: currentIdx, section: 0) ) as? PMShowImgCell {
items.append(cell.icon)
}else if let cell:PMShowVideoCell = MaxCollection.cellForItem(at: IndexPath(row: currentIdx, section: 0) ) as? PMShowVideoCell {
}
PhoneShare(items, parent: self)
}
}
btns.clipsToBounds = true
return btns
}()
private lazy var backView: UIView = {
let v = UIView()
v.backgroundColor = .white
......@@ -263,6 +292,9 @@ extension PMShowImgVideoController : UICollectionViewDelegate,UICollectionViewDa
}
if let data = self.homeDataSource {
cell.bestResultButton.isHidden = indexPath.row != 0 || data.count <= 1
}else{
cell.selectBtn.isHidden = true
cell.bestResultButton.isHidden = true
}
cell.isCurrent = selectSet.contains(indexPath.row)
cell.callblock = {[weak self] in
......@@ -276,7 +308,6 @@ extension PMShowImgVideoController : UICollectionViewDelegate,UICollectionViewDa
self.homeDataSource?[indexPath.row].isSeleted = true
self.selectSet.add(indexPath.row)
}
// self.MaxCollection.reloadData()
cell.isCurrent = selectSet.contains(indexPath.row)
self.bottItems.reloadData()
}
......@@ -296,7 +327,6 @@ extension PMShowImgVideoController : UICollectionViewDelegate,UICollectionViewDa
self.homeDataSource?[indexPath.row].isSeleted = true
self.selectSet.add(indexPath.row)
}
// self.MaxCollection.reloadData()
cell.isCurrent = selectSet.contains(indexPath.row)
self.bottItems.reloadData()
}
......@@ -304,6 +334,11 @@ extension PMShowImgVideoController : UICollectionViewDelegate,UICollectionViewDa
}
}else{
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: PMShowItemCellID, for: indexPath) as! PMShowItemCell
if let data = self.homeDataSource {
}else{
cell.selectBtn.isHidden = true
}
showName.loadPhotoOrVideo { duration, icon in
DispatchQueue.main.async {
cell.icon = icon
......
......@@ -9,6 +9,7 @@ import UIKit
import HXPhotoPicker
import Photos
class SecretViewController: BaseViewController {
static let psKey:String = "SecretKey"
......
//
// SecretShowImgDetailView.swift
// PhoneManager
//
// Created by edy on 2025/5/20.
//
import UIKit
class SecretShowImgDetailView: UIView {
var secretCallBack:((Int)->Void) = { select in }
@objc func showImageActions(_ sender:UIButton) -> Void {
secretCallBack(sender.tag)
}
private func setup() -> Void {
shareBtn.snp.makeConstraints { make in
make.left.top.bottom.equalToSuperview().inset(16)
make.right.equalTo(self.snp.centerX).offset(-7.5)
}
delBtn.snp.makeConstraints { make in
make.right.top.bottom.equalToSuperview().inset(16)
make.left.equalTo(self.snp.centerX).offset(7.5)
}
layoutIfNeeded()
DispatchQueue.main.asyncAfter(deadline: .now()+0.1) {
self.shareBtn.Radius = self.shareBtn.height / 2.0
self.delBtn.Radius = self.delBtn.height / 2.0
}
}
override init(frame: CGRect) {
super.init(frame: frame)
setup()
}
required init?(coder: NSCoder) {
super.init(coder: coder)
}
private lazy var shareBtn: UIButton = {
let share = UIButton(type: .custom)
share.setTitle("Share", for: .normal)
share.setTitleColor(UIColor.colorWithHex(hexStr: "#333333"), for: .normal)
share.titleLabel?.font = UIFont.systemFont(ofSize: 14, weight: .medium)
share.setImage(UIImage(named: "ic_Share_secret"), for: .normal)
share.backgroundColor = UIColor.colorWithHex(hexStr: "#F2F6FC")
share.tag = 0
share.addTarget(self, action: #selector(showImageActions(_:)), for: .touchUpInside)
addSubview(share)
return share
}()
private lazy var delBtn: UIButton = {
let share = UIButton(type: .custom)
share.setTitle("Delete", for: .normal)
share.setTitleColor(UIColor.colorWithHex(hexStr: "#333333"), for: .normal)
share.setImage(UIImage(named: "ic_Del_secret"), for: .normal)
share.tag = 1
share.addTarget(self, action: #selector(showImageActions(_:)), for: .touchUpInside)
share.titleLabel?.font = UIFont.systemFont(ofSize: 14, weight: .medium)
share.backgroundColor = UIColor.colorWithHex(hexStr: "#F2F6FC")
addSubview(share)
return share
}()
}
......@@ -88,9 +88,10 @@ class SecretVideoPlayer: UIView {
player = AVPlayer(url: url!)
if let playerLayer = layer.sublayers?.first as? AVPlayerLayer {
playerLayer.player = player
player?.volume = 0
player?.isMuted = true
if fromState == .home {
playerLayer.videoGravity = .resizeAspectFill
player?.isMuted = true
}else{
playerLayer.videoGravity = .resizeAspect
}
......
......@@ -205,7 +205,7 @@ class SettingViewController : BaseViewController , UITableViewDelegate, UITableV
self.review()
break
case settingLabels.ShareUs.rawValue:
self.PhoneShare()
self.Share()
break
case settingLabels.Hint.rawValue:
let hint = PMHintsController()
......@@ -368,13 +368,9 @@ class SettingViewController : BaseViewController , UITableViewDelegate, UITableV
}
// MARK: - 分享
private func PhoneShare() -> Void {
private func Share() -> Void {
let items: [Any] = ["Want to organize your photo library and free up storage space? Try our app’s smart cleanup feature now!",URL(string: "https://apps.apple.com/app/id1530333201")! ]
let shareVc = UIActivityViewController(
activityItems: items,
applicationActivities: nil
)
present(shareVc, animated: true)
PhoneShare(items, parent: self)
}
}
......@@ -22,10 +22,10 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="tips_sreenshot" translatesAutoresizingMaskIntoConstraints="NO" id="QGK-yy-jOF">
<rect key="frame" x="44.666666666666657" y="105" width="341" height="396"/>
<rect key="frame" x="84" y="105" width="262" height="376"/>
<constraints>
<constraint firstAttribute="height" constant="396" id="SIW-Kc-ZGi" customClass="ScreenHeightRatioConstraint" customModule="PhoneManager" customModuleProvider="target"/>
<constraint firstAttribute="width" constant="341" id="hZh-ma-7Bw" customClass="ScreenHeightRatioConstraint" customModule="PhoneManager" customModuleProvider="target"/>
<constraint firstAttribute="height" constant="376" id="SIW-Kc-ZGi" customClass="ScreenHeightRatioConstraint" customModule="PhoneManager" customModuleProvider="target"/>
<constraint firstAttribute="width" constant="262" id="hZh-ma-7Bw" customClass="ScreenHeightRatioConstraint" customModule="PhoneManager" customModuleProvider="target"/>
</constraints>
</imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ybT-3z-Wb2">
......@@ -42,13 +42,13 @@
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="ScreenShot" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="h8I-lL-ELV">
<rect key="frame" x="146.66666666666666" y="556" width="136.99999999999997" height="30"/>
<rect key="frame" x="146.66666666666666" y="536" width="136.99999999999997" height="30"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="25"/>
<color key="textColor" red="0.1019607843" green="0.1019607843" blue="0.1019607843" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="VkR-UI-FBK">
<rect key="frame" x="25" y="604" width="380" height="50.333333333333371"/>
<rect key="frame" x="25" y="584" width="380" height="50.333333333333371"/>
<string key="text">We will group similar screenshots together so that you can view them faster! Please safely view and select the customer cut-off you want to move to the trash can.</string>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
......@@ -73,7 +73,7 @@
</view>
</objects>
<resources>
<image name="tips_sreenshot" width="341" height="396"/>
<image name="tips_sreenshot" width="262" height="376"/>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
......
......@@ -1237,7 +1237,6 @@ class SecretPhotoManager: NSObject, PhotoPickerControllerDelegate , CameraContro
var callback:((Int,Any)->Void)?
func show(_ type:Int) -> Void {
if type == 0 {
let config = CameraConfiguration()
let vc = CameraController(config: config, type: .all, delegate: self)
......@@ -1254,8 +1253,6 @@ class SecretPhotoManager: NSObject, PhotoPickerControllerDelegate , CameraContro
root.present(vc, animated: true)
}
}
}
extension Array {
......
......@@ -74,6 +74,15 @@ func PMAlert(title:String? = nil, messsage:String , action:[String] = [] ,compla
}
// MARK: - 分享
public func PhoneShare(_ items:[Any] ,parent:UIViewController) -> Void {
let shareVc = UIActivityViewController(
activityItems: items,
applicationActivities: nil
)
parent.present(shareVc, animated: true)
}
public func Print(_ items: Any...) {
......
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