Commit 8bd08628 authored by yqz's avatar yqz

优化

parent 545b78fb
......@@ -9,14 +9,15 @@ import WidgetKit
import SwiftUI
let kind: String = "LockSreen"
let kind1: String = "LockSreen1"
let kind: String = "com.app.phonemanager.lockSreenWidget"
let kind1: String = "com.app.phonemanager.lockSreenWidgetBattery"
@main
struct LockSreenBundle: WidgetBundle {
var body: some Widget {
LockStorageSreen(type: lockSreenType(isStorage: true, kind: kind, displayName: "Storage", description: "Monitor your storage space"))
LockStorageSreen(type: lockSreenType(kind: kind1, displayName: "Battery", description: "Monitor your battery"))
LockBattSreen(type: lockSreenType(kind: kind1, displayName: "Battery", description: "Monitor your battery"))
// LockStorageSreen(type: lockSreenType(kind: kind1, displayName: "Battery", description: "Monitor your battery"))
LockBothSreen()
}
}
......@@ -24,7 +25,26 @@ struct LockSreenBundle: WidgetBundle {
struct LockStorageSreen: Widget {
var type:lockSreenType = lockSreenType()
var body: some WidgetConfiguration {
StaticConfiguration(kind: type.kind, provider: LockSreenProvider()) { entry in
StaticConfiguration(kind: kind, provider: LockSreenProvider()) { entry in
if #available(iOS 17.0, *) {
LockSreenEntryView(type: type, entry: entry)
.containerBackground(.fill.tertiary, for: .widget)
} else {
LockSreenEntryView(type: type, entry: entry)
.padding()
.background(Color.clear)
}
}
.configurationDisplayName(type.displayName)
.description(type.description)
.supportedFamilies([.accessoryCircular,.accessoryRectangular])
}
}
struct LockBattSreen: Widget {
var type:lockSreenType = lockSreenType()
var body: some WidgetConfiguration {
StaticConfiguration(kind: kind1, provider: LockSreenProvider()) { entry in
if #available(iOS 17.0, *) {
LockSreenEntryView(type: type, entry: entry)
.containerBackground(.fill.tertiary, for: .widget)
......@@ -41,7 +61,7 @@ struct LockStorageSreen: Widget {
}
struct LockBothSreen: Widget {
let kind: String = "LockSreenBoth"
let kind: String = "com.app.phonemanager.lockSreenWidgetBoth"
var body: some WidgetConfiguration {
StaticConfiguration(kind: kind, provider: LockSreenProvider()) { entry in
if #available(iOS 17.0, *) {
......
......@@ -10,17 +10,17 @@ import SwiftUI
struct LockSreenProvider: TimelineProvider {
func placeholder(in context: Context) -> LockSreenEntry {
LockSreenEntry(date: .now, widgets: 0, widgetBattery: 0, widgetStorage: 0, widgetAllSpace: 0, widgetUseSpace: 0, batteryState: "Off", isCharging: false)
return LockSreenEntry(date: .now, widgets: 0, widgetBattery: 1, widgetStorage: 1, widgetAllSpace: 1, widgetUseSpace: 1, batteryState: "Off", isCharging: false)
}
func getSnapshot(in context: Context, completion: @escaping (LockSreenEntry) -> ()) {
let entry = LockSreenEntry(date: .now, widgets: 0, widgetBattery: 0, widgetStorage: 0, widgetAllSpace: 0, widgetUseSpace: 0, batteryState: "Off", isCharging: false)
let entry = LockSreenEntry(date: .now, widgets: 1, widgetBattery: 1, widgetStorage: 1, widgetAllSpace: 1, widgetUseSpace: 1, batteryState: "Off", isCharging: false)
completion(entry)
}
func getTimeline(in context: Context, completion: @escaping (Timeline<LockSreenEntry>) -> ()) {
let entry = loadSharedData()
let timeline = Timeline(entries: [entry], policy: .after(Date().addingTimeInterval(60)))
let timeline = Timeline(entries: [entry], policy: .after(Date().addingTimeInterval(100)))
completion(timeline)
}
......@@ -29,18 +29,19 @@ struct LockSreenProvider: TimelineProvider {
let data:Data = sharedDefaults.object(forKey: "widgetSharedData") as? Data,
let decodedData = try? JSONDecoder().decode(WidgetData.self, from: data)
else {
return LockSreenEntry(date: Date(), widgets: 0, widgetBattery: 0, widgetStorage: 0 ,widgetAllSpace: 0 ,widgetUseSpace: 0 ,batteryState: "Off" , isCharging: false)
return LockSreenEntry(date: Date(), widgets: 0, widgetBattery: 0, widgetStorage: 0 ,widgetAllSpace: 1 ,widgetUseSpace: 0 ,batteryState: "Off" , isCharging: false)
}
return LockSreenEntry(date: Date(), widgets: decodedData.widget, widgetBattery: decodedData.battery, widgetStorage: decodedData.widgetStorage,widgetAllSpace: decodedData.AllSpace,widgetUseSpace: decodedData.UseSpace ,batteryState: decodedData.batteryState ,isCharging: decodedData.isCharging)
}
}
struct WidgetData: Codable {
var userId: String
var widget: Int
var battery: Int
var widgetStorage: Int
var widgetStorage :Int
var AllSpace: Int
var UseSpace: Int
let batteryState: String
......
......@@ -39,11 +39,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
// window?.rootViewController = current
// window?.makeKeyAndVisible()
// }
// 小组件数据 同步
let battery = WidgetPublicModel.battery()
let storage = WidgetPublicModel.UseDiskSpace() * 100
widgetAppgourp.share.PushWidgetData(battery: Int(battery), storage: Int(storage))
// 获取内购价格
IAPManager.share.fetchProducts { p in
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group_1171275227@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group_1171275227@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group_1171275228@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group_1171275228@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "ic_list_setting.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ic_list_setting@2x.png",
"filename" : "Frame@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_list_setting@3x.png",
"filename" : "Frame@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
//
// PMSwipHintView.swift
// PhoneManager
//
// Created by edy on 2025/5/21.
//
import UIKit
class PMSwipHintView: UIView {
class func xib() -> PMSwipHintView {
let nib = UINib(nibName: "PMSwipHintView", bundle: nil).instantiate(withOwner: nil).first as! PMSwipHintView
nib.frame = CGRectMake(0, 0, ScreenW, ScreenH)
return nib
}
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
UIView.animate(withDuration: AniDuration-0.2) {
self.alpha = 0
} completion: { su in
self.removeFromSuperview()
}
}
}
<?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="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="FIR-bL-suQ" customClass="PMSwipHintView" customModule="PhoneManager" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="equalSpacing" spacing="35" translatesAutoresizingMaskIntoConstraints="NO" id="bdi-4y-If1">
<rect key="frame" x="125.66666666666667" y="286.66666666666669" width="141.66666666666663" height="279.00000000000006"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="equalSpacing" spacing="12" translatesAutoresizingMaskIntoConstraints="NO" id="fI1-sX-2fc">
<rect key="frame" x="0.0" y="0.0" width="141.66666666666666" height="122"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Group_1171275227" translatesAutoresizingMaskIntoConstraints="NO" id="Aof-Vb-mCI">
<rect key="frame" x="0.0" y="0.0" width="141.66666666666666" height="90"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jIo-6A-Wmj">
<rect key="frame" x="0.0" y="102" width="141.66666666666666" height="20"/>
<attributedString key="attributedText">
<fragment content="Swipe left to ">
<attributes>
<color key="NSColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<font key="NSFont" metaFont="system" size="18"/>
<paragraphStyle key="NSParagraphStyle" alignment="natural" lineBreakMode="wordWrapping" baseWritingDirection="natural" tighteningFactorForTruncation="0.0"/>
</attributes>
</fragment>
<fragment content="delete">
<attributes>
<color key="NSColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<font key="NSFont" metaFont="system" size="18"/>
<paragraphStyle key="NSParagraphStyle" alignment="natural" lineBreakMode="wordWrapping" baseWritingDirection="natural" tighteningFactorForTruncation="0.0"/>
</attributes>
</fragment>
</attributedString>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="equalSpacing" spacing="12" translatesAutoresizingMaskIntoConstraints="NO" id="VQh-MR-znh">
<rect key="frame" x="0.0" y="157" width="141.66666666666666" height="122"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Group_1171275228" translatesAutoresizingMaskIntoConstraints="NO" id="bNs-p1-kQ0">
<rect key="frame" x="0.0" y="0.0" width="141.66666666666666" height="90"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xwG-Xf-9nh">
<rect key="frame" x="0.0" y="101.99999999999994" width="141.66666666666666" height="20"/>
<attributedString key="attributedText">
<fragment content="Right swipe to ">
<attributes>
<color key="NSColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<font key="NSFont" metaFont="system" size="18"/>
<paragraphStyle key="NSParagraphStyle" alignment="natural" lineBreakMode="wordWrapping" baseWritingDirection="natural" tighteningFactorForTruncation="0.0"/>
</attributes>
</fragment>
<fragment content="save">
<attributes>
<color key="NSColor" red="0.32156862745098036" green="0.7803921568627451" blue="0.46274509803921571" alpha="1" colorSpace="calibratedRGB"/>
<font key="NSFont" metaFont="system" size="18"/>
<paragraphStyle key="NSParagraphStyle" alignment="natural" lineBreakMode="wordWrapping" baseWritingDirection="natural" tighteningFactorForTruncation="0.0"/>
</attributes>
</fragment>
</attributedString>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
</subviews>
</stackView>
</subviews>
<viewLayoutGuide key="safeArea" id="kYu-v0-w8e"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.69815582482993188" colorSpace="custom" customColorSpace="calibratedRGB"/>
<constraints>
<constraint firstItem="bdi-4y-If1" firstAttribute="centerX" secondItem="FIR-bL-suQ" secondAttribute="centerX" id="o0G-df-lDw"/>
<constraint firstItem="bdi-4y-If1" firstAttribute="centerY" secondItem="FIR-bL-suQ" secondAttribute="centerY" id="wCr-gG-BXr"/>
</constraints>
<point key="canvasLocation" x="131" y="-13"/>
</view>
</objects>
<resources>
<image name="Group_1171275227" width="102.33333587646484" height="90"/>
<image name="Group_1171275228" width="102.33333587646484" height="90"/>
</resources>
</document>
......@@ -32,7 +32,7 @@ class VideoViewController: UIViewController {
playerViewController.player = player
playerViewController.delegate = self
playerViewController.showsPlaybackControls = true
playerViewController.player?.isMuted = true
// 3. 添加到当前视图
addChild(playerViewController)
view.addSubview(playerViewController.view)
......
......@@ -261,6 +261,8 @@ class HomeViewController:BaseViewController {
isShowCharge = true
}
homeView?.viewModel.reloadTrashAndKeep()
}
override func viewDidAppear(_ animated: Bool) {
......
......@@ -26,6 +26,16 @@ class PhotoRemoveViewController: BaseViewController {
}
}
var isHints:Bool{
set {
UserDefaults.standard.set(newValue, forKey: "swipIsShowKey")
UserDefaults.standard.synchronize()
}
get{
return UserDefaults.standard.object(forKey: "swipIsShowKey") as? Bool ?? false
}
}
private var bottomConstraint: Constraint?
let formatter = DateFormatter()
......@@ -227,6 +237,12 @@ class PhotoRemoveViewController: BaseViewController {
self.view.addSubview(self.trashButton)
self.view.addSubview(self.keepListButton)
if isHints == false {
isHints = true
self.view.addSubview(PMSwipHintView.xib())
}
}
// 拿到当前类型垃圾桶数据的最后一个
......
......@@ -180,6 +180,7 @@ class HomeVideoCoverCell: UICollectionViewCell {
lazy var videoPlayer:AVPlayer = {
let palyer = AVPlayer.init()
palyer.volume = 0
palyer.isMuted = true
// 设置音频会话,允许混音
try? AVAudioSession.sharedInstance().setCategory(.playback, options: .mixWithOthers)
try? AVAudioSession.sharedInstance().setActive(true)
......
......@@ -16,25 +16,25 @@
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="SyR-iC-5WC">
<rect key="frame" x="16" y="301" width="361" height="250"/>
<rect key="frame" x="16" y="284.66666666666663" width="361" height="282.66666666666663"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ic_list_setting" translatesAutoresizingMaskIntoConstraints="NO" id="aer-UI-Hdf">
<rect key="frame" x="166.66666666666666" y="22" width="28" height="28"/>
<rect key="frame" x="154.33333333333334" y="20" width="52.333333333333343" height="52"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Stop retaining all photos?" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ITE-9H-tkI">
<rect key="frame" x="84.333333333333329" y="74" width="192.66666666666669" height="19.333333333333329"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="16"/>
<rect key="frame" x="64.333333333333329" y="96" width="232.66666666666669" height="24"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="20"/>
<color key="textColor" red="0.066666666669999999" green="0.066666666669999999" blue="0.066666666669999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="The retained list will be cleared and all photos will be displayed in the next scan." textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="35j-Q4-9L6">
<rect key="frame" x="26" y="97.333333333333314" width="309" height="28.666666666666671"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="12"/>
<rect key="frame" x="26" y="124.00000000000001" width="309" height="33.666666666666671"/>
<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"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="FLo-zT-dpO">
<rect key="frame" x="73" y="150" width="215" height="43"/>
<rect key="frame" x="73" y="181.66666666666663" width="215" height="43"/>
<color key="backgroundColor" red="0.0" green="0.50980392159999999" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="43" id="1O1-hE-Gz9"/>
......@@ -53,7 +53,11 @@
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="68F-oy-zob">
<rect key="frame" x="157" y="205" width="47" height="29"/>
<rect key="frame" x="73" y="229.66666666666669" width="215" height="43"/>
<constraints>
<constraint firstAttribute="width" constant="215" id="37L-vp-Feq"/>
<constraint firstAttribute="height" constant="43" id="c9Y-uS-7rN"/>
</constraints>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="14"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="Cancel">
......@@ -66,16 +70,16 @@
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="68F-oy-zob" secondAttribute="bottom" constant="10" id="4AF-7b-M1O"/>
<constraint firstItem="ITE-9H-tkI" firstAttribute="top" secondItem="aer-UI-Hdf" secondAttribute="bottom" constant="24" id="4n6-Nx-JEk"/>
<constraint firstItem="FLo-zT-dpO" firstAttribute="centerX" secondItem="35j-Q4-9L6" secondAttribute="centerX" id="Btb-F7-pNk"/>
<constraint firstItem="FLo-zT-dpO" firstAttribute="top" secondItem="35j-Q4-9L6" secondAttribute="bottom" constant="24" id="D5x-HU-13q"/>
<constraint firstAttribute="height" constant="250" id="ROB-W2-QK9"/>
<constraint firstAttribute="trailing" secondItem="35j-Q4-9L6" secondAttribute="trailing" constant="26" id="XKK-A0-h6s"/>
<constraint firstItem="68F-oy-zob" firstAttribute="centerX" secondItem="FLo-zT-dpO" secondAttribute="centerX" id="dfa-Sn-bR1"/>
<constraint firstItem="aer-UI-Hdf" firstAttribute="centerX" secondItem="SyR-iC-5WC" secondAttribute="centerX" id="gaW-p7-bEw"/>
<constraint firstItem="68F-oy-zob" firstAttribute="top" secondItem="FLo-zT-dpO" secondAttribute="bottom" constant="12" id="iwJ-qh-Bcp"/>
<constraint firstItem="68F-oy-zob" firstAttribute="top" secondItem="FLo-zT-dpO" secondAttribute="bottom" constant="5" id="iwJ-qh-Bcp"/>
<constraint firstItem="ITE-9H-tkI" firstAttribute="centerX" secondItem="aer-UI-Hdf" secondAttribute="centerX" id="pPT-En-OiR"/>
<constraint firstItem="aer-UI-Hdf" firstAttribute="top" secondItem="SyR-iC-5WC" secondAttribute="top" constant="22" id="qQG-VB-7uJ"/>
<constraint firstItem="aer-UI-Hdf" firstAttribute="top" secondItem="SyR-iC-5WC" secondAttribute="top" constant="20" id="qQG-VB-7uJ"/>
<constraint firstItem="35j-Q4-9L6" firstAttribute="top" secondItem="ITE-9H-tkI" secondAttribute="bottom" constant="4" id="xdP-7n-d3I"/>
<constraint firstItem="35j-Q4-9L6" firstAttribute="leading" secondItem="SyR-iC-5WC" secondAttribute="leading" constant="26" id="yW5-v3-r3e"/>
</constraints>
......@@ -97,7 +101,7 @@
</view>
</objects>
<resources>
<image name="ic_list_setting" width="28.333333969116211" height="28"/>
<image name="ic_list_setting" width="52.333332061767578" height="52"/>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
......
......@@ -37,6 +37,13 @@ class PMShowVideoCell: UICollectionViewCell {
}
}
}
selectBtn.snp.updateConstraints { make in
// if type == 0 {
// make.bottom.equalToSuperview().offset(-10)
// }else{
make.bottom.equalToSuperview().offset(-40)
// }
}
}
override init(frame: CGRect) {
......
......@@ -31,22 +31,27 @@ class SecretSetViewController: BaseViewController, UITextFieldDelegate {
override func viewDidLoad() {
super.viewDidLoad()
self.titleView.backBtn.setImage(UIImage(named: "ic_close_charging"), for: .normal)
self.titleView.model.isBackBtnShow = true
titleView.model.title = "Secret Library"
titleView.titleLabel.textColor = .black
titleView.titleLabel.textAlignment = .left
setUI()
if secretType != .verify || (SettingConfiguration.share.config.faceId ?? false ) == false {
ps.becomeFirstResponder()
}else{
self.faceID()
}
collect.register(SecretSetPsCell.self, forCellWithReuseIdentifier: SecretSetPsCellID)
self.navigationController?.interactivePopGestureRecognizer?.isEnabled = false
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
DispatchQueue.main.asyncAfter(deadline: .now() + 0.01) {
if self.secretType != .verify || (SettingConfiguration.share.config.faceId ?? false ) == false {
self.ps.becomeFirstResponder()
}else{
self.faceID()
}
}
}
func faceID() -> Void {
if PMFaceIDManger.request() {
PMFaceIDManger.authenticateWithFaceID(reason: "Unlock privacy space") {[weak self] success, error in
......
......@@ -86,6 +86,8 @@ class SecretViewController: BaseViewController {
}else{
secretLock.setImage(UIImage(named: "ic_lock_secret"), for: .normal)
}
self.loadData()
self.secretCollect.reloadData()
}
@discardableResult
......@@ -122,16 +124,16 @@ class SecretViewController: BaseViewController {
self.dataSource = self.loadData()
self.bottomm.state = .add
}
if SettingConfiguration.share.config.removeImg {
// 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)
})
}else{
DelCallBlock()
}
// }else{
// DelCallBlock()
// }
}
@objc private func lockTouch(_ sender:UIButton) -> Void {
......
......@@ -10,12 +10,6 @@ import Foundation
class SettingViewController : BaseViewController , UITableViewDelegate, UITableViewDataSource{
var modelData: [SettingModel]?
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
modelData = getSettingViewInfo()
self.tableView.reloadData()
}
lazy var tableView : UITableView = {
let cY = titleView.height + titleView.y
......@@ -46,11 +40,9 @@ class SettingViewController : BaseViewController , UITableViewDelegate, UITableV
self.titleView.titleLabel.textColor = UIColor(red: 0.2, green: 0.2, blue: 0.2, alpha: 1)
modelData = getSettingViewInfo()
self.view.addSubview(tableView)
self.tableView.reloadData()
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
let model : SettingModel = modelData![section]
......@@ -161,12 +153,13 @@ class SettingViewController : BaseViewController , UITableViewDelegate, UITableV
emailLoginSignOut()
break
case settingLabels.UsePIN.rawValue:
vibrate()
secretspace()
vibrate()
break
case settingLabels.UseFaceID.rawValue:
vibrate()
SetFaceID(indexPath)
vibrate()
break
case settingLabels.ChangePIN.rawValue:
changePIN()
......@@ -247,8 +240,8 @@ class SettingViewController : BaseViewController , UITableViewDelegate, UITableV
// MARK: - 隐私空间PIN
private func secretspace() -> Void {
let seting = SecretSetViewController()
if SettingConfiguration.share.config.secret?.count ?? 0 == 4 {
let seting = SecretSetViewController()
seting.secretType = .del
seting.Callback = {[weak self] success in
guard let self = self else { return }
......@@ -259,7 +252,6 @@ class SettingViewController : BaseViewController , UITableViewDelegate, UITableV
}
self.navigationController?.pushViewController(seting, animated: true)
}else{
let seting = SecretSetViewController()
seting.secretType = .create
seting.Callback = {[weak self] success in
guard let self = self else { return }
......@@ -295,12 +287,8 @@ class SettingViewController : BaseViewController , UITableViewDelegate, UITableV
private func changePIN() -> Void {
let seting = SecretSetViewController()
seting.secretType = .change
seting.Callback = {[weak self] success in
guard let self = self else { return }
if success {
// self.modelData = getSettingViewInfo()
// self.tableView.reloadData()
}
seting.Callback = { success in
}
self.navigationController?.pushViewController(seting, animated: true)
}
......
......@@ -27,31 +27,31 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="tips_duplicates_1" translatesAutoresizingMaskIntoConstraints="NO" id="5sP-3G-R5V">
<rect key="frame" x="41" y="185" width="346" height="137.66666666666663"/>
<rect key="frame" x="41" y="150" width="346" height="137.66666666666663"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="2 Duplicates" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="XMa-dY-JFG">
<rect key="frame" x="40" y="147" width="97" height="20"/>
<rect key="frame" x="40" y="112" width="97" height="20"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="16"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="tips_duplicates_1" translatesAutoresizingMaskIntoConstraints="NO" id="LIQ-mA-CKi">
<rect key="frame" x="41" y="380.66666666666669" width="346" height="137.00000000000006"/>
<rect key="frame" x="41" y="345.66666666666669" width="346" height="137"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="2 Duplicates" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dRr-c6-YoB">
<rect key="frame" x="40" y="342.66666666666669" width="97" height="20"/>
<rect key="frame" x="40" y="307.66666666666669" width="97" height="20"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="16"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Duplicates" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="U5t-M8-fCd">
<rect key="frame" x="151.66666666666666" y="544.66666666666663" width="124.99999999999997" height="30"/>
<rect key="frame" x="151.66666666666666" y="509.66666666666674" width="124.99999999999997" height="30"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="25"/>
<color key="textColor" red="0.10196078431372549" green="0.10196078431372549" blue="0.10196078431372549" 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="OOD-68-wMD">
<rect key="frame" x="25" y="592.66666666666663" width="390" height="50.333333333333371"/>
<rect key="frame" x="25" y="557.66666666666663" width="390" height="50.333333333333371"/>
<string key="text">These are duplicate photos - they are completely identical to each other. Immediately delete all duplicate items and keep the original version.</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"/>
......@@ -87,7 +87,7 @@
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="5sP-3G-R5V" secondAttribute="trailing" constant="53" id="h2C-hf-maH"/>
<constraint firstItem="OOD-68-wMD" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="25" id="jJ3-Yj-u0w"/>
<constraint firstItem="OOD-68-wMD" firstAttribute="top" secondItem="U5t-M8-fCd" secondAttribute="bottom" constant="18" id="lO2-YE-hId" customClass="ScreenHeightRatioConstraint" customModule="PhoneManager" customModuleProvider="target"/>
<constraint firstItem="XMa-dY-JFG" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" constant="85" id="lQN-9H-9H5" customClass="ScreenHeightRatioConstraint" customModule="PhoneManager" customModuleProvider="target"/>
<constraint firstItem="XMa-dY-JFG" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" constant="50" id="lQN-9H-9H5" customClass="ScreenHeightRatioConstraint" customModule="PhoneManager" customModuleProvider="target"/>
<constraint firstItem="LIQ-mA-CKi" firstAttribute="trailing" secondItem="5sP-3G-R5V" secondAttribute="trailing" id="qKI-bl-RGS"/>
<constraint firstItem="LIQ-mA-CKi" firstAttribute="top" secondItem="dRr-c6-YoB" secondAttribute="bottom" constant="18" id="qWW-HD-yM0" customClass="ScreenHeightRatioConstraint" customModule="PhoneManager" customModuleProvider="target"/>
<constraint firstItem="U5t-M8-fCd" firstAttribute="centerX" secondItem="LIQ-mA-CKi" secondAttribute="centerX" id="yXP-XE-VJ9"/>
......
......@@ -35,7 +35,13 @@ class PMScaleImageView: UIView , UIScrollViewDelegate {
}
self.showImg.snp.remakeConstraints({ make in
make.left.equalToSuperview().offset((self.width - size.width)/2.0 )
make.top.equalToSuperview().offset((self.height - size.height)/2.0 )
if size.height < self.height / 2.0 {
make.top.equalToSuperview().offset((self.height - size.height)/2.0 - 20 )
}else if self.height - size.height > 20 {
make.top.equalToSuperview().offset(10)
}else{
make.top.equalToSuperview().offset((self.height - size.height)/2.0 )
}
make.size.equalTo(size)
})
})
......
......@@ -22,7 +22,7 @@ struct Provider: TimelineProvider {
func getTimeline(in context: Context, completion: @escaping (Timeline<SimpleEntry>) -> Void) {
let entry = loadSharedData()
let timeline = Timeline(entries: [entry], policy: .after(Date().addingTimeInterval(60)))
let timeline = Timeline(entries: [entry], policy: .after(Date().addingTimeInterval(120)))
completion(timeline)
}
......@@ -419,58 +419,58 @@ struct BatteryWidget2: Widget {
struct AWidgetStorageView : View {
var entry: Provider.Entry
var body: some View {
if #available(iOSApplicationExtension 17.0, *) {
ZStack {
Text("\(entry.widgetBattery)")
}.foregroundColor(Color("333333"))
.containerBackground(for: .widget) {
AccessoryWidgetBackground()
}
} else {
ZStack {
Text("Hello")
}
}
}
}
struct LockScreenWidgetView :View {
var entry: Provider.Entry
@Environment(\.widgetFamily) var family
var body: some View {
switch family {
case .accessoryCircular:
AWidgetStorageView(entry: entry)
default:
EmptyView()
}
}
}
struct widgetLockSreenView: Widget {
let kind = "com.app.lockscreen.widget"
var body: some WidgetConfiguration {
if #available(iOSApplicationExtension 16.0, *) {
StaticConfiguration(kind: kind, provider: Provider()) { entry in
LockScreenWidgetView(entry: entry)
}
.configurationDisplayName("Storage")
.description("Monitor your storage space")
.supportedFamilies([
.accessoryCircular,
])
} else {
StaticConfiguration(kind: kind, provider: Provider()) { entry in
LockScreenWidgetView(entry: entry)
}
.configurationDisplayName("")
.description("")
.supportedFamilies([])
}
}
}
//struct AWidgetStorageView : View {
// var entry: Provider.Entry
// var body: some View {
// if #available(iOSApplicationExtension 17.0, *) {
// ZStack {
// Text("\(entry.widgetBattery)")
// }.foregroundColor(Color("333333"))
// .containerBackground(for: .widget) {
// AccessoryWidgetBackground()
// }
// } else {
// ZStack {
// Text("Hello")
// }
// }
// }
//}
//struct LockScreenWidgetView :View {
// var entry: Provider.Entry
// @Environment(\.widgetFamily) var family
// var body: some View {
// switch family {
// case .accessoryCircular:
// AWidgetStorageView(entry: entry)
// default:
// EmptyView()
// }
// }
//}
//struct widgetLockSreenView: Widget {
// let kind = "com.app.lockscreen.widget"
// var body: some WidgetConfiguration {
// if #available(iOSApplicationExtension 16.0, *) {
// StaticConfiguration(kind: kind, provider: Provider()) { entry in
// LockScreenWidgetView(entry: entry)
// }
// .configurationDisplayName("Storage")
// .description("Monitor your storage space")
// .supportedFamilies([
// .accessoryCircular,
// ])
// } else {
// StaticConfiguration(kind: kind, provider: Provider()) { entry in
// LockScreenWidgetView(entry: entry)
// }
// .configurationDisplayName("")
// .description("")
// .supportedFamilies([])
// }
// }
//}
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