diff --git a/Classes/Swift/Chat/Views/ChatConversationViewSwift.swift b/Classes/Swift/Chat/Views/ChatConversationViewSwift.swift index 656680077..be8af8145 100644 --- a/Classes/Swift/Chat/Views/ChatConversationViewSwift.swift +++ b/Classes/Swift/Chat/Views/ChatConversationViewSwift.swift @@ -635,9 +635,7 @@ import DropDown } func on_chat_room_is_composing_received(_ cr: ChatRoom?, _ remoteAddr: Address?, _ isComposing: Bool) { - //let view = linphone_chat_room_cbs_get_user_data(linphone_chat_room_get_current_callbacks(cr?.getCobject)) as? ChatConversationViewSwift let composing = (linphone_chat_room_is_remote_composing(cr?.getCobject) != 0) || bctbx_list_size(linphone_chat_room_get_composing_addresses(cr?.getCobject)) > 0 - //view?.setComposingVisible(composing, withDelay: 0.3) setComposingVisible(composing, withDelay: 0.3) } @@ -667,47 +665,33 @@ import DropDown return } + var isBottomOfView = false + if (tableController.tableView.contentOffset.y + self.isComposingView.frame.size.height >= (tableController.tableView.contentSize.height - tableController.tableView.frame.size.height)) { + isBottomOfView = true + } UIView.animate( withDuration: delay, animations: { - //self.tableController.tableView.frame = newTableFrame - //self.isComposingView.frame = newComposingFrame self.contentOriginY = self.contentView.frame.origin.y self.composingOriginY = self.isComposingView.frame.origin.y if visible { - self.contentView.transform = self.contentView.transform.translatedBy(x: 0, y: -self.top_bar_height/2) - self.contentView.transform = CGAffineTransform(translationX: 0, y: -self.top_bar_height/2) - + if(isBottomOfView){ + self.contentView.transform = self.contentView.transform.translatedBy(x: 0, y: -self.top_bar_height/2) + self.contentView.transform = CGAffineTransform(translationX: 0, y: -self.top_bar_height/2) + } self.isComposingView.transform = self.isComposingView.transform.translatedBy(x: 0, y: -self.top_bar_height/2) self.isComposingView.transform = CGAffineTransform(translationX: 0, y: -self.top_bar_height/2) }else{ - self.contentView.transform = self.contentView.transform.translatedBy(x: 0, y: 0) - self.contentView.transform = CGAffineTransform(translationX: 0, y: 0) - + if(isBottomOfView){ + self.contentView.transform = self.contentView.transform.translatedBy(x: 0, y: 0) + self.contentView.transform = CGAffineTransform(translationX: 0, y: 0) + } self.isComposingView.transform = self.isComposingView.transform.translatedBy(x: 0, y: 0) self.isComposingView.transform = CGAffineTransform(translationX: 0, y: 0) } }) - - contentOriginY = self.contentView.frame.origin.y - composingOriginY = self.isComposingView.frame.origin.y - - if visible { - self.contentView.transform = self.contentView.transform.translatedBy(x: 0, y: -top_bar_height/2) - self.contentView.transform = CGAffineTransform(translationX: 0, y: -top_bar_height/2) - - self.isComposingView.transform = self.isComposingView.transform.translatedBy(x: 0, y: -top_bar_height/2) - self.isComposingView.transform = CGAffineTransform(translationX: 0, y: -top_bar_height/2) - }else{ - self.isComposingView.transform = self.isComposingView.transform.translatedBy(x: 0, y: 0) - self.isComposingView.transform = CGAffineTransform(translationX: 0, y: 0) - - self.contentView.transform = self.contentView.transform.translatedBy(x: 0, y: 0) - self.contentView.transform = CGAffineTransform(translationX: 0, y: 0) - } - } class func autoDownload(_ message: ChatMessage?) { diff --git a/Classes/Swift/Util/BackActionsNavigationView.swift b/Classes/Swift/Util/BackActionsNavigationView.swift index d02b02098..f5f5edbdb 100644 --- a/Classes/Swift/Util/BackActionsNavigationView.swift +++ b/Classes/Swift/Util/BackActionsNavigationView.swift @@ -138,6 +138,7 @@ import linphonesw isComposingView.addSubview(isComposingTextView) isComposingTextView.alignParentLeft(withMargin: 10).alignParentRight(withMargin: 10).matchParentHeight().done() + isComposingView.backgroundColor = VoipTheme.backgroundWhiteBlack.get() view.addSubview(contentView) contentView.alignParentTop(withMargin: top_bar_height).alignParentBottom(withMargin: top_bar_height).matchParentSideBorders().done()