Commit 92bec182 authored by CZ1004's avatar CZ1004

Merge branch 'dev_main' into dev_zhaoqian

* dev_main:
  1
  111
parents 9f7d65d9 e8a0ce1e
...@@ -70,6 +70,7 @@ class PMShowImgCell: UICollectionViewCell { ...@@ -70,6 +70,7 @@ class PMShowImgCell: UICollectionViewCell {
override init(frame: CGRect) { override init(frame: CGRect) {
super.init(frame: frame) super.init(frame: frame)
setup() setup()
backgroundColor = .clear
clipsToBounds = true clipsToBounds = true
} }
......
...@@ -94,6 +94,7 @@ class PMShowImgVideoController: BaseViewController { ...@@ -94,6 +94,7 @@ class PMShowImgVideoController: BaseViewController {
col.delegate = self; col.delegate = self;
col.dataSource = self; col.dataSource = self;
col.showsHorizontalScrollIndicator = false col.showsHorizontalScrollIndicator = false
col.backgroundColor = .clear
col.isPagingEnabled = true col.isPagingEnabled = true
col.register(PMShowImgCell.self, forCellWithReuseIdentifier: PMShowImgCellID) col.register(PMShowImgCell.self, forCellWithReuseIdentifier: PMShowImgCellID)
col.register(PMShowVideoCell.self, forCellWithReuseIdentifier: PMShowVideoCellID) col.register(PMShowVideoCell.self, forCellWithReuseIdentifier: PMShowVideoCellID)
...@@ -110,6 +111,7 @@ class PMShowImgVideoController: BaseViewController { ...@@ -110,6 +111,7 @@ class PMShowImgVideoController: BaseViewController {
let col = UICollectionView(frame: CGRect(), collectionViewLayout: flowlayout) let col = UICollectionView(frame: CGRect(), collectionViewLayout: flowlayout)
col.delegate = self; col.delegate = self;
col.dataSource = self; col.dataSource = self;
col.register(PMShowItemCell.self, forCellWithReuseIdentifier: PMShowItemCellID) col.register(PMShowItemCell.self, forCellWithReuseIdentifier: PMShowItemCellID)
col.register(UICollectionViewCell.self, forCellWithReuseIdentifier: "UICollectionViewCell") col.register(UICollectionViewCell.self, forCellWithReuseIdentifier: "UICollectionViewCell")
col.showsHorizontalScrollIndicator = false col.showsHorizontalScrollIndicator = false
......
...@@ -46,12 +46,10 @@ class SettingViewController : BaseViewController , UITableViewDelegate, UITableV ...@@ -46,12 +46,10 @@ class SettingViewController : BaseViewController , UITableViewDelegate, UITableV
self.titleView.titleLabel.textColor = UIColor(red: 0.2, green: 0.2, blue: 0.2, alpha: 1) self.titleView.titleLabel.textColor = UIColor(red: 0.2, green: 0.2, blue: 0.2, alpha: 1)
modelData = getSettingViewInfo() modelData = getSettingViewInfo()
self.view.addSubview(tableView) self.view.addSubview(tableView)
self.tableView.reloadData()
} }
override func viewWillDisappear(_ animated: Bool) { override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated) super.viewWillDisappear(animated)
self.tableView.reloadData()
} }
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
...@@ -176,6 +174,7 @@ class SettingViewController : BaseViewController , UITableViewDelegate, UITableV ...@@ -176,6 +174,7 @@ class SettingViewController : BaseViewController , UITableViewDelegate, UITableV
case settingLabels.RemoveAfterImport.rawValue: case settingLabels.RemoveAfterImport.rawValue:
SettingConfiguration.share.config.removeImg = !SettingConfiguration.share.config.removeImg SettingConfiguration.share.config.removeImg = !SettingConfiguration.share.config.removeImg
tableView.reloadRows(at: [indexPath], with: .none) tableView.reloadRows(at: [indexPath], with: .none)
tableView.reloadData()
vibrate() vibrate()
break break
case settingLabels.Widgets.rawValue: case settingLabels.Widgets.rawValue:
...@@ -218,6 +217,7 @@ class SettingViewController : BaseViewController , UITableViewDelegate, UITableV ...@@ -218,6 +217,7 @@ class SettingViewController : BaseViewController , UITableViewDelegate, UITableV
case settingLabels.Vibration.rawValue: case settingLabels.Vibration.rawValue:
SettingConfiguration.share.config.vibration = !(SettingConfiguration.share.config.vibration ?? false) SettingConfiguration.share.config.vibration = !(SettingConfiguration.share.config.vibration ?? false)
tableView.reloadRows(at: [indexPath], with: .none) tableView.reloadRows(at: [indexPath], with: .none)
tableView.reloadData()
vibrate(true) vibrate(true)
break break
case settingLabels.Resumepurchase.rawValue: case settingLabels.Resumepurchase.rawValue:
...@@ -285,6 +285,7 @@ class SettingViewController : BaseViewController , UITableViewDelegate, UITableV ...@@ -285,6 +285,7 @@ class SettingViewController : BaseViewController , UITableViewDelegate, UITableV
}else{ }else{
SettingConfiguration.share.config.faceId = false SettingConfiguration.share.config.faceId = false
self.tableView.reloadRows(at: [indexPath], with: .none) self.tableView.reloadRows(at: [indexPath], with: .none)
tableView.reloadData()
} }
} }
......
...@@ -208,7 +208,7 @@ class WidgetViewController: BaseViewController { ...@@ -208,7 +208,7 @@ class WidgetViewController: BaseViewController {
private lazy var setWidgetBtn: UIButton = { private lazy var setWidgetBtn: UIButton = {
let btn = UIButton(type: .custom) let btn = UIButton(type: .custom)
btn.setTitle("Set Widget", for: .normal) btn.setTitle("Set Widget", for: .normal)
btn.titleLabel?.font = UIFont.systemFont(ofSize: 16) btn.titleLabel?.font = UIFont.boldSystemFont(ofSize: 16)
btn.setTitleColor(.white, for: .normal) btn.setTitleColor(.white, for: .normal)
btn.addTarget(self, action: #selector(setWidgetTouch), for: .touchUpInside) btn.addTarget(self, action: #selector(setWidgetTouch), for: .touchUpInside)
view.addSubview(btn) view.addSubview(btn)
......
...@@ -29,6 +29,10 @@ class PMScaleImageView: UIView , UIScrollViewDelegate { ...@@ -29,6 +29,10 @@ class PMScaleImageView: UIView , UIScrollViewDelegate {
size.width = self.width size.width = self.width
size.height = size.height * (self.width / (self.icon?.size.width ?? 1)) size.height = size.height * (self.width / (self.icon?.size.width ?? 1))
} }
if size.height > self.height {
size.height = self.height
size.width = size.width * (self.height / (self.icon?.size.height ?? 1))
}
self.showImg.snp.remakeConstraints({ make in self.showImg.snp.remakeConstraints({ make in
make.left.equalToSuperview().offset((self.width - size.width)/2.0 ) make.left.equalToSuperview().offset((self.width - size.width)/2.0 )
make.top.equalToSuperview().offset((self.height - size.height)/2.0 ) make.top.equalToSuperview().offset((self.height - size.height)/2.0 )
......
...@@ -179,7 +179,7 @@ class HapticManager { ...@@ -179,7 +179,7 @@ class HapticManager {
} }
private lazy var generator: UIImpactFeedbackGenerator = { private lazy var generator: UIImpactFeedbackGenerator = {
let genter = UIImpactFeedbackGenerator(style: .heavy) let genter = UIImpactFeedbackGenerator(style: .medium)
genter.prepare() genter.prepare()
return genter return genter
}() }()
......
...@@ -16,6 +16,9 @@ class PMFaceIDManger: NSObject { ...@@ -16,6 +16,9 @@ class PMFaceIDManger: NSObject {
} }
class func request() -> Bool { class func request() -> Bool {
if isAvailable() == false {
return false
}
let context = LAContext() let context = LAContext()
return context.biometricType == .faceID return context.biometricType == .faceID
} }
......
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