tweak: always left align emoji reacts

pull/638/head
Ryan Zhao 3 years ago
parent c7c92f747c
commit 838623171d

@ -5,7 +5,6 @@ import SessionUIKit
final class ReactionContainerView: UIView { final class ReactionContainerView: UIView {
var showingAllReactions = false var showingAllReactions = false
private var isOutgoingMessage = false
private var showNumbers = true private var showNumbers = true
private var maxEmojisPerLine = isIPhone6OrSmaller ? 5 : 6 private var maxEmojisPerLine = isIPhone6OrSmaller ? 5 : 6
@ -68,9 +67,8 @@ final class ReactionContainerView: UIView {
mainStackView.pin(to: self) mainStackView.pin(to: self)
} }
public func update(_ reactions: [ReactionViewModel], isOutgoingMessage: Bool, showNumbers: Bool) { public func update(_ reactions: [ReactionViewModel], showNumbers: Bool) {
self.reactions = reactions self.reactions = reactions
self.isOutgoingMessage = isOutgoingMessage
self.showNumbers = showNumbers self.showNumbers = showNumbers
prepareForUpdate() prepareForUpdate()
@ -89,15 +87,6 @@ final class ReactionContainerView: UIView {
stackView.spacing = Values.smallSpacing stackView.spacing = Values.smallSpacing
stackView.alignment = .center stackView.alignment = .center
if isOutgoingMessage {
stackView.semanticContentAttribute = .forceRightToLeft
reactionContainerView.semanticContentAttribute = .forceRightToLeft
}
else {
stackView.semanticContentAttribute = .unspecified
reactionContainerView.semanticContentAttribute = .unspecified
}
var displayedReactions: [ReactionViewModel] var displayedReactions: [ReactionViewModel]
var expandButtonReactions: [EmojiWithSkinTones] var expandButtonReactions: [EmojiWithSkinTones]
@ -168,14 +157,14 @@ final class ReactionContainerView: UIView {
guard !showingAllReactions else { return } guard !showingAllReactions else { return }
showingAllReactions = true showingAllReactions = true
update(reactions, isOutgoingMessage: isOutgoingMessage, showNumbers: showNumbers) update(reactions, showNumbers: showNumbers)
} }
public func showLessEmojis() { public func showLessEmojis() {
guard showingAllReactions else { return } guard showingAllReactions else { return }
showingAllReactions = false showingAllReactions = false
update(reactions, isOutgoingMessage: isOutgoingMessage, showNumbers: showNumbers) update(reactions, showNumbers: showNumbers)
} }
} }

@ -641,7 +641,6 @@ final class VisibleMessageCell: MessageCell, TappableLabelDelegate {
reactionContainerView.showingAllReactions = showExpandedReactions reactionContainerView.showingAllReactions = showExpandedReactions
reactionContainerView.update( reactionContainerView.update(
reactions.orderedValues, reactions.orderedValues,
isOutgoingMessage: (cellViewModel.variant == .standardOutgoing),
showNumbers: ( showNumbers: (
cellViewModel.threadVariant == .closedGroup || cellViewModel.threadVariant == .closedGroup ||
cellViewModel.threadVariant == .openGroup cellViewModel.threadVariant == .openGroup

Loading…
Cancel
Save