Commit 939708d2 authored by CZ1004's avatar CZ1004

Merge branch 'develop_0409' into homeUpdate

* develop_0409:
  首页 按钮换位置
  首页动画
  设置 项目修改
  小组件 适配
parents 1d2ad718 56ec55dd
{"nm":"Render Me","h":1000,"w":1000,"meta":{"g":"LottieFiles AE 1.0.0","tc":"#ffffff"},"layers":[{"ty":4,"nm":"Blue","sr":1,"st":0,"op":100,"ip":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0]},"s":{"a":0,"k":[100,100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[500,500,0]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[0],"t":7},{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[100],"t":9},{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[100],"t":35},{"s":[0],"t":37}]}},"ef":[],"shapes":[{"ty":"gr","nm":"Ellipse 2","it":[{"ty":"sh","nm":"Path 1","d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,-55.228],[-55.228,0],[0,55.228],[55.228,0]],"o":[[0,55.228],[55.228,0],[0,-55.228],[-55.228,0]],"v":[[-100,0],[0,100],[100,0],[0,-100]]}}},{"ty":"st","nm":"Stroke 1","lc":2,"lj":1,"ml":4,"o":{"a":0,"k":100},"w":{"a":0,"k":60},"c":{"a":0,"k":[1,1,1]}},{"ty":"tr","a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[100,0]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}}]},{"ty":"gr","nm":"Ellipse 1","it":[{"ty":"sh","nm":"Path 1","d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,-55.228],[55.228,0],[0,55.228],[-55.228,0]],"o":[[0,55.228],[-55.228,0],[0,-55.228],[55.228,0]],"v":[[100,0],[0,100],[-100,0],[0,-100]]}}},{"ty":"st","nm":"Stroke 1","lc":2,"lj":1,"ml":4,"o":{"a":0,"k":100},"w":{"a":0,"k":60},"c":{"a":0,"k":[1,1,1]}},{"ty":"tr","a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[-100,0]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}}]},{"ty":"tm","nm":"Trim Paths 1","e":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.667,"y":1},"s":[85],"t":0},{"o":{"x":0.333,"y":0},"i":{"x":0.833,"y":0.833},"s":[70],"t":30},{"s":[85],"t":60}]},"o":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[0],"t":0},{"s":[360],"t":60}]},"s":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.667,"y":1},"s":[90],"t":0},{"o":{"x":0.333,"y":0},"i":{"x":0.833,"y":0.833},"s":[100],"t":30},{"s":[90],"t":60}]},"m":2}],"ind":1},{"ty":4,"nm":"Red","sr":1,"st":0,"op":100,"ip":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0]},"s":{"a":0,"k":[100,100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[500,500,0]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}},"ef":[],"shapes":[{"ty":"gr","nm":"Ellipse 2","it":[{"ty":"sh","nm":"Path 1","d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,-55.228],[-55.228,0],[0,55.228],[55.228,0]],"o":[[0,55.228],[55.228,0],[0,-55.228],[-55.228,0]],"v":[[-100,0],[0,100],[100,0],[0,-100]]}}},{"ty":"st","nm":"Stroke 1","lc":2,"lj":1,"ml":4,"o":{"a":0,"k":100},"w":{"a":0,"k":60},"c":{"a":0,"k":[1,1,1]}},{"ty":"tr","a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[100,0]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}}]},{"ty":"gr","nm":"Ellipse 1","it":[{"ty":"sh","nm":"Path 1","d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,-55.228],[55.228,0],[0,55.228],[-55.228,0]],"o":[[0,55.228],[-55.228,0],[0,-55.228],[55.228,0]],"v":[[100,0],[0,100],[-100,0],[0,-100]]}}},{"ty":"st","nm":"Stroke 1","lc":2,"lj":1,"ml":4,"o":{"a":0,"k":100},"w":{"a":0,"k":60},"c":{"a":0,"k":[1,1,1]}},{"ty":"tr","a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[-100,0]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}}]},{"ty":"tm","nm":"Trim Paths 1","e":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.667,"y":1},"s":[85],"t":0},{"o":{"x":0.333,"y":0},"i":{"x":0.833,"y":0.833},"s":[70],"t":30},{"s":[85],"t":60}]},"o":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[0],"t":0},{"s":[360],"t":60}]},"s":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.667,"y":1},"s":[90],"t":0},{"o":{"x":0.333,"y":0},"i":{"x":0.833,"y":0.833},"s":[100],"t":30},{"s":[90],"t":60}]},"m":2}],"ind":2},{"ty":4,"nm":"Circles","sr":1,"st":0,"op":100,"ip":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0]},"s":{"a":0,"k":[100,100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[500,500,0]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}},"ef":[],"shapes":[{"ty":"gr","nm":"Ellipse 2","it":[{"ty":"el","nm":"Ellipse Path 1","d":1,"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[76,76]}},{"ty":"fl","nm":"Fill 1","c":{"a":0,"k":[1,1,1]},"r":1,"o":{"a":0,"k":100}},{"ty":"tr","a":{"a":0,"k":[0,0]},"s":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[100,100],"t":34},{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[140,140],"t":39},{"s":[100,100],"t":47}]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[-100,0]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}}]},{"ty":"gr","nm":"Ellipse 1","it":[{"ty":"el","nm":"Ellipse Path 1","d":1,"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[76,76]}},{"ty":"fl","nm":"Fill 1","c":{"a":0,"k":[1,1,1]},"r":1,"o":{"a":0,"k":100}},{"ty":"tr","a":{"a":0,"k":[0,0]},"s":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[100,100],"t":6},{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[140,140],"t":11},{"s":[100,100],"t":19}]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[100,0]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}}]},{"ty":"gr","nm":"Group 1","it":[{"ty":"tr","a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[-100,0]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}}]},{"ty":"gr","nm":"Group 2","it":[{"ty":"tr","a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[100,0]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}}]}],"ind":3}],"v":"4.8.0","fr":29.97,"op":60,"ip":0,"assets":[]}
\ No newline at end of file
...@@ -9,7 +9,7 @@ import UIKit ...@@ -9,7 +9,7 @@ import UIKit
class HomeNavView:UIView { class HomeNavView:UIView {
private var titleLabel:UILabel! // private var titleLabel:UILabel!
private var settingBtn:UIButton! private var settingBtn:UIButton!
private var proBtn:UIButton! private var proBtn:UIButton!
private var tipLabel:UILabel! private var tipLabel:UILabel!
...@@ -29,19 +29,19 @@ class HomeNavView:UIView { ...@@ -29,19 +29,19 @@ class HomeNavView:UIView {
backgroundColor = .white backgroundColor = .white
titleLabel = UILabel() // titleLabel = UILabel()
titleLabel.text = "Cleanup" // titleLabel.text = "Cleanup"
titleLabel.font = UIFont.systemFont(ofSize: 20, weight: .bold) // titleLabel.font = UIFont.systemFont(ofSize: 20, weight: .bold)
titleLabel.textColor = UIColor.colorWithHex(hexStr: black3Color) // titleLabel.textColor = UIColor.colorWithHex(hexStr: black3Color)
titleLabel.sizeToFit() // titleLabel.sizeToFit()
//
self.addSubview(titleLabel) // self.addSubview(titleLabel)
//
titleLabel.snp.makeConstraints { make in // titleLabel.snp.makeConstraints { make in
//
make.centerY.equalTo(navCenterY) // make.centerY.equalTo(navCenterY)
make.left.equalTo(marginLR) // make.left.equalTo(marginLR)
} // }
settingBtn = UIButton() settingBtn = UIButton()
settingBtn.setImage(UIImage(named: "home_setting_icon"), for: .normal) settingBtn.setImage(UIImage(named: "home_setting_icon"), for: .normal)
...@@ -49,9 +49,10 @@ class HomeNavView:UIView { ...@@ -49,9 +49,10 @@ class HomeNavView:UIView {
self.addSubview(settingBtn) self.addSubview(settingBtn)
settingBtn.snp.makeConstraints { make in settingBtn.snp.makeConstraints { make in
// make.centerY.equalTo(navCenterY)
// make.right.equalToSuperview().offset(-marginLR)
make.centerY.equalTo(navCenterY) make.centerY.equalTo(navCenterY)
make.right.equalToSuperview().offset(-marginLR) make.left.equalTo(marginLR)
make.width.height.equalTo(iconWH) make.width.height.equalTo(iconWH)
} }
...@@ -62,8 +63,10 @@ class HomeNavView:UIView { ...@@ -62,8 +63,10 @@ class HomeNavView:UIView {
proBtn.snp.makeConstraints { make in proBtn.snp.makeConstraints { make in
// make.centerY.equalTo(navCenterY)
// make.right.equalTo(settingBtn.snp.left).offset(-8)
make.centerY.equalTo(navCenterY) make.centerY.equalTo(navCenterY)
make.right.equalTo(settingBtn.snp.left).offset(-8) make.right.equalToSuperview().offset(-marginLR)
make.width.equalTo(70) make.width.equalTo(70)
make.height.equalTo(iconWH) make.height.equalTo(iconWH)
} }
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="Y6W-OH-hqX"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="Y6W-OH-hqX">
<device id="retina6_12" orientation="portrait" appearance="light"/> <device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies> <dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
...@@ -16,18 +17,16 @@ ...@@ -16,18 +17,16 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="In6-Ib-vMq"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="In6-Ib-vMq">
<rect key="frame" x="0.0" y="0.33333333333331439" width="393" height="851.33333333333348"/> <rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<constraints>
<constraint firstAttribute="width" secondItem="In6-Ib-vMq" secondAttribute="height" multiplier="0.4618" id="pro-at-5R5"/>
</constraints>
</view> </view>
</subviews> </subviews>
<viewLayoutGuide key="safeArea" id="vDu-zF-Fre"/> <viewLayoutGuide key="safeArea" id="vDu-zF-Fre"/>
<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 firstItem="In6-Ib-vMq" firstAttribute="centerX" secondItem="5EZ-qb-Rvc" secondAttribute="centerX" id="Chj-38-1sF"/> <constraint firstAttribute="bottom" secondItem="In6-Ib-vMq" secondAttribute="bottom" id="Fxc-W0-tn1"/>
<constraint firstItem="In6-Ib-vMq" firstAttribute="width" secondItem="5EZ-qb-Rvc" secondAttribute="width" id="YGg-mA-X9M"/> <constraint firstItem="In6-Ib-vMq" firstAttribute="top" secondItem="5EZ-qb-Rvc" secondAttribute="top" id="SWH-Pc-co8"/>
<constraint firstItem="In6-Ib-vMq" firstAttribute="centerY" secondItem="5EZ-qb-Rvc" secondAttribute="centerY" id="ZB8-n3-NkT"/> <constraint firstItem="In6-Ib-vMq" firstAttribute="trailing" secondItem="vDu-zF-Fre" secondAttribute="trailing" id="Ujk-gr-J7O"/>
<constraint firstItem="In6-Ib-vMq" firstAttribute="leading" secondItem="vDu-zF-Fre" secondAttribute="leading" id="X8d-PF-cLI"/>
</constraints> </constraints>
</view> </view>
<connections> <connections>
......
...@@ -12,10 +12,15 @@ class LauchVC:UIViewController { ...@@ -12,10 +12,15 @@ class LauchVC:UIViewController {
@IBOutlet weak var backView: UIView! @IBOutlet weak var backView: UIView!
lazy var LaunchingView:LottieAnimationView = { private lazy var LaunchingView:LottieAnimationView = {
let animationView = LottieAnimationView(name: "AppLauncher")
let animationView = LottieAnimationView(name: "applicationLauncher") animationView.loopMode = .playOnce
animationView.play()
return animationView
}()
private lazy var LaunchingLoop: LottieAnimationView = {
let animationView = LottieAnimationView(name: "Loading_white")
animationView.loopMode = .loop animationView.loopMode = .loop
animationView.play() animationView.play()
return animationView return animationView
...@@ -24,46 +29,37 @@ class LauchVC:UIViewController { ...@@ -24,46 +29,37 @@ class LauchVC:UIViewController {
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
LaunchingView.frame = backView.bounds
backView.addSubview(LaunchingView) backView.addSubview(LaunchingView)
backView.addSubview(LaunchingLoop)
DispatchQueue.main.asyncAfter(deadline: .now() + 2, execute: { LaunchingView.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.centerY.equalToSuperview().offset(-80)
make.width.equalToSuperview().offset(-20)
make.height.equalTo(LaunchingView.snp.width).multipliedBy(276/504.0)
}
LaunchingLoop.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.centerY.equalToSuperview().offset(80)
}
DispatchQueue.main.asyncAfter(deadline: .now() + 3, execute: {
var vc:UIViewController? var vc:UIViewController?
if (UserDef.shard.isShowLanding) { if (UserDef.shard.isShowLanding) {
vc = HomeViewController() vc = HomeViewController()
}else { }else {
let Ssoryboard = UIStoryboard(name: "PermissionVC", bundle: nil) let Ssoryboard = UIStoryboard(name: "PermissionVC", bundle: nil)
if let current = Ssoryboard.instantiateViewController(identifier: "PermissionVCID") as? PermissionVC { if let current = Ssoryboard.instantiateViewController(identifier: "PermissionVCID") as? PermissionVC {
vc = current vc = current
} }
} }
guard let vc else {return} guard let vc else {return}
let nav = BaseNavViewController(rootViewController: vc) let nav = BaseNavViewController(rootViewController: vc)
cWindow?.rootViewController = nav cWindow?.rootViewController = nav
let transition = CATransition() let transition = CATransition()
transition.duration = 0.5 transition.duration = 0.5
// transition.type = CATransitionType.push // 推入动画
transition.subtype = CATransitionSubtype.fromRight // 从左侧推入 transition.subtype = CATransitionSubtype.fromRight // 从左侧推入
transition.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeInEaseOut) transition.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeInEaseOut)
// 添加动画到 window 的 layer
cWindow?.layer.add(transition, forKey: kCATransition) cWindow?.layer.add(transition, forKey: kCATransition)
// 显示 window
cWindow?.makeKeyAndVisible() cWindow?.makeKeyAndVisible()
}) })
......
...@@ -403,11 +403,11 @@ extension HomeNoAdsViewController : UIScrollViewDelegate { ...@@ -403,11 +403,11 @@ extension HomeNoAdsViewController : UIScrollViewDelegate {
} }
ppBtn.snp.makeConstraints { make in ppBtn.snp.makeConstraints { make in
make.top.equalTo(buybut.snp.bottom).offset(10) make.top.equalTo(buybut.snp.bottom).offset(10)
make.left.equalToSuperview().offset(15) make.left.equalTo(buybut)
} }
restoreBtn.snp.makeConstraints { make in restoreBtn.snp.makeConstraints { make in
make.centerY.equalTo(ppBtn) make.centerY.equalTo(ppBtn)
make.right.equalTo(stack.snp.right).offset(-10) make.right.equalTo(buybut.snp.right)
} }
self.type = 0 self.type = 0
self.view.layoutIfNeeded() self.view.layoutIfNeeded()
......
...@@ -107,28 +107,34 @@ class SecretViewController: BaseViewController { ...@@ -107,28 +107,34 @@ class SecretViewController: BaseViewController {
} }
private func deleteData() -> Void { private func deleteData() -> Void {
var DelCallBlock = { [weak self] in
guard let self = self else { return }
var delName:[String] = [] var delName:[String] = []
for idx in selectArray.allObjects { for idx in self.selectArray.allObjects {
guard let row:Int = idx as? Int else { return } guard let row:Int = idx as? Int else { return }
let name = dataSource[row] let name = self.dataSource[row]
delName.append(name) delName.append(name)
} }
"".delPhotoVideo(delName) "".delPhotoVideo(delName)
if selectArray.count > 0 { if self.selectArray.count > 0 {
selectArray.removeAllObjects() self.selectArray.removeAllObjects()
} }
Print("删除成功") Print("删除成功")
dataSource = loadData() self.dataSource = self.loadData()
bottomm.state = .add self.bottomm.state = .add
}
PMAlert("These photos or videos will be deleted from your private space" , ["Cancel","Delete"] , { alert, selectidx in
if selectidx == 1 {
DelCallBlock()
}
alert.dismiss(animated: true)
})
} }
@objc private func lockTouch(_ sender:UIButton) -> Void { @objc private func lockTouch(_ sender:UIButton) -> Void {
if pass.count > 2 { if pass.count > 2 {
let set = SecretSetViewController() let set = SecretSetViewController()
set.secretType = .del set.secretType = .del
set.Callback = { bt in
}
self.navigationController?.pushViewController(set, animated: true) self.navigationController?.pushViewController(set, animated: true)
}else{ }else{
let set = SecretSetViewController() let set = SecretSetViewController()
......
...@@ -60,10 +60,10 @@ func getSettingViewInfo() -> [SettingModel] { ...@@ -60,10 +60,10 @@ func getSettingViewInfo() -> [SettingModel] {
[RowInfoModel(imageName: "ic_more_setting",title: "More Apps From Us")]), [RowInfoModel(imageName: "ic_more_setting",title: "More Apps From Us")]),
SettingModel(sectionTitle: "UTILITIES",rowInfo: SettingModel(sectionTitle: "UTILITIES",rowInfo:
[RowInfoModel(imageName: "ic_widgets_setting",title: "Widgets")]), [RowInfoModel(imageName: "ic_widgets_setting",title: "Widgets")]),
SettingModel(sectionTitle: "SECRET SPACE",rowInfo: [ // SettingModel(sectionTitle: "SECRET SPACE",rowInfo: [
RowInfoModel(imageName: "ic_pin_setting",title: "Use PIN")]), // RowInfoModel(imageName: "ic_pin_setting",title: "Use PIN")]),
SettingModel(sectionTitle: "STAY IN TOUCH",rowInfo: SettingModel(sectionTitle: "STAY IN TOUCH",rowInfo:
[RowInfoModel(imageName: "ic_rate_setting",title: "Rate App"), [RowInfoModel(imageName: "ic_rate_setting",title: "Rate App"),
RowInfoModel(imageName: "ic_share_setting",title: "Share App"), RowInfoModel(imageName: "ic_share_setting",title: "Share App"),
RowInfoModel(imageName: "ic_ins_setting",title: "Follow on Instagram")])] /*RowInfoModel(imageName: "ic_ins_setting",title: "Follow on Instagram")*/])]
} }
...@@ -62,7 +62,7 @@ class SettingViewController : BaseViewController , UITableViewDelegate, UITableV ...@@ -62,7 +62,7 @@ class SettingViewController : BaseViewController , UITableViewDelegate, UITableV
let model : SettingModel = modelData![indexPath.section] let model : SettingModel = modelData![indexPath.section]
let detailModel : RowInfoModel = model.rowInfo[indexPath.row] let detailModel : RowInfoModel = model.rowInfo[indexPath.row]
if indexPath.section == 3 { if indexPath.section == 13 {
let cell : SettingSwitchCell = tableView.dequeueReusableCell(withIdentifier: "SettingSwitchCell",for: indexPath) as! SettingSwitchCell let cell : SettingSwitchCell = tableView.dequeueReusableCell(withIdentifier: "SettingSwitchCell",for: indexPath) as! SettingSwitchCell
cell.fLabel.text = detailModel.title cell.fLabel.text = detailModel.title
cell.logoView.image = UIImage(named: detailModel.imageName) cell.logoView.image = UIImage(named: detailModel.imageName)
...@@ -155,8 +155,6 @@ class SettingViewController : BaseViewController , UITableViewDelegate, UITableV ...@@ -155,8 +155,6 @@ class SettingViewController : BaseViewController , UITableViewDelegate, UITableV
self.navigationController?.pushViewController(widget, animated: true) self.navigationController?.pushViewController(widget, animated: true)
break break
case 3: case 3:
break
case 4:
if indexPath.row == 0 { // 评分 if indexPath.row == 0 { // 评分
self.review() self.review()
}else if indexPath.row == 1 { // 分享 }else if indexPath.row == 1 { // 分享
......
...@@ -39,7 +39,7 @@ class WidgetViewController: BaseViewController { ...@@ -39,7 +39,7 @@ class WidgetViewController: BaseViewController {
var widgetIdx = 0 var widgetIdx = 0
widgetIdx = (widgets == .battery ? 0 : 1) * 10 + widgetMode widgetIdx = (widgets == .battery ? 0 : 1) * 10 + widgetMode
widgetAppgourp.share.PushWidgetData(widgetIdx, battery: Int(battery), storage: Int(storage)) widgetAppgourp.share.PushWidgetData(widgetIdx, battery: Int(battery), storage: Int(storage))
alert("Set Widget Successfully") PMAlert("Set Widget Successfully")
} }
func setUI() -> Void { func setUI() -> Void {
......
...@@ -808,7 +808,7 @@ class SecretPhotoManager: NSObject, PhotoPickerControllerDelegate , CameraContro ...@@ -808,7 +808,7 @@ class SecretPhotoManager: NSObject, PhotoPickerControllerDelegate , CameraContro
func cameraController(_ cameraController: HXPhotoPicker.CameraController, didFinishWithResult result: HXPhotoPicker.CameraController.Result, phAsset: PHAsset?, location: CLLocation?) { func cameraController(_ cameraController: HXPhotoPicker.CameraController, didFinishWithResult result: HXPhotoPicker.CameraController.Result, phAsset: PHAsset?, location: CLLocation?) {
switch result { switch result {
case .image(let image): case .image(let image):
image.compressImage(0.7) {[weak self] image in image.compressImage(0.3) {[weak self] image in
let data = image.pngData() let data = image.pngData()
guard self?.callback != nil else { return } guard self?.callback != nil else { return }
self?.callback!(0,data) self?.callback!(0,data)
......
...@@ -55,15 +55,27 @@ func weekFormatter() -> String { ...@@ -55,15 +55,27 @@ func weekFormatter() -> String {
} }
func alert(_ msg:String) -> Void { func PMAlert(_ msg:String , _ action:[String] = [] , _ complate:@escaping(( UIAlertController ,Int)->Void) = { v , idx in} ) -> Void {
let alertview = UIAlertController(title: nil, message: msg, preferredStyle: .alert) let alertview = UIAlertController(title: nil, message: msg, preferredStyle: .alert)
guard let root = cWindow?.rootViewController else { return } guard let root = cWindow?.rootViewController else { return }
root.present(alertview, animated: true) root.present(alertview, animated: true)
if action.count > 0 {
for (i,title) in action.enumerated() {
let action = UIAlertAction(title: title, style: .default) { action in
complate(alertview,i)
}
alertview.addAction(action)
}
}else{
DispatchQueue.main.asyncAfter(deadline: .now() + 1) { DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
alertview.dismiss(animated: true) alertview.dismiss(animated: true)
} }
}
} }
public func Print(_ items: Any...) { public func Print(_ items: Any...) {
#if DEBUG #if DEBUG
......
...@@ -108,7 +108,7 @@ extension String { ...@@ -108,7 +108,7 @@ extension String {
pv(-1,UIImage.Clear()) pv(-1,UIImage.Clear())
return return
} }
icon.resizeAndCompressImage().compressImage(0.3) { image in icon.compressImage(0.2) { image in
SecretImageCache.share.saveImageCache(self, image) SecretImageCache.share.saveImageCache(self, image)
pv(-1,image) pv(-1,image)
} }
...@@ -121,7 +121,7 @@ extension String { ...@@ -121,7 +121,7 @@ extension String {
do { do {
let cgImage = try imageGenerator.copyCGImage(at: CMTime(value: 0, timescale: 1), actualTime: nil) let cgImage = try imageGenerator.copyCGImage(at: CMTime(value: 0, timescale: 1), actualTime: nil)
let icon = UIImage(cgImage: cgImage); let icon = UIImage(cgImage: cgImage);
icon.resizeAndCompressImage(0.3).compressImage(0.3) { image in icon.compressImage(0.2) { image in
SecretImageCache.share.saveImageCache(self, image,CMTimeGetSeconds(duration)) SecretImageCache.share.saveImageCache(self, image,CMTimeGetSeconds(duration))
pv(CMTimeGetSeconds(duration) ,image) pv(CMTimeGetSeconds(duration) ,image)
} }
......
...@@ -64,6 +64,7 @@ struct SimpleEntry: TimelineEntry { ...@@ -64,6 +64,7 @@ struct SimpleEntry: TimelineEntry {
struct BatteryWidgetEntryView : View { struct BatteryWidgetEntryView : View {
var entry: Provider.Entry var entry: Provider.Entry
var body: some View { var body: some View {
if #available(iOSApplicationExtension 17.0, *) {
ZStack { ZStack {
Color(getwidgetStyle().backgound).ignoresSafeArea() Color(getwidgetStyle().backgound).ignoresSafeArea()
VStack { VStack {
...@@ -83,6 +84,30 @@ struct BatteryWidgetEntryView : View { ...@@ -83,6 +84,30 @@ struct BatteryWidgetEntryView : View {
} }
}.padding(EdgeInsets(top: 16, leading: 10, bottom: 30, trailing: 10)) }.padding(EdgeInsets(top: 16, leading: 10, bottom: 30, trailing: 10))
} }
.containerBackground(for: .widget) {
Color(getwidgetStyle().backgound)
}
} else {
ZStack {
Color(getwidgetStyle().backgound).ignoresSafeArea()
VStack {
HStack(alignment: .center) {
Text(getwidgetStyle().lText).frame(maxWidth: .infinity,maxHeight: .infinity,alignment: .topLeading).font(.system(size: 14)).foregroundColor(Color(getwidgetStyle().textColor))
VStack(alignment: .center, spacing: 2) {
Text(String(getwidgetStyle().Angle) + "%" ).frame(maxWidth: .infinity,maxHeight: .infinity,alignment: .topTrailing).font(.system(size: 14)).foregroundColor(Color(getwidgetStyle().textColor))
if entry.widgets / 10 == 1 {
Text("Used").frame(maxWidth: .infinity,alignment: .topTrailing).font(.system(size: 10)).foregroundColor(Color(getwidgetStyle().textColor)).padding(EdgeInsets(top: 0, leading: 0, bottom: 0, trailing: 5))
}
}
}
ZStack {
Image(getwidgetStyle().icon)
ArcShape(startAngle: .degrees(-90), endAngle: .degrees(getwidgetStyle().Angle/100.0 * 360.0 - 90.0), clockwise: false)
.stroke(Color(getwidgetStyle().LineColor), style: StrokeStyle(lineWidth: 5, lineCap: .round) )
}
}.padding(EdgeInsets(top: 16, leading: 10, bottom: 30, trailing: 10))
}
}
} }
func getwidgetStyle() -> WidgetStyle { func getwidgetStyle() -> WidgetStyle {
...@@ -150,5 +175,6 @@ struct BatteryWidget: Widget { ...@@ -150,5 +175,6 @@ struct BatteryWidget: Widget {
BatteryWidgetEntryView(entry: entry) BatteryWidgetEntryView(entry: entry)
}.configurationDisplayName("").description("") }.configurationDisplayName("").description("")
.supportedFamilies([.systemSmall , .systemMedium]) .supportedFamilies([.systemSmall , .systemMedium])
} }
} }
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