mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-04-21 12:08:29 +00:00
202 lines
No EOL
9 KiB
XML
202 lines
No EOL
9 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<layout xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
|
|
|
<data>
|
|
<import type="android.view.View"/>
|
|
<variable
|
|
name="cancelClickListener"
|
|
type="android.view.View.OnClickListener"/>
|
|
<variable
|
|
name="attachFileClickListener"
|
|
type="android.view.View.OnClickListener"/>
|
|
<variable
|
|
name="chatRoomsListClickListener"
|
|
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>
|
|
|
|
<RelativeLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent">
|
|
|
|
<LinearLayout
|
|
android:id="@+id/top_bar"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="@dimen/voip_top_bar_size"
|
|
android:background="?attr/voipToolbarBackgroundColor"
|
|
android:orientation="horizontal">
|
|
|
|
<LinearLayout
|
|
android:layout_width="0dp"
|
|
android:layout_height="match_parent"
|
|
android:layout_weight="0.6"
|
|
android:gravity="start|center_vertical"
|
|
android:layout_marginStart="20dp"
|
|
android:orientation="vertical">
|
|
|
|
<org.linphone.views.MarqueeTextView
|
|
android:text="@{viewModel.oneToOneChatRoom ? (viewModel.contact.name ?? viewModel.displayName) : viewModel.subject}"
|
|
style="@style/toolbar_small_title_font"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:singleLine="true" />
|
|
|
|
<org.linphone.views.MarqueeTextView
|
|
android:text="@{viewModel.participants}"
|
|
android:visibility="@{viewModel.oneToOneChatRoom ? View.GONE : View.VISIBLE}"
|
|
style="@style/toolbar_small_title_font"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:singleLine="true" />
|
|
|
|
</LinearLayout>
|
|
|
|
<ImageView
|
|
android:onClick="@{chatRoomsListClickListener}"
|
|
android:layout_width="0dp"
|
|
android:layout_height="match_parent"
|
|
android:layout_weight="0.2"
|
|
android:src="@drawable/icon_call_chat_rooms"
|
|
android:contentDescription="@string/content_description_go_to_chat_rooms_list"
|
|
app:layout_constraintEnd_toEndOf="parent"/>
|
|
|
|
<ImageView
|
|
android:onClick="@{cancelClickListener}"
|
|
android:layout_width="0dp"
|
|
android:layout_height="match_parent"
|
|
android:layout_weight="0.2"
|
|
android:padding="10dp"
|
|
android:src="@drawable/icon_cancel"
|
|
android:contentDescription="@string/cancel"
|
|
app:layout_constraintEnd_toEndOf="parent"/>
|
|
|
|
</LinearLayout>
|
|
|
|
<View
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent"
|
|
android:layout_below="@id/top_bar"
|
|
android:background="?attr/voipBackgroundBWColor" />
|
|
|
|
<LinearLayout
|
|
android:id="@+id/footer"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:layout_alignParentBottom="true"
|
|
android:background="?attr/backgroundColor"
|
|
android:gravity="center_vertical"
|
|
android:orientation="vertical">
|
|
|
|
<include
|
|
layout="@layout/chat_message_reply"
|
|
android:visibility="@{chatSendingViewModel.isPendingAnswer ? View.VISIBLE : View.GONE, default=gone}"
|
|
app:data="@{chatSendingViewModel.pendingChatMessageToReplyTo}"
|
|
app:cancelClickListener="@{() -> chatSendingViewModel.cancelReply()}" />
|
|
|
|
<HorizontalScrollView
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:background="?attr/backgroundColor2"
|
|
android:orientation="horizontal">
|
|
|
|
<LinearLayout
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:orientation="horizontal"
|
|
app:entries="@{chatSendingViewModel.attachments}"
|
|
app:layout="@{@layout/chat_message_attachment_cell}" />
|
|
|
|
</HorizontalScrollView>
|
|
|
|
<LinearLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:visibility="@{chatSendingViewModel.isReadOnly ? View.GONE : View.VISIBLE}"
|
|
android:gravity="center_vertical"
|
|
android:background="?attr/lightToolbarBackgroundColor"
|
|
android:orientation="horizontal">
|
|
|
|
<ImageView
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:contentDescription="@string/content_description_attach_file"
|
|
android:enabled="@{chatSendingViewModel.attachFileEnabled}"
|
|
android:onClick="@{attachFileClickListener}"
|
|
android:padding="10dp"
|
|
android:src="@drawable/chat_file" />
|
|
|
|
<EditText
|
|
android:id="@+id/message"
|
|
android:layout_width="0dp"
|
|
android:layout_height="wrap_content"
|
|
android:layout_gravity="center_vertical"
|
|
android:layout_marginTop="10dp"
|
|
android:layout_marginBottom="10dp"
|
|
android:layout_weight="1"
|
|
android:background="@drawable/resizable_text_field"
|
|
android:hint="@{chatSendingViewModel.isPendingAnswer ? @string/chat_room_sending_reply_hint : @string/chat_room_sending_message_hint}"
|
|
android:imeOptions="flagNoExtractUi"
|
|
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" />
|
|
|
|
<ImageView
|
|
android:id="@+id/send_message"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:contentDescription="@string/content_description_send_message"
|
|
android:enabled="@{chatSendingViewModel.sendMessageEnabled}"
|
|
android:onClick="@{() -> chatSendingViewModel.sendMessage()}"
|
|
android:padding="10dp"
|
|
android:src="@drawable/chat_send_message" />
|
|
|
|
</LinearLayout>
|
|
|
|
</LinearLayout>
|
|
|
|
<TextView
|
|
android:id="@+id/remote_composing"
|
|
android:text="@{viewModel.composingList, default=@string/chat_remote_is_composing}"
|
|
android:visibility="@{viewModel.remoteIsComposing ? View.VISIBLE : View.INVISIBLE}"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:layout_above="@id/footer"
|
|
android:layout_marginLeft="5dp"
|
|
style="@style/standard_small_text_font" />
|
|
|
|
<androidx.recyclerview.widget.RecyclerView
|
|
android:id="@+id/chat_messages_list"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent"
|
|
android:layout_above="@id/remote_composing"
|
|
android:layout_below="@+id/top_bar"
|
|
android:cacheColorHint="@color/transparent_color"
|
|
android:choiceMode="multipleChoice"
|
|
android:divider="@android:color/transparent"
|
|
android:listSelector="@color/transparent_color"
|
|
android:transcriptMode="normal" />
|
|
|
|
<ImageView
|
|
android:src="@{viewModel.securityLevelIcon, default=@drawable/security_alert_indicator}"
|
|
android:visibility="@{viewModel.encryptedChatRoom ? View.VISIBLE : View.GONE}"
|
|
android:contentDescription="@{viewModel.securityLevelContentDescription}"
|
|
android:adjustViewBounds="true"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_below="@id/top_bar"
|
|
android:layout_alignParentRight="true"
|
|
android:layout_marginTop="8dp"
|
|
android:layout_marginRight="8dp" />
|
|
|
|
</RelativeLayout>
|
|
|
|
</layout> |