update and adapt signal sources to have the new media keyboard including new emojis

This commit is contained in:
cyberta 2020-06-11 17:11:23 +02:00
parent c0f726e2be
commit 56d85e01e1
98 changed files with 2378 additions and 621 deletions

View file

@ -80,7 +80,8 @@ import org.thoughtcrime.securesms.components.SendButton;
import org.thoughtcrime.securesms.components.camera.QuickAttachmentDrawer;
import org.thoughtcrime.securesms.components.camera.QuickAttachmentDrawer.AttachmentDrawerListener;
import org.thoughtcrime.securesms.components.camera.QuickAttachmentDrawer.DrawerState;
import org.thoughtcrime.securesms.components.emoji.EmojiDrawer;
import org.thoughtcrime.securesms.components.emoji.EmojiKeyboardProvider;
import org.thoughtcrime.securesms.components.emoji.MediaKeyboard;
import org.thoughtcrime.securesms.components.reminder.ReminderView;
import org.thoughtcrime.securesms.connect.ApplicationDcContext;
import org.thoughtcrime.securesms.connect.DcHelper;
@ -139,6 +140,17 @@ import static org.thoughtcrime.securesms.util.RelayUtil.isSharing;
*/
@SuppressLint("StaticFieldLeak")
public class ConversationActivity extends PassphraseRequiredActionBarActivity
/*implements xAttachmentManager.AttachmentListener,
xOnKeyboardShownListener,
xInputPanel.Listener,
xInputPanel.MediaListener,
xComposeText.CursorPositionChangedListener,
xConversationSearchBottomBar.EventListener,
StickerKeyboardProvider.StickerEventListener,
AttachmentKeyboard.Callback,
xConversationReactionOverlay.OnReactionSelectedListener,
xReactWithAnyEmojiBottomSheetDialogFragment.Callback*/
implements ConversationFragment.ConversationFragmentListener,
AttachmentManager.AttachmentListener,
SearchView.OnQueryTextListener,
@ -180,7 +192,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
private AttachmentTypeSelector attachmentTypeSelector;
private AttachmentManager attachmentManager;
private AudioRecorder audioRecorder;
private Stub<EmojiDrawer> emojiDrawerStub;
private Stub<MediaKeyboard> emojiDrawerStub;
protected HidingLinearLayout quickAttachmentToggle;
private QuickAttachmentDrawer quickAttachmentDrawer;
private InputPanel inputPanel;
@ -258,6 +270,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
Log.w(TAG, "onNewIntent()");
if (isFinishing()) {
@ -1371,8 +1384,8 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
@Override
public void onEmojiToggle() {
if (!emojiDrawerStub.resolved()) {
inputPanel.setEmojiDrawer(emojiDrawerStub.get());
emojiDrawerStub.get().setEmojiEventListener(inputPanel);
initializeMediaKeyboardProviders(emojiDrawerStub.get(), false);
inputPanel.setMediaKeyboard(emojiDrawerStub.get());
}
if (container.getCurrentInput() == emojiDrawerStub.get()) {
@ -1396,6 +1409,13 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
}
private void initializeMediaKeyboardProviders(@NonNull MediaKeyboard mediaKeyboard, boolean stickersAvailable) {
boolean isSystemEmojiPreferred = Prefs.isSystemEmojiPreferred(this);
if (!isSystemEmojiPreferred) {
mediaKeyboard.setProviders(0, new EmojiKeyboardProvider(this, inputPanel));
}
}
// Listeners
private class AttachmentTypeListener implements AttachmentTypeSelector.AttachmentClickedListener {
@ -1521,6 +1541,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
@Override
public void handleReplyMessage(DcMsg messageRecord) {
inputPanel.clickOnComposeInput();
}
@Override