Skip to content
Snippets Groups Projects
Commit 60a0440d authored by Kateryna Kostiuk's avatar Kateryna Kostiuk
Browse files

UI: update message placeholder text

Change-Id: I0a84d89d0ee6174f564b3474d8533ee4e5c1983a
parent 5967bd91
Branches
No related tags found
No related merge requests found
......@@ -325,7 +325,7 @@ internal enum L10n {
internal static let explanationReceivingLocationFrom = L10n.tr("Localizable", "conversation.explanationReceivingLocationFrom")
/// You are currently sharing your location with
internal static let explanationSendingLocationTo = L10n.tr("Localizable", "conversation.explanationSendingLocationTo")
/// Type your message...
/// Write message to
internal static let messagePlaceholder = L10n.tr("Localizable", "conversation.messagePlaceholder")
}
......
......@@ -621,6 +621,15 @@ class ConversationViewController: UIViewController,
self?.viewModel.openCall()
})
.disposed(by: self.disposeBag)
viewModel.bestName
.asObservable()
.observeOn(MainScheduler.instance)
.subscribe(onNext: { [weak self] name in
guard !name.isEmpty else { return }
let placeholder = L10n.Conversation.messagePlaceholder + name
self?.messageAccessoryView.setPlaceholder(placeholder: placeholder)
})
.disposed(by: self.disposeBag)
}
func inviteItemTapped() {
......
......@@ -147,6 +147,7 @@ open class GrowingTextView: UITextView {
// Otherwise user placeholder and inherit `text` attributes
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.alignment = textAlignment
paragraphStyle.lineBreakMode = .byTruncatingTail
var attributes: [NSAttributedString.Key: Any] = [
.foregroundColor: placeholderColor,
.paragraphStyle: paragraphStyle
......
......@@ -74,9 +74,12 @@ class MessageAccessoryView: UIView, NibLoadable, GrowingTextViewDelegate {
}
}
func setPlaceholder(placeholder: String) {
self.messageTextView.placeholder = placeholder
}
func setupMessageTextView() {
self.messageTextView.delegate = self
self.messageTextView.placeholder = L10n.Conversation.messagePlaceholder
self.messageTextView.layer.cornerRadius = 18
self.messageTextView.tintColor = UIColor.jamiMain
self.messageTextView.textContainerInset = UIEdgeInsets(top: 8, left: 7, bottom: 8, right: 7)
......
......@@ -47,7 +47,7 @@
"smartlist.selectOneNumber" = "Select one of the numbers";
//Conversation
"conversation.messagePlaceholder" = "Type your message...";
"conversation.messagePlaceholder" = "Write message to ";
"conversation.explanationSendingLocationTo" = "You are currently sharing your location with ";
"conversation.explanationReceivingLocationFrom" = "You are currently receiving a live location from ";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment