diff --git a/Visual_Novel_iOS/Assets.xcassets/Role/role_voice_play.imageset/Contents.json b/Visual_Novel_iOS/Assets.xcassets/Role/role_voice_play.imageset/Contents.json new file mode 100644 index 0000000..e69172d --- /dev/null +++ b/Visual_Novel_iOS/Assets.xcassets/Role/role_voice_play.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "role_voice_play@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "role_voice_play@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Visual_Novel_iOS/Assets.xcassets/Role/role_voice_play.imageset/role_voice_play@2x.png b/Visual_Novel_iOS/Assets.xcassets/Role/role_voice_play.imageset/role_voice_play@2x.png new file mode 100644 index 0000000..88d6f6b Binary files /dev/null and b/Visual_Novel_iOS/Assets.xcassets/Role/role_voice_play.imageset/role_voice_play@2x.png differ diff --git a/Visual_Novel_iOS/Assets.xcassets/Role/role_voice_play.imageset/role_voice_play@3x.png b/Visual_Novel_iOS/Assets.xcassets/Role/role_voice_play.imageset/role_voice_play@3x.png new file mode 100644 index 0000000..48ec06f Binary files /dev/null and b/Visual_Novel_iOS/Assets.xcassets/Role/role_voice_play.imageset/role_voice_play@3x.png differ diff --git a/Visual_Novel_iOS/Src/Modules/Chat/Setting/Cell/VoiceActorContainerCell.swift b/Visual_Novel_iOS/Src/Modules/Chat/Setting/Cell/VoiceActorContainerCell.swift index a1c5723..53e2f12 100644 --- a/Visual_Novel_iOS/Src/Modules/Chat/Setting/Cell/VoiceActorContainerCell.swift +++ b/Visual_Novel_iOS/Src/Modules/Chat/Setting/Cell/VoiceActorContainerCell.swift @@ -55,7 +55,7 @@ class VoiceActorContainerCell: UITableViewCell, CellConfigurable { tableView.separatorStyle = .none tableView.delegate = self tableView.dataSource = self - tableView.backgroundColor = UIColor(hex: "#F5F5FF") + tableView.backgroundColor = .clear tableView.showsVerticalScrollIndicator = true tableView.isScrollEnabled = true tableView.register(VoiceActorItemCell.self, forCellReuseIdentifier: "VoiceActorItemCell") @@ -180,17 +180,17 @@ extension VoiceActorContainerCell: UITableViewDataSource, UITableViewDelegate { selectedItemChanged?(item) } - func tableView(_ tableView: UITableView, didHighlightRowAt indexPath: IndexPath) { - if let cell = tableView.cellForRow(at: indexPath) as? VoiceActorItemCell { - cell.isHovered = true - } - } - - func tableView(_ tableView: UITableView, didUnhighlightRowAt indexPath: IndexPath) { - if let cell = tableView.cellForRow(at: indexPath) as? VoiceActorItemCell { - cell.isHovered = false - } - } +// func tableView(_ tableView: UITableView, didHighlightRowAt indexPath: IndexPath) { +// if let cell = tableView.cellForRow(at: indexPath) as? VoiceActorItemCell { +// cell.isHovered = true +// } +// } +// +// func tableView(_ tableView: UITableView, didUnhighlightRowAt indexPath: IndexPath) { +// if let cell = tableView.cellForRow(at: indexPath) as? VoiceActorItemCell { +// cell.isHovered = false +// } +// } } // MARK: - VoiceActorFilterView @@ -368,17 +368,13 @@ class VoiceActorItemCell: UITableViewCell { private lazy var playButton: UIButton = { let btn = UIButton(type: .custom) - if let playImage = UIImage(named: "voice_play") { + if let playImage = UIImage(named: "role_voice_play") { btn.setImage(playImage, for: .normal) } else { let config = UIImage.SymbolConfiguration(pointSize: 10, weight: .bold) btn.setImage(UIImage(systemName: "play.fill", withConfiguration: config), for: .normal) btn.tintColor = .white } - btn.backgroundColor = UIColor(hex: "#0066FF") - btn.layer.cornerRadius = 12 - btn.imageEdgeInsets = UIEdgeInsets(top: 6, left: 8, bottom: 6, right: 8) - btn.imageView?.contentMode = .scaleAspectFit return btn }() @@ -398,8 +394,16 @@ class VoiceActorItemCell: UITableViewCell { private lazy var selectionIndicator: UIView = { let view = UIView() - view.layer.cornerRadius = 10 - view.backgroundColor = UIColor.black + view.layer.cornerRadius = 6.5 + view.backgroundColor = UIColor(hex: "#020025") + return view + }() + + private lazy var selectIndicator: UIView = { + let view = UIView() + view.layer.cornerRadius = 4.5 + view.backgroundColor = UIColor(hex: "#00CC88") + view.isHidden = true return view }() @@ -425,12 +429,15 @@ class VoiceActorItemCell: UITableViewCell { backgroundColor = .clear selectionStyle = .none + self.cornerRadius = 10.0 + contentView.addSubview(containerView) containerView.addSubview(avatarImageView) containerView.addSubview(playButton) containerView.addSubview(titleLabel) containerView.addSubview(subTitleLab) containerView.addSubview(selectionIndicator) + selectionIndicator.addSubview(selectIndicator) containerView.snp.makeConstraints { make in make.left.right.equalToSuperview() @@ -444,14 +451,19 @@ class VoiceActorItemCell: UITableViewCell { } playButton.snp.makeConstraints { make in - make.bottom.right.equalTo(avatarImageView).offset(2) - make.width.height.equalTo(24) + make.top.right.equalTo(avatarImageView).offset(0) + make.width.height.equalTo(20) } selectionIndicator.snp.makeConstraints { make in make.centerY.equalToSuperview() make.right.equalToSuperview().inset(10) - make.width.height.equalTo(20) + make.width.height.equalTo(13) + } + + selectIndicator.snp.makeConstraints { make in + make.centerY.centerX.equalToSuperview() + make.width.height.equalTo(9) } titleLabel.snp.makeConstraints { make in @@ -493,7 +505,8 @@ class VoiceActorItemCell: UITableViewCell { } func updateSelectionState(isSelected: Bool) { - selectionIndicator.backgroundColor = isSelected ? UIColor(hex: "#00CC88") : UIColor.black +// selectionIndicator.backgroundColor = isSelected ? UIColor(hex: "#00CC88") : UIColor(hex: "#020025") + selectIndicator.isHidden = !isSelected } private func updateHoverState() {