Show/hide attachment keyboard with the reaction overlay.

fork-5.53.8
Greyson Parrelli 2022-06-17 19:13:14 -04:00
rodzic 2e9f43cf94
commit 0209db4531
2 zmienionych plików z 21 dodań i 0 usunięć

Wyświetl plik

@ -1427,6 +1427,8 @@ public class ConversationFragment extends LoggingFragment implements Multiselect
public interface ConversationFragmentListener extends VoiceNoteMediaControllerOwner { public interface ConversationFragmentListener extends VoiceNoteMediaControllerOwner {
boolean isKeyboardOpen(); boolean isKeyboardOpen();
boolean isAttachmentKeyboardOpen();
void openAttachmentKeyboard();
void setThreadId(long threadId); void setThreadId(long threadId);
void handleReplyMessage(ConversationMessage conversationMessage); void handleReplyMessage(ConversationMessage conversationMessage);
void onMessageActionToolbarOpened(); void onMessageActionToolbarOpened();
@ -1599,6 +1601,8 @@ public class ConversationFragment extends LoggingFragment implements Multiselect
conversationViewModel.setShowScrollButtons(false); conversationViewModel.setShowScrollButtons(false);
} }
boolean isAttachmentKeyboardOpen = listener.isAttachmentKeyboardOpen();
listener.handleReaction(item.getConversationMessage(), listener.handleReaction(item.getConversationMessage(),
new ReactionsToolbarListener(item.getConversationMessage()), new ReactionsToolbarListener(item.getConversationMessage()),
selectedConversationModel, selectedConversationModel,
@ -1630,6 +1634,10 @@ public class ConversationFragment extends LoggingFragment implements Multiselect
if (showScrollButtons) { if (showScrollButtons) {
conversationViewModel.setShowScrollButtons(true); conversationViewModel.setShowScrollButtons(true);
} }
if (isAttachmentKeyboardOpen) {
listener.openAttachmentKeyboard();
}
} }
}); });
} }

Wyświetl plik

@ -3887,6 +3887,9 @@ public class ConversationParentFragment extends Fragment
reactionDelegate.setOnActionSelectedListener(onActionSelectedListener); reactionDelegate.setOnActionSelectedListener(onActionSelectedListener);
reactionDelegate.setOnHideListener(onHideListener); reactionDelegate.setOnHideListener(onHideListener);
reactionDelegate.show(requireActivity(), recipient.get(), conversationMessage, groupViewModel.isNonAdminInAnnouncementGroup(), selectedConversationModel); reactionDelegate.show(requireActivity(), recipient.get(), conversationMessage, groupViewModel.isNonAdminInAnnouncementGroup(), selectedConversationModel);
if (attachmentKeyboardStub.resolved()) {
attachmentKeyboardStub.get().hide(true);
}
} }
@Override @Override
@ -3964,6 +3967,16 @@ public class ConversationParentFragment extends Fragment
return container.isKeyboardOpen(); return container.isKeyboardOpen();
} }
@Override
public boolean isAttachmentKeyboardOpen() {
return attachmentKeyboardStub.resolved() && attachmentKeyboardStub.get().isShowing();
}
@Override
public void openAttachmentKeyboard() {
attachmentKeyboardStub.get().show(container.getKeyboardHeight(), true);
}
@Override @Override
public void setThreadId(long threadId) { public void setThreadId(long threadId) {
this.threadId = threadId; this.threadId = threadId;