Skip to content

Commit

Permalink
Merge pull request #384 from zsw666/master
Browse files Browse the repository at this point in the history
v10.0.0-beta
  • Loading branch information
shine2008 authored Apr 22, 2024
2 parents a2dd6fa + d2ff081 commit f90dadc
Show file tree
Hide file tree
Showing 411 changed files with 15,500 additions and 11,382 deletions.
2 changes: 1 addition & 1 deletion NEChatUIKit/NEChatUIKit.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Pod::Spec.new do |s|
#

s.name = 'NEChatUIKit'
s.version = '9.7.0'
s.version = '10.0.0-beta'
s.summary = 'Chat Module of IM.'

# This description is used to generate tags and improve search results.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "location_default 1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "location_default.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions NEChatUIKit/NEChatUIKit/Assets/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"record_too_short"="Time is too short";
"no_microphone_permission"="no micro permission";
"choose"="select";
"take_photo"="camera";
"select_from_album"="album";
"select_from_icloud"="icloud";
"editing"="typing";
Expand Down Expand Up @@ -51,9 +50,10 @@
"team_join_mode" = "join mode";
"team_be_invited_mode" = "invite mode";
"team_be_invited_permission" = "Invite Permission";
"team_be_invited_author" = "是否需要被邀请者同意权限";
"team_update_info_permission" = "update info permission";
"team_be_invited_author" = "BeInvite Permission";
"team_update_info_permission" = "Update info permission";
"team_update_client_custom"="Update Permission";
"team_at_permission"="@All Permission update to ";

"team_custom_info" = "custom info";
"not_mute" = "unmute";
Expand Down Expand Up @@ -169,6 +169,7 @@
"failed_operation"="Failed Operation";
"team_not_exist"="team not exist";
"unpin_failed"="Unpin failed";
"pin_limit_exceeded"="The number of pin has reached the upper limit";

"fun_hold_to_talk"="Hold to talk";

Expand All @@ -194,6 +195,7 @@
"multiForward_open_failed"="Failed to obtain information";
"file_check_failed"="File verification failed";
"per_item_forward_limit"="Forward one by one to limit %d messages";
"selete_messages_limit"="Delete limits %d messages";
"multiForward_forward_limit"="Combined forwarding limits %d messages";
"exception_description"="Exception description";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"record_too_short"="录音时间太短";
"no_microphone_permission"="没有麦克风权限";
"choose"="请选择";
"take_photo"="拍照";
"select_from_album"="从相册选择";
"select_from_icloud"="从iCloud选择";
"editing"="对方正在输入中...";
Expand Down Expand Up @@ -54,6 +53,7 @@
"team_be_invited_author" = "是否需要被邀请者同意权限";
"team_update_info_permission" = "群资料修改权限";
"team_update_client_custom"="更新客户端自定义字段的权限";
"team_at_permission"="@所有人权限更新为";

"team_custom_info" = "自定义扩展字段";
"not_mute" = "解除禁言";
Expand Down Expand Up @@ -167,6 +167,7 @@
"failed_operation"="操作失败";
"team_not_exist"="群组不存在";
"unpin_failed"="取消标记失败";
"pin_limit_exceeded"="已超出 pin 数量上限";

"fun_hold_to_talk"="按住 说话";

Expand All @@ -192,6 +193,7 @@
"multiForward_open_failed"="信息获取失败";
"file_check_failed"="文件校验失败";
"per_item_forward_limit"="逐条转发限制%d条消息";
"selete_messages_limit"="批量删除限制%d条消息";
"multiForward_forward_limit"="合并转发限制%d条消息";
"exception_description"="异常说明";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ open class ChatCenterTextCell: ChatCornerCell {
}

public required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
super.init(coder: coder)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// found in the LICENSE file.

import NECommonUIKit

// this cell has rounding corner style
import UIKit

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@ open class ChatHeaderView: UIView {
return label
}()

/*
// Only override draw() if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
override func draw(_ rect: CGRect) {
// Drawing code
}
*/

