Skip to content

Commit

Permalink
Fix masking when attachment keyboard is visible.
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-signal committed Jul 31, 2020
1 parent dc48ee5 commit eeb0c83
Showing 1 changed file with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2934,7 +2934,7 @@ public void handleReaction(@NonNull View maskTarget,
{
reactionOverlay.setOnToolbarItemClickedListener(toolbarListener);
reactionOverlay.setOnHideListener(onHideListener);
reactionOverlay.show(this, maskTarget, messageRecord, panelParent.getMeasuredHeight());
reactionOverlay.show(this, maskTarget, messageRecord, inputAreaHeight());
}

@Override
Expand All @@ -2959,7 +2959,7 @@ public void onMessageWithErrorClicked(@NonNull MessageRecord messageRecord) {

@Override
public void handleReactionDetails(@NonNull View maskTarget) {
reactionOverlay.showMask(maskTarget, titleView.getMeasuredHeight(), panelParent.getMeasuredHeight());
reactionOverlay.showMask(maskTarget, titleView.getMeasuredHeight(), inputAreaHeight());
}

@Override
Expand Down Expand Up @@ -3059,6 +3059,19 @@ public void onAttachmentChanged() {
updateLinkPreviewState();
}

private int inputAreaHeight() {
int height = panelParent.getMeasuredHeight();

if (attachmentKeyboardStub.resolved()) {
View keyboard = attachmentKeyboardStub.get();
if (keyboard.getVisibility() == View.VISIBLE) {
return height + keyboard.getMeasuredHeight();
}
}

return height;
}

private void onMessageRequestDeleteClicked(@NonNull MessageRequestViewModel requestModel) {
Recipient recipient = requestModel.getRecipient().getValue();
if (recipient == null) {
Expand Down

0 comments on commit eeb0c83

Please sign in to comment.