Skip to content
Snippets Groups Projects
Commit 6ed6a8fb authored by Pavan Koushik Nellore's avatar Pavan Koushik Nellore Committed by Adrien Béraud
Browse files

Auto-focus input field and show keyboard on reply

Ensure msgInputTxt gains focus and triggers the soft
keyboard when replying to a message.

Change-Id: I4e4fa285df61bab2b5d1cdd43df42ed3bbc74248
parent a7bb3f0a
No related branches found
No related tags found
No related merge requests found
...@@ -35,6 +35,7 @@ import android.util.Log ...@@ -35,6 +35,7 @@ import android.util.Log
import android.view.* import android.view.*
import android.view.animation.AnimationUtils import android.view.animation.AnimationUtils
import android.view.inputmethod.EditorInfo import android.view.inputmethod.EditorInfo
import android.view.inputmethod.InputMethodManager
import android.widget.* import android.widget.*
import androidx.activity.result.PickVisualMediaRequest import androidx.activity.result.PickVisualMediaRequest
import androidx.activity.result.contract.ActivityResultContracts import androidx.activity.result.contract.ActivityResultContracts
...@@ -1177,6 +1178,15 @@ class ConversationFragment : BaseSupportFragment<ConversationPresenter, Conversa ...@@ -1177,6 +1178,15 @@ class ConversationFragment : BaseSupportFragment<ConversationPresenter, Conversa
replyMessage.isVisible = true replyMessage.isVisible = true
} }
replyGroup.isVisible = true replyGroup.isVisible = true
msgInputTxt.post {
if (!msgInputTxt.hasFocus()) {
msgInputTxt.requestFocus()
(requireContext()
.getSystemService(Context.INPUT_METHOD_SERVICE) as? InputMethodManager)
?.showSoftInput(msgInputTxt, InputMethodManager.SHOW_IMPLICIT)
}
}
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment