diff --git a/app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt b/app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt index 987d369582..c1ecc28bd9 100644 --- a/app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt +++ b/app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt @@ -162,7 +162,6 @@ import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_INTERNAL_USER_ID import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_IS_BREAKOUT_ROOM import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_IS_MODERATOR import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_RECORDING_STATE -import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_ROOM_ID import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_ROOM_TOKEN import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_START_CALL_AFTER_ROOM_SWITCH import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_SWITCH_TO_ROOM @@ -187,7 +186,6 @@ import kotlinx.coroutines.withContext import org.greenrobot.eventbus.Subscribe import org.greenrobot.eventbus.ThreadMode import retrofit2.HttpException -import retrofit2.Response import java.io.File import java.io.IOException import java.net.HttpURLConnection @@ -333,6 +331,8 @@ class ChatActivity : } } + private lateinit var messageInputFragment: MessageInputFragment + val typingParticipants = HashMap() var callStarted = false @@ -399,6 +399,8 @@ class ChatActivity : setContentView(binding.root) setupSystemColors() + messageInputFragment = MessageInputFragment() + conversationUser = currentUserProvider.currentUser.blockingGet() handleIntent(intent) @@ -580,7 +582,7 @@ class ChatActivity : supportFragmentManager.commit { setReorderingAllowed(true) // optimizes out redundant replace operations - replace(R.id.fragment_container_activity_chat, MessageInputFragment()) + replace(R.id.fragment_container_activity_chat, messageInputFragment) } joinRoomWithPassword() diff --git a/app/src/main/java/com/nextcloud/talk/chat/MessageInputFragment.kt b/app/src/main/java/com/nextcloud/talk/chat/MessageInputFragment.kt index 3b2f6b427a..0467cd2d4a 100644 --- a/app/src/main/java/com/nextcloud/talk/chat/MessageInputFragment.kt +++ b/app/src/main/java/com/nextcloud/talk/chat/MessageInputFragment.kt @@ -136,9 +136,13 @@ class MessageInputFragment : Fragment() { return binding.root } + override fun onPause() { + super.onPause() + saveState() + } + override fun onDestroyView() { super.onDestroyView() - saveState() if (mentionAutocomplete != null && mentionAutocomplete!!.isPopupShowing) { mentionAutocomplete?.dismissPopup() }