Improve group call reactions UI when presented without raise hand.

This also dismisses the custom reaction picker when switching to PiP mode.
This commit is contained in:
Nicholas Tinsley
2024-04-24 10:13:56 -04:00
parent 293634c758
commit 881d231a93
4 changed files with 24 additions and 5 deletions

View File

@@ -30,7 +30,6 @@ class CallOverflowPopupWindow(private val activity: FragmentActivity, parentView
LayoutInflater.from(activity).inflate(R.layout.call_overflow_holder, parentViewGroup, false),
activity.resources.getDimension(R.dimen.calling_reaction_popup_menu_width).toInt(),
activity.resources.getDimension(R.dimen.calling_reaction_popup_menu_height).toInt()
) {
private val raiseHandLabel: TextView = (contentView as LinearLayout).findViewById(R.id.raise_hand_label)

View File

@@ -20,6 +20,16 @@ class CallReactionScrubber @JvmOverloads constructor(
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr) {
companion object {
const val CUSTOM_REACTION_BOTTOM_SHEET_TAG = "CallReaction"
@JvmStatic
fun dismissCustomEmojiBottomSheet(fm: FragmentManager) {
val bottomSheet = fm.findFragmentByTag(CUSTOM_REACTION_BOTTOM_SHEET_TAG) as? ReactWithAnyEmojiBottomSheetDialogFragment
bottomSheet?.dismissNow()
}
}
private val emojiViews: Array<EmojiImageView>
private var customEmojiIndex = 0
@@ -48,7 +58,7 @@ class CallReactionScrubber @JvmOverloads constructor(
view.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_any_emoji_32))
view.setOnClickListener {
val bottomSheet = ReactWithAnyEmojiBottomSheetDialogFragment.createForCallingReactions()
bottomSheet.show(fragmentManager, "CallReaction")
bottomSheet.show(fragmentManager, CUSTOM_REACTION_BOTTOM_SHEET_TAG)
}
} else {
val preferredVariation = SignalStore.emojiValues().getPreferredVariation(emojis[i])