mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-21 02:08:40 +00:00
Fix crash when leaving conversation.
This commit is contained in:
@@ -90,6 +90,12 @@ public class EmojiEditText extends AppCompatEditText {
|
||||
onFocusChangeListeners.add(listener);
|
||||
}
|
||||
|
||||
public void removeOnFocusChangeListener(@Nullable OnFocusChangeListener listener) {
|
||||
if (listener != null) {
|
||||
onFocusChangeListeners.remove(listener);
|
||||
}
|
||||
}
|
||||
|
||||
private InputFilter[] appendEmojiFilter(@Nullable InputFilter[] originalFilters, boolean jumboEmoji) {
|
||||
InputFilter[] result;
|
||||
|
||||
|
||||
@@ -356,7 +356,18 @@ class ConversationFragment :
|
||||
}
|
||||
|
||||
private val disposables = LifecycleDisposable()
|
||||
private val binding by ViewBinderDelegate(V2ConversationFragmentBinding::bind)
|
||||
private val binding by ViewBinderDelegate(V2ConversationFragmentBinding::bind) {
|
||||
composeText.apply {
|
||||
setOnEditorActionListener(null)
|
||||
setCursorPositionChangedListener(null)
|
||||
setOnKeyListener(null)
|
||||
removeTextChangedListener(composeTextEventsListener)
|
||||
setStylingChangedListener(null)
|
||||
setOnClickListener(null)
|
||||
removeOnFocusChangeListener(composeTextEventsListener)
|
||||
}
|
||||
}
|
||||
|
||||
private val viewModel: ConversationViewModel by viewModel {
|
||||
ConversationViewModel(
|
||||
threadId = args.threadId,
|
||||
@@ -454,6 +465,7 @@ class ConversationFragment :
|
||||
private var isSearchRequested: Boolean = false
|
||||
private var previousPages: Set<KeyboardPage>? = null
|
||||
private var reShowScheduleMessagesBar: Boolean = false
|
||||
private var composeTextEventsListener: ComposeTextEventsListener? = null
|
||||
|
||||
private val jumpAndPulseScrollStrategy = object : ScrollToPositionDelegate.ScrollStrategy {
|
||||
override fun performScroll(recyclerView: RecyclerView, layoutManager: LinearLayoutManager, position: Int, smooth: Boolean) {
|
||||
@@ -814,7 +826,7 @@ class ConversationFragment :
|
||||
binding.conversationDisabledInput.listener = disabledInputListener
|
||||
|
||||
val sendButtonListener = SendButtonListener()
|
||||
val composeTextEventsListener = ComposeTextEventsListener()
|
||||
composeTextEventsListener = ComposeTextEventsListener()
|
||||
|
||||
composeText.apply {
|
||||
setOnEditorActionListener(sendButtonListener)
|
||||
|
||||
Reference in New Issue
Block a user