mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Prevent typing message after starting voice recording in chat by disabling field & hiding keyboard
This commit is contained in:
parent
40610fd98f
commit
3aaea594f4
3 changed files with 6 additions and 4 deletions
|
|
@ -185,10 +185,6 @@ class ConversationFragment : SlidingPaneChildFragment() {
|
|||
|
||||
private val dataObserver = object : AdapterDataObserver() {
|
||||
override fun onItemRangeInserted(positionStart: Int, itemCount: Int) {
|
||||
if (positionStart > 0) {
|
||||
adapter.notifyItemChanged(positionStart - 1) // For grouping purposes
|
||||
}
|
||||
|
||||
if (viewModel.isUserScrollingUp.value == true) {
|
||||
Log.i(
|
||||
"$TAG [$itemCount] events have been loaded but user was scrolling up in conversation, do not scroll"
|
||||
|
|
@ -207,6 +203,10 @@ class ConversationFragment : SlidingPaneChildFragment() {
|
|||
)
|
||||
}
|
||||
scrollToFirstUnreadMessageOrBottom()
|
||||
|
||||
if (positionStart > 0) {
|
||||
adapter.notifyItemChanged(positionStart - 1) // For grouping purposes
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -377,6 +377,7 @@ class SendMessageInConversationViewModel @UiThread constructor() : ViewModel() {
|
|||
}
|
||||
|
||||
coreContext.postOnCoreThread {
|
||||
requestKeyboardHidingEvent.postValue(Event(true))
|
||||
isVoiceRecording.postValue(true)
|
||||
initVoiceRecorder()
|
||||
|
||||
|
|
|
|||
|
|
@ -148,6 +148,7 @@
|
|||
android:text="@={viewModel.textToSend}"
|
||||
android:textColorHint="?attr/color_main2_400"
|
||||
android:textSize="14sp"
|
||||
android:enabled="@{!viewModel.isVoiceRecording}"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/send_barrier"
|
||||
app:layout_constraintStart_toStartOf="@id/message_area_background"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue