|
@@ -36,63 +36,51 @@ class TSAIListHintBaseVC: TSBaseVC {
|
|
self.badInfoText = badInfoText
|
|
self.badInfoText = badInfoText
|
|
}
|
|
}
|
|
|
|
|
|
- static func getDefaultConfig(imageMaxBitSize:Int) -> Config {
|
|
|
|
- var config = defaultConfig
|
|
|
|
- config.imageMaxBitSize = imageMaxBitSize
|
|
|
|
- return config
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- static var defaultConfig:Config {
|
|
|
|
- return Config(imageMaxBitSize: kUploadImageMaxBit10Size,
|
|
|
|
- goodImageNamed: "ptp_goodImage",
|
|
|
|
- badImageNamed: "ptp_badImage",
|
|
|
|
- titleText: "Upload your photos".localized,
|
|
|
|
- titleSubText: "",
|
|
|
|
- goodText: "Good photo examples".localized,
|
|
|
|
- goodInfoText: "Fully clear and visible face, in good lighting".localized,
|
|
|
|
- badText: "Bad photo examples".localized,
|
|
|
|
- badInfoText: "Group photos, covered faces, nudes".localized)
|
|
|
|
- }
|
|
|
|
|
|
+// static func getDefaultConfig(imageMaxBitSize:Int) -> Config {
|
|
|
|
+// var config = defaultConfig
|
|
|
|
+// config.imageMaxBitSize = imageMaxBitSize
|
|
|
|
+// return config
|
|
|
|
+// }
|
|
|
|
|
|
- static var changeHairConfig:Config {
|
|
|
|
|
|
+ static var enhanceConfig:Config {
|
|
return Config(imageMaxBitSize: kUploadImageMaxBit5Size,
|
|
return Config(imageMaxBitSize: kUploadImageMaxBit5Size,
|
|
- goodImageNamed: "ptp_hair_goodImage",
|
|
|
|
- badImageNamed: "ptp_hair_badImage",
|
|
|
|
- titleText: "Upload your photos".localized,
|
|
|
|
|
|
+ goodImageNamed: "hint_Enhance_good",
|
|
|
|
+ badImageNamed: "hint_Enhance_bad",
|
|
|
|
+ titleText: "Enhance Tips".localized,
|
|
titleSubText: "",
|
|
titleSubText: "",
|
|
- goodText: "Good photo examples".localized,
|
|
|
|
- goodInfoText: "Obvious hairstyle, Fully clear and visible face".localized,
|
|
|
|
- badText: "Bad photo examples".localized,
|
|
|
|
- badInfoText: "Group photos, covered faces, skinhead".localized)
|
|
|
|
|
|
+ goodText: "Suitable".localized,
|
|
|
|
+ goodInfoText: "Portraits, Low-resolution and photos, faces should be visible".localized,
|
|
|
|
+ badText: "Unsuitable".localized,
|
|
|
|
+ badInfoText: "High resulotion, Severaly damaged and Difficult to recognize the face".localized)
|
|
}
|
|
}
|
|
|
|
|
|
- static var catTohumanConfig:Config {
|
|
|
|
|
|
+ static var colorizeConfig:Config {
|
|
return Config(imageMaxBitSize: kUploadImageMaxBit10Size,
|
|
return Config(imageMaxBitSize: kUploadImageMaxBit10Size,
|
|
- goodImageNamed: "ptp_catTohuman_goodImage",
|
|
|
|
- badImageNamed: "ptp_catTohuman_badImage",
|
|
|
|
- titleText: "Upload your photos".localized,
|
|
|
|
|
|
+ goodImageNamed: "hint_Colorize_good",
|
|
|
|
+ badImageNamed: "hint_Colorize_bad",
|
|
|
|
+ titleText: "Colorize Tips".localized,
|
|
titleSubText: "",
|
|
titleSubText: "",
|
|
- goodText: "Good photo examples".localized,
|
|
|
|
- goodInfoText: "Select pet photos with clear faces".localized,
|
|
|
|
- badText: "Bad photo examples".localized,
|
|
|
|
- badInfoText: "No clear faces or group shots".localized)
|
|
|
|
|
|
+ goodText: "Suitable".localized,
|
|
|
|
+ goodInfoText: "Clear outline black-and-white photos".localized,
|
|
|
|
+ badText: "Unsuitable".localized,
|
|
|
|
+ badInfoText: "Colorful or Severely damaged photos".localized)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- static var futureBabyConfig:Config {
|
|
|
|
|
|
+ static var descratchConfig:Config {
|
|
return Config(imageMaxBitSize: kUploadImageMaxBit10Size,
|
|
return Config(imageMaxBitSize: kUploadImageMaxBit10Size,
|
|
- goodImageNamed: "ptp_futureBaby_goodImage",
|
|
|
|
- badImageNamed: "ptp_badImage",
|
|
|
|
- titleText: "Upload your photos".localized,
|
|
|
|
|
|
+ goodImageNamed: "hint_Descratch_good",
|
|
|
|
+ badImageNamed: "hint_Descratch_bad",
|
|
|
|
+ titleText: "Descratch Tips".localized,
|
|
titleSubText: "",
|
|
titleSubText: "",
|
|
- goodText: "Good photo examples".localized,
|
|
|
|
- goodInfoText: "Fully clear and visible face, in good lighting".localized,
|
|
|
|
- badText: "Bad photo examples".localized,
|
|
|
|
- badInfoText: "Group photos, covered faces, nudes".localized)
|
|
|
|
|
|
+ goodText: "Suitable".localized,
|
|
|
|
+ goodInfoText: "Scratched and Damaged photos".localized,
|
|
|
|
+ badText: "Unsuitable".localized,
|
|
|
|
+ badInfoText: "High-resolution, Not damaged, and Clear photos".localized)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- var config:Config = Config.defaultConfig
|
|
|
|
|
|
+ var config:Config = Config.enhanceConfig
|
|
init(config: Config, clickUpImageHandle: ((UIImage?) -> Void)? = nil) {
|
|
init(config: Config, clickUpImageHandle: ((UIImage?) -> Void)? = nil) {
|
|
self.config = config
|
|
self.config = config
|
|
self.clickUpImageHandle = clickUpImageHandle
|
|
self.clickUpImageHandle = clickUpImageHandle
|
|
@@ -120,14 +108,13 @@ class TSAIListHintBaseVC: TSBaseVC {
|
|
guard let self = self else { return }
|
|
guard let self = self else { return }
|
|
pickSinglePhoto()
|
|
pickSinglePhoto()
|
|
}
|
|
}
|
|
- submitBtn.cornerRadius = 24.0
|
|
|
|
return submitBtn
|
|
return submitBtn
|
|
}()
|
|
}()
|
|
|
|
|
|
override func createView() {
|
|
override func createView() {
|
|
addNormalNavBarView()
|
|
addNormalNavBarView()
|
|
_ = setNavigationItem("", imageName: "ic-close", direction: .right, action: #selector(clickView))
|
|
_ = setNavigationItem("", imageName: "ic-close", direction: .right, action: #selector(clickView))
|
|
- view.backgroundColor = .black.withAlphaComponent(0.7)
|
|
|
|
|
|
+ view.backgroundColor = .mainBg
|
|
|
|
|
|
contentView.addSubview(popupContentView)
|
|
contentView.addSubview(popupContentView)
|
|
popupContentView.center = view.center
|
|
popupContentView.center = view.center
|
|
@@ -150,11 +137,11 @@ class TSAIListHintBaseVC: TSBaseVC {
|
|
func setUpUI(){
|
|
func setUpUI(){
|
|
|
|
|
|
let iconImageView:UIImageView = UIImageView.createImageView(image: .hint)
|
|
let iconImageView:UIImageView = UIImageView.createImageView(image: .hint)
|
|
- iconImageView.addSubview(iconImageView)
|
|
|
|
|
|
+ popupContentView.addSubview(iconImageView)
|
|
iconImageView.snp.makeConstraints { make in
|
|
iconImageView.snp.makeConstraints { make in
|
|
make.top.equalTo(16)
|
|
make.top.equalTo(16)
|
|
- make.leading.equalTo(32)
|
|
|
|
- make.trailing.equalTo(-32)
|
|
|
|
|
|
+ make.leading.equalTo(0)
|
|
|
|
+ make.width.height.equalTo(40)
|
|
}
|
|
}
|
|
|
|
|
|
let fullText = config.titleText+config.titleSubText
|
|
let fullText = config.titleText+config.titleSubText
|
|
@@ -169,7 +156,6 @@ class TSAIListHintBaseVC: TSBaseVC {
|
|
titleLabel.snp.makeConstraints { make in
|
|
titleLabel.snp.makeConstraints { make in
|
|
make.leading.equalTo(0)
|
|
make.leading.equalTo(0)
|
|
make.top.equalTo(iconImageView.snp.bottom).offset(24)
|
|
make.top.equalTo(iconImageView.snp.bottom).offset(24)
|
|
- make.width.height.equalTo(40)
|
|
|
|
}
|
|
}
|
|
|
|
|
|
let goodImageView = UIImageView.createImageView(imageName: config.goodImageNamed)
|
|
let goodImageView = UIImageView.createImageView(imageName: config.goodImageNamed)
|
|
@@ -220,7 +206,6 @@ class TSAIListHintBaseVC: TSBaseVC {
|
|
make.top.equalTo(badLabel.snp.bottom).offset(8)
|
|
make.top.equalTo(badLabel.snp.bottom).offset(8)
|
|
make.leading.equalTo(0)
|
|
make.leading.equalTo(0)
|
|
make.trailing.equalTo(0)
|
|
make.trailing.equalTo(0)
|
|
- make.bottom.equalTo(0)
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|