From 79a4ceedf9274f5954b8009bf6bf6f6b3a7bc60b Mon Sep 17 00:00:00 2001 From: Alex Hart Date: Tue, 25 Jan 2022 13:34:32 -0400 Subject: [PATCH] Fix issue with result callback from gif search. --- .../securesms/conversation/ConversationParentFragment.java | 5 +++++ .../securesms/keyboard/gif/GifKeyboardPageFragment.kt | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationParentFragment.java b/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationParentFragment.java index a3410a929..cb5dead65 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationParentFragment.java +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationParentFragment.java @@ -3355,6 +3355,11 @@ public class ConversationParentFragment extends Fragment } } + @Override + public void openGifSearch() { + AttachmentManager.selectGif(this, ConversationParentFragment.PICK_GIF, isMms()); + } + @Override public void onGifSelectSuccess(@NonNull Uri blobUri, int width, int height) { setMedia(blobUri, diff --git a/app/src/main/java/org/thoughtcrime/securesms/keyboard/gif/GifKeyboardPageFragment.kt b/app/src/main/java/org/thoughtcrime/securesms/keyboard/gif/GifKeyboardPageFragment.kt index 0eab17069..d5391259a 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/keyboard/gif/GifKeyboardPageFragment.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/keyboard/gif/GifKeyboardPageFragment.kt @@ -9,13 +9,11 @@ import androidx.lifecycle.ViewModelProvider import androidx.recyclerview.widget.RecyclerView import org.thoughtcrime.securesms.LoggingFragment import org.thoughtcrime.securesms.R -import org.thoughtcrime.securesms.conversation.ConversationParentFragment import org.thoughtcrime.securesms.giph.mp4.GiphyMp4Fragment import org.thoughtcrime.securesms.giph.mp4.GiphyMp4SaveResult import org.thoughtcrime.securesms.giph.mp4.GiphyMp4ViewModel import org.thoughtcrime.securesms.keyboard.emoji.KeyboardPageSearchView import org.thoughtcrime.securesms.keyboard.findListener -import org.thoughtcrime.securesms.mms.AttachmentManager import org.thoughtcrime.securesms.util.views.SimpleProgressDialog class GifKeyboardPageFragment : LoggingFragment(R.layout.gif_keyboard_page_fragment) { @@ -107,11 +105,12 @@ class GifKeyboardPageFragment : LoggingFragment(R.layout.gif_keyboard_page_fragm } private fun openGifSearch() { - AttachmentManager.selectGif(requireParentFragment(), ConversationParentFragment.PICK_GIF, host.isMms()) + host.openGifSearch() } interface Host { fun isMms(): Boolean + fun openGifSearch() fun onGifSelectSuccess(blobUri: Uri, width: Int, height: Int) } }