Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CM-1234] Fixed name getting cut issue #408

Merged
merged 1 commit into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions Sources/Kommunicate/Classes/ConversationVCNavBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ class ConversationVCNavBar: UIView, Localizable {
let stackView = UIStackView(arrangedSubviews: [self.profileName])
stackView.alignment = .fill
stackView.axis = .vertical
stackView.distribution = .fillEqually
stackView.spacing = 2
stackView.distribution = .fill
stackView.spacing = 0.5
return stackView
}()

Expand Down Expand Up @@ -172,24 +172,28 @@ class ConversationVCNavBar: UIView, Localizable {
}
var subtitleText: String = ""
var showCustomSubtitle: Bool = false
if let toolbarSubtitle = configuration.toolbarSubtitleText as? String, !toolbarSubtitle.isEmpty {

if !configuration.toolbarSubtitleText.isEmpty {
customSubtitleView.addArrangedSubview(customSubtitleText)
subtitleText = toolbarSubtitle
subtitleText = configuration.toolbarSubtitleText
showCustomSubtitle = true
}
if let toolbarRating = configuration.toolbarSubtitleRating as? Float, !toolbarRating.isEqual(to: -1.0) {

if !configuration.toolbarSubtitleRating.isEqual(to: -1.0) {
subtitleText.append(subtitleText.isEmpty ? "" : " | ")
customSubtitleView.addArrangedSubview(ratingIcon)
customSubtitleView.addArrangedSubview(customRating)
customRating.text = toolbarRating.description
customRating.text = configuration.toolbarSubtitleRating.description
showCustomSubtitle = true
}

if(showCustomSubtitle) {
customSubtitleText.text = subtitleText
profileView.addArrangedSubview(self.customSubtitleView)
} else {
profileView.addArrangedSubview(self.onlineStatusText)
}

statusIconBackgroundColor.backgroundColor = navigationBarProxy.barTintColor
}

Expand All @@ -206,7 +210,7 @@ class ConversationVCNavBar: UIView, Localizable {
profileImage.topAnchor.constraint(equalTo: topAnchor, constant: 5).isActive = true
profileImage.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -5).isActive = true
profileImage.widthAnchor.constraint(equalToConstant: 37).isActive = true
profileName.heightAnchor.constraint(equalToConstant: 37).isActive = true
profileImage.heightAnchor.constraint(equalToConstant: 37).isActive = true

statusIconBackgroundColor.bottomAnchor.constraint(equalTo: profileImage.bottomAnchor, constant: 0).isActive = true
statusIconBackgroundColor.leadingAnchor.constraint(equalTo: profileImage.trailingAnchor, constant: -10).isActive = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public struct KMConversationViewConfiguration {
public var startNewButtonIcon: UIImage? = UIImage(named: "icon_new_chat_red", in: Bundle.kommunicate, compatibleWith: nil)
/// If enabled, the user can't send a message when a conversation is assigned to a bot.
public var restrictMessageTypingWithBots = false
public var toolbarSubtitleText = ""
public var toolbarSubtitleText: String = ""
public var toolbarSubtitleRating: Float = -1.0
/// Customize Text color of FAQ button on conversation, conversation list screen
public var faqTextColor : UIColor = UIColor.white
Expand Down
Loading