diff --git a/QuickLocation.xcworkspace/xcuserdata/yanghong.xcuserdatad/UserInterfaceState.xcuserstate b/QuickLocation.xcworkspace/xcuserdata/yanghong.xcuserdatad/UserInterfaceState.xcuserstate index e8b9bd5..648d571 100644 Binary files a/QuickLocation.xcworkspace/xcuserdata/yanghong.xcuserdatad/UserInterfaceState.xcuserstate and b/QuickLocation.xcworkspace/xcuserdata/yanghong.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/QuickLocation/Resource/Font/lotties/emoji/images/chat_voice_img_0.png b/QuickLocation/Resource/Font/lotties/emoji/images/chat_voice_img_0.png new file mode 100644 index 0000000..10f9036 Binary files /dev/null and b/QuickLocation/Resource/Font/lotties/emoji/images/chat_voice_img_0.png differ diff --git a/QuickLocation/Resource/Font/lotties/emoji/images/chat_voice_img_1.png b/QuickLocation/Resource/Font/lotties/emoji/images/chat_voice_img_1.png new file mode 100644 index 0000000..b9087a1 Binary files /dev/null and b/QuickLocation/Resource/Font/lotties/emoji/images/chat_voice_img_1.png differ diff --git a/QuickLocation/Resource/Font/lotties/emoji/images/chat_voice_img_2.png b/QuickLocation/Resource/Font/lotties/emoji/images/chat_voice_img_2.png new file mode 100644 index 0000000..a7b5d3c Binary files /dev/null and b/QuickLocation/Resource/Font/lotties/emoji/images/chat_voice_img_2.png differ diff --git a/QuickLocation/Resource/Font/lotties/emoji/images/dialog_buy_vip3_img_0.png b/QuickLocation/Resource/Font/lotties/emoji/images/dialog_buy_vip3_img_0.png new file mode 100644 index 0000000..5a7ad6c Binary files /dev/null and b/QuickLocation/Resource/Font/lotties/emoji/images/dialog_buy_vip3_img_0.png differ diff --git a/QuickLocation/Resource/Font/lotties/emoji/images/dialog_buy_vip3_img_1.png b/QuickLocation/Resource/Font/lotties/emoji/images/dialog_buy_vip3_img_1.png new file mode 100644 index 0000000..0486445 Binary files /dev/null and b/QuickLocation/Resource/Font/lotties/emoji/images/dialog_buy_vip3_img_1.png differ diff --git a/QuickLocation/Resource/Font/lotties/emoji/images/dialog_phone_search_img_0.png b/QuickLocation/Resource/Font/lotties/emoji/images/dialog_phone_search_img_0.png new file mode 100644 index 0000000..bd0665d Binary files /dev/null and b/QuickLocation/Resource/Font/lotties/emoji/images/dialog_phone_search_img_0.png differ diff --git a/QuickLocation/Resource/Font/lotties/emoji/images/dialog_phone_search_img_1.png b/QuickLocation/Resource/Font/lotties/emoji/images/dialog_phone_search_img_1.png new file mode 100644 index 0000000..1e8b747 Binary files /dev/null and b/QuickLocation/Resource/Font/lotties/emoji/images/dialog_phone_search_img_1.png differ diff --git a/QuickLocation/Resource/Font/lotties/emoji/images/dialog_signin_img_0.png b/QuickLocation/Resource/Font/lotties/emoji/images/dialog_signin_img_0.png new file mode 100644 index 0000000..e396596 Binary files /dev/null and b/QuickLocation/Resource/Font/lotties/emoji/images/dialog_signin_img_0.png differ diff --git a/QuickLocation/Resource/Font/lotties/emoji/images/dialog_signin_img_1.png b/QuickLocation/Resource/Font/lotties/emoji/images/dialog_signin_img_1.png new file mode 100644 index 0000000..b7bf015 Binary files /dev/null and b/QuickLocation/Resource/Font/lotties/emoji/images/dialog_signin_img_1.png differ diff --git a/QuickLocation/Resource/Font/lotties/emoji/images/register_tip1_img_0.png b/QuickLocation/Resource/Font/lotties/emoji/images/register_tip1_img_0.png new file mode 100644 index 0000000..f41c27b Binary files /dev/null and b/QuickLocation/Resource/Font/lotties/emoji/images/register_tip1_img_0.png differ diff --git a/QuickLocation/Resource/Font/lotties/emoji/images/register_tip2_img_0.png b/QuickLocation/Resource/Font/lotties/emoji/images/register_tip2_img_0.png new file mode 100644 index 0000000..5c4970c Binary files /dev/null and b/QuickLocation/Resource/Font/lotties/emoji/images/register_tip2_img_0.png differ diff --git a/QuickLocation/Section/Group/GroupChat/GroupChatView.swift b/QuickLocation/Section/Group/GroupChat/GroupChatView.swift index 688b765..00d26f6 100644 --- a/QuickLocation/Section/Group/GroupChat/GroupChatView.swift +++ b/QuickLocation/Section/Group/GroupChat/GroupChatView.swift @@ -876,9 +876,14 @@ final class VoiceSendMsgCell: UITableViewCell { return v }() - private let playIcon: UIImageView = { - let iv = UIImageView(image: UIImage(named: "IM/video_send")) - return iv + private let playAnimation: LottieAnimationView = { + let v = LottieAnimationView() + if let path = Bundle.main.path(forResource: "message_voice_play", ofType: "json") { + v.animation = LottieAnimation.filepath(path) + } + v.loopMode = .loop + v.contentMode = .scaleAspectFit + return v }() private let durationLabel: UILabel = { @@ -894,10 +899,13 @@ final class VoiceSendMsgCell: UITableViewCell { backgroundColor = .clear contentView.addSubview(timeLabel) contentView.addSubview(bubbleView) - bubbleView.addSubview(playIcon) + bubbleView.addSubview(playAnimation) bubbleView.addSubview(durationLabel) contentView.addSubview(avatarView) - + + let tap = UITapGestureRecognizer(target: self, action: #selector(togglePlay)) + bubbleView.addGestureRecognizer(tap) + timeLabel.layoutChain.top().centerX() avatarView.layoutChain .topToBottomOfView(timeLabel, offset: 14) @@ -908,13 +916,13 @@ final class VoiceSendMsgCell: UITableViewCell { .rightToView(avatarView, offset: -13) .width(105).height(39).bottom(10) - playIcon.layoutChain + playAnimation.layoutChain .right(36) .centerY() - .width(11).height(15) + .width(20).height(20) durationLabel.layoutChain - .leftToRightOfView(playIcon, offset: 8) + .leftToRightOfView(playAnimation, offset: 4) .centerY() } @@ -930,6 +938,19 @@ final class VoiceSendMsgCell: UITableViewCell { durationLabel.text = dur > 0 ? "\(dur)''" : "" } + @objc private func togglePlay() { + if playAnimation.isAnimationPlaying { + playAnimation.stop() + } else { + playAnimation.play() + } + } + + override func prepareForReuse() { + super.prepareForReuse() + playAnimation.stop() + } + private func formatTime(_ t: TimeInterval) -> String { let date = Date(timeIntervalSince1970: t) let now = Date() @@ -941,7 +962,7 @@ final class VoiceSendMsgCell: UITableViewCell { else { f.dateFormat = "yyyy-M-d HH:mm" } return f.string(from: date) } - + override func layoutSubviews() { super.layoutSubviews() bubbleView.setNeedsLayout() @@ -987,9 +1008,14 @@ final class VoiceReceivedMsgCell: UITableViewCell { return v }() - private let playIcon: UIImageView = { - let iv = UIImageView(image: UIImage(named: "IM/video_received")) - return iv + private let playAnimation: LottieAnimationView = { + let v = LottieAnimationView() + if let path = Bundle.main.path(forResource: "message_voice_play", ofType: "json") { + v.animation = LottieAnimation.filepath(path) + } + v.loopMode = .loop + v.contentMode = .scaleAspectFit + return v }() private let durationLabel: UILabel = { @@ -1005,10 +1031,12 @@ final class VoiceReceivedMsgCell: UITableViewCell { backgroundColor = .clear contentView.addSubview(timeLabel) contentView.addSubview(bubbleView) - bubbleView.addSubview(playIcon) + bubbleView.addSubview(playAnimation) bubbleView.addSubview(durationLabel) contentView.addSubview(avatarView) contentView.addSubview(nameLabel) + let tap = UITapGestureRecognizer(target: self, action: #selector(togglePlay)) + bubbleView.addGestureRecognizer(tap) timeLabel.layoutChain.top().centerX() @@ -1029,13 +1057,13 @@ final class VoiceReceivedMsgCell: UITableViewCell { .leftToRightOfView(avatarView, offset: 5) .bottomToView(avatarView) - playIcon.layoutChain + playAnimation.layoutChain .left(36) .centerY() - .width(11).height(15) + .width(20).height(20) durationLabel.layoutChain - .leftToRightOfView(playIcon, offset: 8) + .leftToRightOfView(playAnimation, offset: 4) .centerY() } @@ -1052,6 +1080,19 @@ final class VoiceReceivedMsgCell: UITableViewCell { durationLabel.text = dur > 0 ? "\(dur)''" : "" } + @objc func togglePlay() { + if playAnimation.isAnimationPlaying { + playAnimation.stop() + } else { + playAnimation.play() + } + } + + override func prepareForReuse() { + super.prepareForReuse() + playAnimation.stop() + } + private func formatTime(_ t: TimeInterval) -> String { let date = Date(timeIntervalSince1970: t) let now = Date()