override init(frame: CGRect) {
super.init(frame: frame)
setupUI()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,44 @@ import UIKit

@objcMembers
open class ChatImageTextCell: ChatStateCell {
public lazy var avatarImageView: UIImageView = {
let avatarView = UIImageView()
avatarView.translatesAutoresizingMaskIntoConstraints = false
avatarView.clipsToBounds = true
avatarView.backgroundColor = .ne_defautAvatarColor
return avatarView
}()

public lazy var shortNameLabel: UILabel = {
let nameLabel = UILabel()
nameLabel.translatesAutoresizingMaskIntoConstraints = false
nameLabel.textColor = .white
nameLabel.textAlignment = .center
nameLabel.font = UIFont.systemFont(ofSize: 14.0)
return nameLabel
}()

public lazy var nameLabel: UILabel = {
let label = UILabel()
label.textAlignment = .left
label.translatesAutoresizingMaskIntoConstraints = false
label.font = UIFont.systemFont(ofSize: 14.0)
label.textColor = .ne_darkText
return label
}()

var circleView = UIImageView()

override public init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
// circle view
}

public required init?(coder: NSCoder) {
super.init(coder: coder)
}

override open func setupUI() {
super.setupUI()
circleView.translatesAutoresizingMaskIntoConstraints = false
circleView.layer.cornerRadius = 16
circleView.clipsToBounds = true
Expand All @@ -22,22 +56,22 @@ open class ChatImageTextCell: ChatStateCell {
circleView.leftAnchor.constraint(equalTo: contentView.leftAnchor, constant: 40),
circleView.centerYAnchor.constraint(equalTo: contentView.centerYAnchor, constant: 0),
])
// short name label
// short name label
contentView.addSubview(shortNameLabel)
NSLayoutConstraint.activate([
shortNameLabel.widthAnchor.constraint(equalTo: circleView.widthAnchor),
shortNameLabel.heightAnchor.constraint(equalTo: circleView.heightAnchor),
shortNameLabel.leftAnchor.constraint(equalTo: circleView.leftAnchor),
shortNameLabel.topAnchor.constraint(equalTo: circleView.topAnchor),
])
// name label
// name label
contentView.addSubview(nameLabel)
NSLayoutConstraint.activate([
nameLabel.leftAnchor.constraint(equalTo: circleView.rightAnchor, constant: 12),
nameLabel.topAnchor.constraint(equalTo: contentView.topAnchor),
nameLabel.bottomAnchor.constraint(equalTo: contentView.bottomAnchor),
])
// line
// line
let line = UIView()
line.backgroundColor = .ne_greyLine
line.translatesAutoresizingMaskIntoConstraints = false
Expand All @@ -50,36 +84,6 @@ open class ChatImageTextCell: ChatStateCell {
])
}

public required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

public lazy var avatarImage: UIImageView = {
let avatar = UIImageView()
avatar.translatesAutoresizingMaskIntoConstraints = false
avatar.clipsToBounds = true
avatar.backgroundColor = .ne_defautAvatarColor
return avatar
}()

public lazy var shortNameLabel: UILabel = {
let name = UILabel()
name.translatesAutoresizingMaskIntoConstraints = false
name.textColor = .white
name.textAlignment = .center
name.font = UIFont.systemFont(ofSize: 14.0)
return name
}()

public lazy var nameLabel: UILabel = {
let label = UILabel()
label.textAlignment = .left
label.translatesAutoresizingMaskIntoConstraints = false
label.font = UIFont.systemFont(ofSize: 14.0)
label.textColor = .ne_darkText
return label
}()

open func setup(accid: String?, nickName: String?) {
let name = nickName?.count ?? 0 > 0 ? nickName : accid
nameLabel.text = name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ open class ChatSectionView: UITableViewHeaderFooterView {
}

public required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
super.init(coder: coder)
}

