wip: expand/collapse emojis
This commit is contained in:
parent
6af2d29582
commit
38665e6c33
|
@ -10,6 +10,7 @@ final class ReactionContainerView : UIView {
|
|||
|
||||
private var showingAllReactions = false
|
||||
|
||||
var reactions: [(String, (Int, Bool))] = []
|
||||
var reactionViews: [ReactionView] = []
|
||||
var expandButton: ExpandingReactionButton?
|
||||
|
||||
|
@ -33,6 +34,7 @@ final class ReactionContainerView : UIView {
|
|||
}
|
||||
|
||||
public func update(_ reactions: [(String, (Int, Bool))]) {
|
||||
self.reactions = reactions
|
||||
prepareForUpdate()
|
||||
|
||||
let stackView = UIStackView()
|
||||
|
@ -58,7 +60,7 @@ final class ReactionContainerView : UIView {
|
|||
}
|
||||
if expandButtonReactions.count > 0 {
|
||||
expandButton = ExpandingReactionButton(emojis: expandButtonReactions)
|
||||
stackView.addArrangedSubview(expandButton)
|
||||
stackView.addArrangedSubview(expandButton!)
|
||||
} else {
|
||||
expandButton = nil
|
||||
}
|
||||
|
@ -72,6 +74,12 @@ final class ReactionContainerView : UIView {
|
|||
}
|
||||
reactionViews = []
|
||||
}
|
||||
|
||||
public func showAllEmojis() {
|
||||
guard !showingAllReactions else { return }
|
||||
showingAllReactions = true
|
||||
update(reactions)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -562,6 +562,7 @@ final class VisibleMessageCell : MessageCell, LinkPreviewViewDelegate {
|
|||
}
|
||||
if let expandButton = reactionContainerView.expandButton, expandButton.frame.contains(convertedLocation) {
|
||||
// TODO: show all emojis
|
||||
reactionContainerView.
|
||||
}
|
||||
} else {
|
||||
delegate?.handleViewItemTapped(viewItem, gestureRecognizer: gestureRecognizer)
|
||||
|
|
Loading…
Reference in New Issue