Moved chat message sending layout to specific file & fixed separator being visible upon rotation
This commit is contained in:
parent
5e5937382d
commit
28883abe80
3 changed files with 255 additions and 221 deletions
|
@ -646,7 +646,7 @@ class DetailChatRoomFragment : MasterFragment<ChatRoomDetailFragmentBinding, Cha
|
|||
}
|
||||
}
|
||||
|
||||
binding.setVoiceRecordingTouchListener { _, event ->
|
||||
binding.setVoiceRecordingTouchListener { view, event ->
|
||||
if (corePreferences.holdToRecordVoiceMessage) {
|
||||
when (event.action) {
|
||||
MotionEvent.ACTION_DOWN -> {
|
||||
|
@ -663,14 +663,14 @@ class DetailChatRoomFragment : MasterFragment<ChatRoomDetailFragmentBinding, Cha
|
|||
Log.i("[Chat Room] Voice recording button has been released, stop recording")
|
||||
chatSendingViewModel.stopVoiceRecording()
|
||||
}
|
||||
view.performClick()
|
||||
}
|
||||
}
|
||||
true
|
||||
}
|
||||
false
|
||||
}
|
||||
|
||||
binding.message.setControlEnterListener(object : RichEditTextSendListener {
|
||||
binding.footer.message.setControlEnterListener(object : RichEditTextSendListener {
|
||||
override fun onControlEnterPressedAndReleased() {
|
||||
Log.i("[Chat Room] Detected left control + enter key presses, sending message")
|
||||
chatSendingViewModel.sendMessage()
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<data>
|
||||
<import type="android.view.View"/>
|
||||
|
@ -148,225 +148,17 @@
|
|||
android:layout_alignTop="@id/top_bar"
|
||||
tools:layout="@layout/list_edit_top_bar_fragment" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
<include
|
||||
android:id="@+id/footer"
|
||||
layout="@layout/chat_room_sending"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="?attr/lightToolbarBackgroundColor">
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="@{chatSendingViewModel.isReadOnly ? View.GONE : View.VISIBLE}"
|
||||
app:constraint_referenced_ids="voice_recording_separator, attached_files, attach_file, voice_record, message, send_message" />
|
||||
|
||||
<ViewStub
|
||||
android:id="@+id/stubbed_message_to_reply_to"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:inflatedId="@+id/chat_message_reply"
|
||||
android:layout="@layout/chat_message_reply"
|
||||
android:visibility="@{chatSendingViewModel.isPendingAnswer ? View.VISIBLE : View.GONE, default=gone}"
|
||||
app:cancelClickListener="@{cancelReplyToClickListener}"
|
||||
app:data="@{chatSendingViewModel.pendingChatMessageToReplyTo}"
|
||||
app:inflatedVisibility="@{chatSendingViewModel.isPendingAnswer ? View.VISIBLE : View.GONE}"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.Barrier
|
||||
android:id="@+id/reply_barrier"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:barrierDirection="bottom"
|
||||
app:constraint_referenced_ids="stubbed_message_to_reply_to, chat_message_reply" />
|
||||
|
||||
<ViewStub
|
||||
android:id="@+id/stubbed_voice_recording"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:inflatedId="@+id/voice_recording"
|
||||
android:layout="@layout/chat_message_voice_recording"
|
||||
android:visibility="@{chatSendingViewModel.isPendingVoiceRecord ? View.VISIBLE : View.GONE, default=gone}"
|
||||
app:inflatedVisibility="@{chatSendingViewModel.isPendingVoiceRecord ? View.VISIBLE : View.GONE}"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/reply_barrier"
|
||||
app:viewModel="@{chatSendingViewModel}" />
|
||||
|
||||
<androidx.constraintlayout.widget.Barrier
|
||||
android:id="@+id/voice_barrier"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:barrierDirection="bottom"
|
||||
app:constraint_referenced_ids="stubbed_voice_recording, voice_recording" />
|
||||
|
||||
<View
|
||||
android:id="@+id/voice_recording_separator"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="1dp"
|
||||
android:background="?attr/dividerColor"
|
||||
android:visibility="@{chatSendingViewModel.isPendingVoiceRecord && chatSendingViewModel.attachments.size() > 0 ? View.VISIBLE : View.GONE, default=gone}"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/voice_barrier" />
|
||||
|
||||
<androidx.constraintlayout.widget.Barrier
|
||||
android:id="@+id/chat_message_reply_voice_barrier"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:barrierDirection="bottom"
|
||||
app:constraint_referenced_ids="stubbed_message_to_reply_to, stubbed_voice_recording, voice_recording_separator" />
|
||||
|
||||
<HorizontalScrollView
|
||||
android:id="@+id/attached_files"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/backgroundColor2"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/voice_recording_separator">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="120dp"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="@{chatSendingViewModel.attachingFileInProgress || (chatSendingViewModel.attachments.size() > 0) ? View.VISIBLE : View.GONE, default=gone}"
|
||||
app:entries="@{chatSendingViewModel.attachments}"
|
||||
app:layout="@{@layout/chat_message_attachment_cell}" />
|
||||
|
||||
</HorizontalScrollView>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/attach_file"
|
||||
android:layout_width="@dimen/chat_message_sending_icons_size"
|
||||
android:layout_height="@dimen/chat_message_sending_icons_size"
|
||||
android:layout_marginStart="@dimen/chat_message_sending_icons_margin"
|
||||
android:layout_marginEnd="@dimen/chat_message_sending_icons_margin"
|
||||
android:contentDescription="@string/content_description_attach_file"
|
||||
android:enabled="@{chatSendingViewModel.attachFileEnabled && !chatSendingViewModel.attachFilePending}"
|
||||
android:onClick="@{attachFileClickListener}"
|
||||
android:paddingTop="@dimen/chat_message_sending_icons_margin"
|
||||
android:paddingBottom="@dimen/chat_message_sending_icons_margin"
|
||||
android:src="@drawable/chat_file"
|
||||
app:layout_constraintBottom_toBottomOf="@id/message"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/message" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/voice_record"
|
||||
android:layout_width="@dimen/chat_message_sending_icons_size"
|
||||
android:layout_height="@dimen/chat_message_sending_icons_size"
|
||||
android:layout_marginStart="@dimen/chat_message_sending_icons_margin"
|
||||
android:layout_marginEnd="@dimen/chat_message_sending_icons_margin"
|
||||
android:contentDescription="@string/content_description_voice_recording"
|
||||
android:onClick="@{() -> chatSendingViewModel.toggleVoiceRecording()}"
|
||||
android:onTouch="@{voiceRecordingTouchListener}"
|
||||
android:paddingTop="@dimen/chat_message_sending_icons_margin"
|
||||
android:paddingBottom="@dimen/chat_message_sending_icons_margin"
|
||||
android:selected="@{chatSendingViewModel.isVoiceRecording}"
|
||||
android:src="@drawable/record_audio_message"
|
||||
app:layout_constraintBottom_toBottomOf="@id/message"
|
||||
app:layout_constraintStart_toEndOf="@id/attach_file"
|
||||
app:layout_constraintTop_toTopOf="@id/message" />
|
||||
|
||||
<org.linphone.activities.main.chat.views.RichEditText
|
||||
android:id="@+id/message"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/attached_files"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="@dimen/chat_message_sending_icons_margin"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="@dimen/chat_message_sending_icons_margin"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:background="@drawable/resizable_text_field"
|
||||
android:hint="@{chatSendingViewModel.isPendingAnswer ? @string/chat_room_sending_reply_hint : @string/chat_room_sending_message_hint}"
|
||||
android:imeOptions="@{chatSendingViewModel.imeFlags}"
|
||||
android:inputType="textShortMessage|textMultiLine|textAutoComplete|textAutoCorrect|textCapSentences"
|
||||
android:maxLines="6"
|
||||
android:padding="5dp"
|
||||
android:text="@={chatSendingViewModel.textToSend}"
|
||||
android:textColor="@color/black_color"
|
||||
android:textCursorDrawable="@null"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/send_message"
|
||||
app:layout_constraintStart_toEndOf="@id/voice_record"
|
||||
app:layout_constraintTop_toBottomOf="@id/attached_files" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/send_message"
|
||||
android:layout_width="@dimen/chat_message_sending_icons_size"
|
||||
android:layout_height="@dimen/chat_message_sending_icons_size"
|
||||
android:layout_marginStart="@dimen/chat_message_sending_icons_margin"
|
||||
android:layout_marginEnd="@dimen/chat_message_sending_icons_margin"
|
||||
android:contentDescription="@string/content_description_send_message"
|
||||
android:enabled="@{chatSendingViewModel.sendMessageEnabled && !chatSendingViewModel.attachingFileInProgress}"
|
||||
android:onClick="@{() -> chatSendingViewModel.sendMessage()}"
|
||||
android:paddingTop="@dimen/chat_message_sending_icons_margin"
|
||||
android:paddingBottom="@dimen/chat_message_sending_icons_margin"
|
||||
android:src="@drawable/chat_send_message"
|
||||
app:layout_constraintBottom_toBottomOf="@id/message"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/message" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/send_ephemeral_message"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:clickable="false"
|
||||
android:contentDescription="@string/content_description_ephemeral_message"
|
||||
android:enabled="@{chatSendingViewModel.sendMessageEnabled}"
|
||||
android:padding="5dp"
|
||||
android:src="@drawable/ephemeral_messages"
|
||||
android:visibility="@{!chatSendingViewModel.isReadOnly && viewModel.chatRoom.isEphemeralEnabled() ? View.VISIBLE : View.GONE, default=gone}"
|
||||
app:layout_constraintBottom_toBottomOf="@id/send_message"
|
||||
app:layout_constraintEnd_toEndOf="@id/send_message" />
|
||||
|
||||
<View
|
||||
android:id="@+id/attaching_files_in_progress_background"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="#99c4c4c4"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:visibility="@{chatSendingViewModel.attachingFileInProgress ? View.VISIBLE : View.GONE, default=gone}"
|
||||
app:layout_constraintBottom_toBottomOf="@id/attached_files"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/attached_files" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/attaching_files_in_progress"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true"
|
||||
android:indeterminateDrawable="@drawable/icon_spinner_rotating"
|
||||
android:indeterminateTint="?attr/accentColor"
|
||||
android:visibility="@{chatSendingViewModel.attachingFileInProgress ? View.VISIBLE : View.GONE, default=gone}"
|
||||
app:layout_constraintBottom_toTopOf="@id/attaching_files_in_progress_label"
|
||||
app:layout_constraintEnd_toEndOf="@id/attaching_files_in_progress_background"
|
||||
app:layout_constraintStart_toStartOf="@id/attaching_files_in_progress_background"
|
||||
app:layout_constraintTop_toBottomOf="@id/attached_files" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/attaching_files_in_progress_label"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="@string/operation_in_progress_wait"
|
||||
android:textColor="@color/primary_color"
|
||||
android:textStyle="bold"
|
||||
android:visibility="@{chatSendingViewModel.attachingFileInProgress ? View.VISIBLE : View.GONE, default=gone}"
|
||||
app:layout_constraintBottom_toTopOf="@id/attached_files"
|
||||
app:layout_constraintEnd_toEndOf="@id/attaching_files_in_progress_background"
|
||||
app:layout_constraintStart_toStartOf="@id/attaching_files_in_progress_background"
|
||||
app:layout_constraintTop_toBottomOf="@id/attaching_files_in_progress" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
app:viewModel="@{viewModel}"
|
||||
app:chatSendingViewModel="@{chatSendingViewModel}"
|
||||
app:attachFileClickListener="@{attachFileClickListener}"
|
||||
app:voiceRecordingTouchListener="@{voiceRecordingTouchListener}"
|
||||
app:cancelReplyToClickListener="@{cancelReplyToClickListener}"/>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/chat_messages_list"
|
||||
|
@ -392,7 +184,7 @@
|
|||
android:paddingEnd="5dp"
|
||||
android:background="?attr/backgroundColor"
|
||||
android:text="@{viewModel.composingList, default=@string/chat_remote_is_composing}"
|
||||
android:visibility="@{viewModel.remoteIsComposing ? View.VISIBLE : View.GONE}" />
|
||||
android:visibility="@{viewModel.remoteIsComposing ? View.VISIBLE : View.GONE, default=gone}" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
|
|
242
app/src/main/res/layout/chat_room_sending.xml
Normal file
242
app/src/main/res/layout/chat_room_sending.xml
Normal file
|
@ -0,0 +1,242 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<data>
|
||||
<import type="android.view.View"/>
|
||||
<variable
|
||||
name="attachFileClickListener"
|
||||
type="android.view.View.OnClickListener"/>
|
||||
<variable
|
||||
name="voiceRecordingTouchListener"
|
||||
type="android.view.View.OnTouchListener" />
|
||||
<variable
|
||||
name="cancelReplyToClickListener"
|
||||
type="android.view.View.OnClickListener" />
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="org.linphone.activities.main.chat.viewmodels.ChatRoomViewModel" />
|
||||
<variable
|
||||
name="chatSendingViewModel"
|
||||
type="org.linphone.activities.main.chat.viewmodels.ChatMessageSendingViewModel" />
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/lightToolbarBackgroundColor">
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="@{chatSendingViewModel.isReadOnly ? View.GONE : View.VISIBLE}"
|
||||
app:constraint_referenced_ids="attached_files, attach_file, voice_record, message, send_message" />
|
||||
|
||||
<ViewStub
|
||||
android:id="@+id/stubbed_message_to_reply_to"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:inflatedId="@+id/chat_message_reply"
|
||||
android:layout="@layout/chat_message_reply"
|
||||
android:visibility="@{chatSendingViewModel.isPendingAnswer ? View.VISIBLE : View.GONE, default=gone}"
|
||||
app:cancelClickListener="@{cancelReplyToClickListener}"
|
||||
app:data="@{chatSendingViewModel.pendingChatMessageToReplyTo}"
|
||||
app:inflatedVisibility="@{chatSendingViewModel.isPendingAnswer ? View.VISIBLE : View.GONE}"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.Barrier
|
||||
android:id="@+id/reply_barrier"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:barrierDirection="bottom"
|
||||
app:constraint_referenced_ids="stubbed_message_to_reply_to, chat_message_reply" />
|
||||
|
||||
<ViewStub
|
||||
android:id="@+id/stubbed_voice_recording"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:inflatedId="@+id/voice_recording"
|
||||
android:layout="@layout/chat_message_voice_recording"
|
||||
android:visibility="@{chatSendingViewModel.isPendingVoiceRecord ? View.VISIBLE : View.GONE, default=gone}"
|
||||
app:inflatedVisibility="@{chatSendingViewModel.isPendingVoiceRecord ? View.VISIBLE : View.GONE}"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/reply_barrier"
|
||||
app:viewModel="@{chatSendingViewModel}" />
|
||||
|
||||
<androidx.constraintlayout.widget.Barrier
|
||||
android:id="@+id/voice_barrier"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:barrierDirection="bottom"
|
||||
app:constraint_referenced_ids="stubbed_voice_recording, voice_recording" />
|
||||
|
||||
<View
|
||||
android:id="@+id/voice_recording_separator"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="1dp"
|
||||
android:background="?attr/dividerColor"
|
||||
android:visibility="@{chatSendingViewModel.isPendingVoiceRecord && chatSendingViewModel.attachments.size() > 0 ? View.VISIBLE : View.GONE, default=gone}"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/voice_barrier" />
|
||||
|
||||
<androidx.constraintlayout.widget.Barrier
|
||||
android:id="@+id/chat_message_reply_voice_barrier"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:barrierDirection="bottom"
|
||||
app:constraint_referenced_ids="stubbed_message_to_reply_to, stubbed_voice_recording, voice_recording_separator" />
|
||||
|
||||
<HorizontalScrollView
|
||||
android:id="@+id/attached_files"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/backgroundColor2"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/voice_recording_separator">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="120dp"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="@{chatSendingViewModel.attachingFileInProgress || (chatSendingViewModel.attachments.size() > 0) ? View.VISIBLE : View.GONE, default=gone}"
|
||||
app:entries="@{chatSendingViewModel.attachments}"
|
||||
app:layout="@{@layout/chat_message_attachment_cell}" />
|
||||
|
||||
</HorizontalScrollView>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/attach_file"
|
||||
android:layout_width="@dimen/chat_message_sending_icons_size"
|
||||
android:layout_height="@dimen/chat_message_sending_icons_size"
|
||||
android:layout_marginStart="@dimen/chat_message_sending_icons_margin"
|
||||
android:layout_marginEnd="@dimen/chat_message_sending_icons_margin"
|
||||
android:contentDescription="@string/content_description_attach_file"
|
||||
android:enabled="@{chatSendingViewModel.attachFileEnabled && !chatSendingViewModel.attachFilePending}"
|
||||
android:onClick="@{attachFileClickListener}"
|
||||
android:paddingTop="@dimen/chat_message_sending_icons_margin"
|
||||
android:paddingBottom="@dimen/chat_message_sending_icons_margin"
|
||||
android:src="@drawable/chat_file"
|
||||
app:layout_constraintBottom_toBottomOf="@id/message"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/message" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/voice_record"
|
||||
android:layout_width="@dimen/chat_message_sending_icons_size"
|
||||
android:layout_height="@dimen/chat_message_sending_icons_size"
|
||||
android:layout_marginStart="@dimen/chat_message_sending_icons_margin"
|
||||
android:layout_marginEnd="@dimen/chat_message_sending_icons_margin"
|
||||
android:contentDescription="@string/content_description_voice_recording"
|
||||
android:onClick="@{() -> chatSendingViewModel.toggleVoiceRecording()}"
|
||||
android:onTouch="@{voiceRecordingTouchListener}"
|
||||
android:paddingTop="@dimen/chat_message_sending_icons_margin"
|
||||
android:paddingBottom="@dimen/chat_message_sending_icons_margin"
|
||||
android:selected="@{chatSendingViewModel.isVoiceRecording}"
|
||||
android:src="@drawable/record_audio_message"
|
||||
app:layout_constraintBottom_toBottomOf="@id/message"
|
||||
app:layout_constraintStart_toEndOf="@id/attach_file"
|
||||
app:layout_constraintTop_toTopOf="@id/message" />
|
||||
|
||||
<org.linphone.activities.main.chat.views.RichEditText
|
||||
android:id="@+id/message"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/attached_files"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="@dimen/chat_message_sending_icons_margin"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="@dimen/chat_message_sending_icons_margin"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:background="@drawable/resizable_text_field"
|
||||
android:hint="@{chatSendingViewModel.isPendingAnswer ? @string/chat_room_sending_reply_hint : @string/chat_room_sending_message_hint}"
|
||||
android:imeOptions="@{chatSendingViewModel.imeFlags}"
|
||||
android:inputType="textShortMessage|textMultiLine|textAutoComplete|textAutoCorrect|textCapSentences"
|
||||
android:maxLines="6"
|
||||
android:padding="5dp"
|
||||
android:text="@={chatSendingViewModel.textToSend}"
|
||||
android:textColor="@color/black_color"
|
||||
android:textCursorDrawable="@null"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/send_message"
|
||||
app:layout_constraintStart_toEndOf="@id/voice_record"
|
||||
app:layout_constraintTop_toBottomOf="@id/attached_files" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/send_message"
|
||||
android:layout_width="@dimen/chat_message_sending_icons_size"
|
||||
android:layout_height="@dimen/chat_message_sending_icons_size"
|
||||
android:layout_marginStart="@dimen/chat_message_sending_icons_margin"
|
||||
android:layout_marginEnd="@dimen/chat_message_sending_icons_margin"
|
||||
android:contentDescription="@string/content_description_send_message"
|
||||
android:enabled="@{chatSendingViewModel.sendMessageEnabled && !chatSendingViewModel.attachingFileInProgress}"
|
||||
android:onClick="@{() -> chatSendingViewModel.sendMessage()}"
|
||||
android:paddingTop="@dimen/chat_message_sending_icons_margin"
|
||||
android:paddingBottom="@dimen/chat_message_sending_icons_margin"
|
||||
android:src="@drawable/chat_send_message"
|
||||
app:layout_constraintBottom_toBottomOf="@id/message"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/message" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/send_ephemeral_message"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:clickable="false"
|
||||
android:contentDescription="@string/content_description_ephemeral_message"
|
||||
android:enabled="@{chatSendingViewModel.sendMessageEnabled}"
|
||||
android:padding="5dp"
|
||||
android:src="@drawable/ephemeral_messages"
|
||||
android:visibility="@{!chatSendingViewModel.isReadOnly && viewModel.chatRoom.isEphemeralEnabled() ? View.VISIBLE : View.GONE, default=gone}"
|
||||
app:layout_constraintBottom_toBottomOf="@id/send_message"
|
||||
app:layout_constraintEnd_toEndOf="@id/send_message" />
|
||||
|
||||
<View
|
||||
android:id="@+id/attaching_files_in_progress_background"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="#99c4c4c4"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:visibility="@{chatSendingViewModel.attachingFileInProgress ? View.VISIBLE : View.GONE, default=gone}"
|
||||
app:layout_constraintBottom_toBottomOf="@id/attached_files"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/attached_files" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/attaching_files_in_progress"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true"
|
||||
android:indeterminateDrawable="@drawable/icon_spinner_rotating"
|
||||
android:indeterminateTint="?attr/accentColor"
|
||||
android:visibility="@{chatSendingViewModel.attachingFileInProgress ? View.VISIBLE : View.GONE, default=gone}"
|
||||
app:layout_constraintBottom_toTopOf="@id/attaching_files_in_progress_label"
|
||||
app:layout_constraintEnd_toEndOf="@id/attaching_files_in_progress_background"
|
||||
app:layout_constraintStart_toStartOf="@id/attaching_files_in_progress_background"
|
||||
app:layout_constraintTop_toBottomOf="@id/attached_files" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/attaching_files_in_progress_label"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="@string/operation_in_progress_wait"
|
||||
android:textColor="@color/primary_color"
|
||||
android:textStyle="bold"
|
||||
android:visibility="@{chatSendingViewModel.attachingFileInProgress ? View.VISIBLE : View.GONE, default=gone}"
|
||||
app:layout_constraintBottom_toTopOf="@id/attached_files"
|
||||
app:layout_constraintEnd_toEndOf="@id/attaching_files_in_progress_background"
|
||||
app:layout_constraintStart_toStartOf="@id/attaching_files_in_progress_background"
|
||||
app:layout_constraintTop_toBottomOf="@id/attaching_files_in_progress" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</layout>
|
Loading…
Reference in a new issue