func commonUI() {
Expand Down
29 changes: 17 additions & 12 deletions NEChatUIKit/NEChatUIKit/Classes/Base/BaseView/ChatStateCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public enum RightStyle: Int {
@objcMembers
open class ChatStateCell: ChatCornerCell {
private var style: RightStyle = .none
public var rightImage = UIImageView()
public var rightImageView = UIImageView()
var rightImageMargin: NSLayoutConstraint?
public var rightStyle: RightStyle {
get {
Expand All @@ -25,33 +25,38 @@ open class ChatStateCell: ChatCornerCell {
style = newValue
switch style {
case .none:
rightImage.image = nil
rightImageView.image = nil
case .indicate:
rightImage.image = UIImage.ne_imageNamed(name: "arrowRight")
rightImageView.image = UIImage.ne_imageNamed(name: "arrowRight")
case .delete:
rightImage.image = UIImage.ne_imageNamed(name: "delete")
rightImageView.image = UIImage.ne_imageNamed(name: "delete")
}
}
}

override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
rightImage.contentMode = .center
rightImage.translatesAutoresizingMaskIntoConstraints = false
contentView.addSubview(rightImage)
rightImageMargin = rightImage.rightAnchor.constraint(
setupUI()
}

/// UI 初始化
open func setupUI() {
rightImageView.contentMode = .center
rightImageView.translatesAutoresizingMaskIntoConstraints = false
contentView.addSubview(rightImageView)
rightImageMargin = rightImageView.rightAnchor.constraint(
equalTo: contentView.rightAnchor,
constant: -36
)
rightImageMargin?.isActive = true
NSLayoutConstraint.activate([
rightImage.widthAnchor.constraint(equalToConstant: 20),
rightImage.heightAnchor.constraint(equalToConstant: 20),
rightImage.centerYAnchor.constraint(equalTo: contentView.centerYAnchor),
rightImageView.widthAnchor.constraint(equalToConstant: 20),
rightImageView.heightAnchor.constraint(equalToConstant: 20),
rightImageView.centerYAnchor.constraint(equalTo: contentView.centerYAnchor),
])
}

public required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
super.init(coder: coder)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ open class ChatTextArrowCell: ChatTextCell {
}

public required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
super.init(coder: coder)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ open class ChatTextCell: ChatStateCell {

override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
}

override open func setupUI() {
super.setupUI()
titleLabel.font = UIFont.systemFont(ofSize: 16)
titleLabel.translatesAutoresizingMaskIntoConstraints = false
titleLabel.textColor = .ne_darkText
Expand Down Expand Up @@ -64,6 +67,6 @@ open class ChatTextCell: ChatStateCell {
}

public required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
super.init(coder: coder)
}
}
20 changes: 10 additions & 10 deletions NEChatUIKit/NEChatUIKit/Classes/Base/BaseView/ChatUnfoldCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import UIKit

@objcMembers
open class ChatUnfoldCell: ChatCornerCell {
lazy var arrowImage: UIImageView = {
let arrow = UIImageView()
arrow.translatesAutoresizingMaskIntoConstraints = false
arrow.image = UIImage.ne_imageNamed(name: "arrowDown")
return arrow
lazy var arrowImageView: UIImageView = {
let arrowImageView = UIImageView()
arrowImageView.translatesAutoresizingMaskIntoConstraints = false
arrowImageView.image = UIImage.ne_imageNamed(name: "arrowDown")
return arrowImageView
}()

lazy var contentLabel: UILabel = {
Expand All @@ -38,18 +38,18 @@ open class ChatUnfoldCell: ChatCornerCell {
contentLabel.centerXAnchor.constraint(equalTo: contentView.centerXAnchor),
])

contentView.addSubview(arrowImage)
contentView.addSubview(arrowImageView)
NSLayoutConstraint.activate([
arrowImage.leftAnchor.constraint(equalTo: contentLabel.rightAnchor, constant: 5),
arrowImage.centerYAnchor.constraint(equalTo: contentLabel.centerYAnchor),
arrowImageView.leftAnchor.constraint(equalTo: contentLabel.rightAnchor, constant: 5),
arrowImageView.centerYAnchor.constraint(equalTo: contentLabel.centerYAnchor),
])
}

func changeToArrowUp() {
arrowImage.image = UIImage.ne_imageNamed(name: "arrowUp")
arrowImageView.image = UIImage.ne_imageNamed(name: "arrowUp")
}

func changeToArrowDown() {
arrowImage.image = UIImage.ne_imageNamed(name: "arrowDown")
arrowImageView.image = UIImage.ne_imageNamed(name: "arrowDown")
}
}
Loading

0 comments on commit f90dadc

Please sign in to comment.