mirror of https://github.com/oxen-io/session-ios
Sketch out "typing indicators" interaction and cell.
parent
50381cc94c
commit
eedc9f9a26
@ -0,0 +1,37 @@
|
|||||||
|
//
|
||||||
|
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
import Foundation
|
||||||
|
|
||||||
|
@objc(OWSTypingIndicatorCell)
|
||||||
|
public class TypingIndicatorCell: ConversationViewCell {
|
||||||
|
|
||||||
|
@objc
|
||||||
|
public static let cellReuseIdentifier = "TypingIndicatorCell"
|
||||||
|
|
||||||
|
@available(*, unavailable, message:"use other constructor instead.")
|
||||||
|
@objc
|
||||||
|
public required init(coder aDecoder: NSCoder) {
|
||||||
|
notImplemented()
|
||||||
|
}
|
||||||
|
|
||||||
|
override init(frame: CGRect) {
|
||||||
|
super.init(frame: frame)
|
||||||
|
}
|
||||||
|
|
||||||
|
@objc
|
||||||
|
public override func loadForDisplay() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@objc
|
||||||
|
public override func cellSize() -> CGSize {
|
||||||
|
return .zero
|
||||||
|
}
|
||||||
|
|
||||||
|
@objc
|
||||||
|
public override func prepareForReuse() {
|
||||||
|
super.prepareForReuse()
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,44 @@
|
|||||||
|
//
|
||||||
|
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
import Foundation
|
||||||
|
|
||||||
|
@objc(OWSTypingIndicatorInteraction)
|
||||||
|
public class TypingIndicatorInteraction: TSInteraction {
|
||||||
|
@objc
|
||||||
|
public static let TypingIndicatorId = "TypingIndicator"
|
||||||
|
|
||||||
|
@objc
|
||||||
|
public override func isDynamicInteraction() -> Bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
@objc
|
||||||
|
public override func interactionType() -> OWSInteractionType {
|
||||||
|
return .typingIndicator
|
||||||
|
}
|
||||||
|
|
||||||
|
@available(*, unavailable, message:"use other constructor instead.")
|
||||||
|
@objc
|
||||||
|
public required init(coder aDecoder: NSCoder) {
|
||||||
|
notImplemented()
|
||||||
|
}
|
||||||
|
|
||||||
|
@available(*, unavailable, message:"use other constructor instead.")
|
||||||
|
@objc
|
||||||
|
public required init(dictionary dictionaryValue: [AnyHashable: Any]!) throws {
|
||||||
|
notImplemented()
|
||||||
|
}
|
||||||
|
|
||||||
|
@objc
|
||||||
|
public let recipientId: String
|
||||||
|
|
||||||
|
@objc
|
||||||
|
public init(thread: TSThread, timestamp: UInt64, recipientId: String) {
|
||||||
|
self.recipientId = recipientId
|
||||||
|
|
||||||
|
super.init(interactionWithUniqueId: TypingIndicatorInteraction.TypingIndicatorId,
|
||||||
|
timestamp: timestamp, in: thread)
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue