|
@@ -37,8 +37,9 @@ class BFSubtitleSettingView: UIView {
|
|
|
backgroundColor = UIColor.clear
|
|
|
addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(hidden)))
|
|
|
|
|
|
- let backView = UIView(frame: CGRect(x: 0, y: 0, width: cScreenWidth, height: cScreenHeigth))
|
|
|
+ let backView = UIButton()
|
|
|
backView.backgroundColor = .black
|
|
|
+
|
|
|
addSubview(backView)
|
|
|
backView.snp.makeConstraints { make in
|
|
|
make.right.equalTo(self.snp.right)
|
|
@@ -136,22 +137,14 @@ class BFSubtitleSettingView: UIView {
|
|
|
for i in 0...1 {
|
|
|
let wordSizeBtn = UIButton(type: .custom)
|
|
|
wordSizeBtn.addTarget(self, action: #selector(wordSizeSetting(sender:)), for: .touchUpInside)
|
|
|
- wordSizeBtn.backgroundColor = UIColor.hexColor(hexadecimal: "#1A1A1A")
|
|
|
- wordSizeBtn.setTitleColor(UIColor.hexColor(hexadecimal: "#28BE67"), for: .selected)
|
|
|
- wordSizeBtn.setTitleColor(.white, for: .normal)
|
|
|
- wordSizeBtn.setTitle(i == 0 ? "-" : "+", for: .normal)
|
|
|
backView.addSubview(wordSizeBtn)
|
|
|
wordSizeBtn.tag = i
|
|
|
- if i == 0 {
|
|
|
- wordSizeBtn.isSelected = true
|
|
|
- wordSizeBtn.layer.borderColor = UIColor.hexColor(hexadecimal: "#28BE67").cgColor
|
|
|
- wordSizeBtn.layer.borderWidth = 1.5
|
|
|
- lastSelectwordSizeBtn = wordSizeBtn
|
|
|
- }
|
|
|
- wordSizeBtn.addCorner(corner: 10)
|
|
|
+
|
|
|
+ wordSizeBtn.setBackgroundImage(imageInRecordScreenKit(by: i == 0 ? "wordSizeSetting-_h" : "wordSizeSetting+_h"), for: .normal)
|
|
|
+
|
|
|
wordSizeBtn.snp.makeConstraints { make in
|
|
|
- make.width.equalTo(30)
|
|
|
- make.height.equalTo(30)
|
|
|
+ make.width.equalTo(24)
|
|
|
+ make.height.equalTo(24)
|
|
|
make.left.equalTo(wordSizeTitle.snp.right).offset(10 + i * Int(30 + 10))
|
|
|
|
|
|
make.centerY.equalTo(pointTitle.snp.centerY)
|
|
@@ -245,22 +238,31 @@ class BFSubtitleSettingView: UIView {
|
|
|
}
|
|
|
|
|
|
@objc func wordSizeSetting(sender: UIButton) {
|
|
|
- lastSelectwordSizeBtn.isSelected = false
|
|
|
- lastSelectwordSizeBtn.layer.borderColor = UIColor.clear.cgColor
|
|
|
-
|
|
|
- sender.isSelected = true
|
|
|
+
|
|
|
+ if(sender.tag == 0){
|
|
|
+ if(subtitle.setting.subtitleSize > 20){
|
|
|
+ subtitle.setting.subtitleSize -= 10
|
|
|
+
|
|
|
+ lastSelectwordSizeBtn.setImage(imageInRecordScreenKit(by: "wordSizeSetting+_h"), for: .normal)
|
|
|
+
|
|
|
+ sender.setImage(imageInRecordScreenKit(by: "wordSizeSetting-_h"), for: .normal)
|
|
|
+ }else{
|
|
|
+ sender.setImage(imageInRecordScreenKit(by: "wordSizeSetting-_n"), for: .normal)
|
|
|
+ }
|
|
|
+
|
|
|
+ }else if(sender.tag == 1){
|
|
|
+ if(subtitle.setting.subtitleSize < 120){
|
|
|
+ subtitle.setting.subtitleSize += 10
|
|
|
+ sender.setImage(imageInRecordScreenKit(by: "wordSizeSetting+_h"), for: .normal)
|
|
|
+ lastSelectwordSizeBtn.setImage(imageInRecordScreenKit(by: "wordSizeSetting-_h"), for: .normal)
|
|
|
+ }else{
|
|
|
+ sender.setImage(imageInRecordScreenKit(by: "wordSizeSetting+_n"), for: .normal)
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
lastSelectwordSizeBtn = sender
|
|
|
|
|
|
- sender.layer.borderColor = UIColor.hexColor(hexadecimal: "#28BE67").cgColor
|
|
|
- sender.layer.borderWidth = 1.5
|
|
|
-
|
|
|
- if sender.tag == 0, subtitle.setting.subtitleSize > 20 {
|
|
|
- subtitle.setting.subtitleSize -= 10
|
|
|
- } else if sender.tag == 1, subtitle.setting.subtitleSize < 120 {
|
|
|
- subtitle.setting.subtitleSize += 10
|
|
|
- } else {
|
|
|
- BFLog(message: "设置字号超出范围!")
|
|
|
- }
|
|
|
if subtitleSettingCallBack != nil {
|
|
|
subtitleSettingCallBack!(subtitle)
|
|
|
}
|