mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Fixed chat attachments preview
This commit is contained in:
parent
349167868f
commit
e0dc53564e
5 changed files with 118 additions and 85 deletions
5
app/src/main/res/drawable/shape_white_round.xml
Normal file
5
app/src/main/res/drawable/shape_white_round.xml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
|
||||
<size android:width="44dp" android:height="44dp" />
|
||||
<solid android:color="@color/white"/>
|
||||
</shape>
|
||||
|
|
@ -29,7 +29,7 @@
|
|||
app:flexWrap="wrap"
|
||||
app:justifyContent="flex_start"
|
||||
entries="@{viewModel.attachments}"
|
||||
layout="@{@layout/chat_bubble_content_grid_cell}"
|
||||
layout="@{@layout/chat_conversation_attachments_area_cell}"
|
||||
app:layout_constraintTop_toBottomOf="@id/attachments_separator"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,111 @@
|
|||
<?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">
|
||||
|
||||
<data>
|
||||
<import type="android.view.View" />
|
||||
<variable
|
||||
name="onLongClickListener"
|
||||
type="View.OnLongClickListener" />
|
||||
<variable
|
||||
name="model"
|
||||
type="org.linphone.ui.main.chat.model.FileModel" />
|
||||
</data>
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="1dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/image"
|
||||
android:layout_width="@dimen/chat_bubble_grid_image_size"
|
||||
android:layout_height="@dimen/chat_bubble_grid_image_size"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:contentDescription="@{model.isVideoPreview ? @string/content_description_chat_bubble_video : @string/content_description_chat_bubble_image}"
|
||||
android:visibility="@{model.isImage || model.isVideoPreview ? View.VISIBLE : View.GONE}"
|
||||
coilBubbleGrid="@{model.path}"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style_600"
|
||||
android:id="@+id/video_duration"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:text="@{model.audioVideoDuration, default=`00:42`}"
|
||||
android:textColor="@{model.isVideoPreview ? @color/white : @color/main2_600}"
|
||||
android:textSize="12sp"
|
||||
android:visibility="@{model.isVideoPreview && model.audioVideoDuration.length() > 0 ? View.VISIBLE : View.GONE, default=gone}"
|
||||
app:layout_constraintBottom_toBottomOf="@id/image"
|
||||
app:layout_constraintStart_toStartOf="@id/image"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/video_preview"
|
||||
android:layout_width="@dimen/icon_size"
|
||||
android:layout_height="@dimen/icon_size"
|
||||
android:src="@drawable/play_fill"
|
||||
android:contentDescription="@null"
|
||||
android:visibility="@{model.isVideoPreview ? View.VISIBLE : View.GONE, default=gone}"
|
||||
app:layout_constraintTop_toTopOf="@id/image"
|
||||
app:layout_constraintBottom_toBottomOf="@id/image"
|
||||
app:layout_constraintStart_toStartOf="@id/image"
|
||||
app:layout_constraintEnd_toEndOf="@id/image"
|
||||
app:tint="@color/white" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style_700"
|
||||
android:id="@+id/file_name"
|
||||
android:layout_width="@dimen/chat_bubble_grid_image_size"
|
||||
android:layout_height="@dimen/chat_bubble_grid_image_size"
|
||||
android:paddingStart="3dp"
|
||||
android:paddingEnd="3dp"
|
||||
android:text="@{model.fileName, default=`Lorem_ipsum.pdf`}"
|
||||
android:textColor="?attr/color_main2_600"
|
||||
android:textSize="13sp"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="middle"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/shape_squircle_main2_200"
|
||||
android:visibility="@{model.isImage || model.isVideoPreview ? View.GONE : View.VISIBLE}"
|
||||
app:layout_constraintVertical_chainStyle="packed"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/default_text_style_600"
|
||||
android:id="@+id/audio_duration"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:text="@{model.audioVideoDuration, default=`00:42`}"
|
||||
android:textColor="@color/main2_600"
|
||||
android:textSize="12sp"
|
||||
android:visibility="@{model.isAudio && model.audioVideoDuration.length() > 0 ? View.VISIBLE : View.GONE, default=gone}"
|
||||
app:layout_constraintBottom_toBottomOf="@id/file_name"
|
||||
app:layout_constraintStart_toStartOf="@id/file_name"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/remove_attachment"
|
||||
android:onClick="@{() -> model.onClick()}"
|
||||
android:layout_width="@dimen/icon_size"
|
||||
android:layout_height="@dimen/icon_size"
|
||||
android:layout_marginTop="3dp"
|
||||
android:layout_marginEnd="3dp"
|
||||
android:padding="3dp"
|
||||
android:src="@drawable/x"
|
||||
android:background="@drawable/shape_white_round"
|
||||
android:contentDescription="@string/content_description_chat_remove_attachment"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:tint="?attr/color_danger_500" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</layout>
|
||||
|
|
@ -719,88 +719,4 @@
|
|||
<!-- Keep <b></b> in the following strings translations! -->
|
||||
<string name="conversation_message_meeting_updated_label"><b>La réunion a été mise à jour</b></string>
|
||||
<string name="conversation_message_meeting_cancelled_label"><b>La réunion a été annulée</b></string>
|
||||
|
||||
<string name="content_description_trusted_contact_icon">Contact is trusted</string>
|
||||
<string name="content_description_not_trusted_contact_icon">Contact is not trusted!</string>
|
||||
<string name="content_description_contact_online">Contact is online</string>
|
||||
<string name="content_description_contact_away">Contact is not online</string>
|
||||
<string name="content_description_open_drawer_menu_icon">Open drawer menu</string>
|
||||
<string name="content_description_go_back_icon">Go back</string>
|
||||
<string name="content_description_dismiss_notification">Dismiss notification</string>
|
||||
<string name="content_description_save_changes">Save changes</string>
|
||||
<string name="content_description_show_popup_menu">Show menu</string>
|
||||
<string name="content_description_confirm_new_participants_list">Confirm new participants list</string>
|
||||
<string name="content_description_click_for_more_info">Click to have more information</string>
|
||||
<string name="content_description_click_to_remove_participant">Click to remove participant</string>
|
||||
<string name="content_description_toggle_password_visibility">Toggles password visibility</string>
|
||||
<string name="content_description_toggle_bottom_sheet">Expands/retracts bottom sheet</string>
|
||||
<string name="content_description_hang_up_call">Terminates the call</string>
|
||||
<string name="content_description_answer_call">Answers the call</string>
|
||||
<string name="content_description_call_start">Starts a call</string>
|
||||
<string name="content_description_call_start_video">Starts a video call</string>
|
||||
<string name="content_description_toggle_video">Enables/disables sending your camera feed</string>
|
||||
<string name="content_description_toggle_microphone">Mute/un-mute your microphone</string>
|
||||
<string name="content_description_change_output_audio_device">Changes output audio device</string>
|
||||
<string name="content_description_change_camera">Changes camera (front/back) being used</string>
|
||||
<string name="content_description_paused_call">Call is in paused state</string>
|
||||
<string name="content_description_show_call_statistics">Shows call statistics</string>
|
||||
<string name="content_description_call_is_being_recorded">You are recording this call</string>
|
||||
<string name="content_description_erase_last_input">Removes the last digit or character</string>
|
||||
<string name="content_description_merge_calls_into_conference">Merges calls into a conference</string>
|
||||
<string name="content_description_open_filter">Opens filter area</string>
|
||||
<string name="content_description_cancel_filter">Closes filter area</string>
|
||||
<string name="content_description_clear_filter">Clear current filter</string>
|
||||
<string name="content_description_create_group_conversation">Creates the group conversation</string>
|
||||
<string name="content_description_create_group_call">Starts the group call</string>
|
||||
<string name="content_description_show_numpad">Shows the numpad</string>
|
||||
<string name="content_description_spinner_caret">Click to show all available options</string>
|
||||
<string name="content_description_conference_participant_muted">Participant is muted</string>
|
||||
<string name="content_description_conference_participant_speaking">Participant is speaking</string>
|
||||
<string name="content_description_add_participants">Add participants</string>
|
||||
<string name="content_description_play_pause_audio_playback">Plays/pauses the audio playback</string>
|
||||
<string name="content_description_play_pause_video_playback">Plays/pauses the video playback</string>
|
||||
<string name="content_description_share_file">Share file</string>
|
||||
<string name="content_description_save_file">Save file</string>
|
||||
<string name="content_description_chat_bubble_image">Image attached to message</string>
|
||||
<string name="content_description_chat_bubble_video">Video attached to message</string>
|
||||
<string name="content_description_chat_bubble_file">File attached to message</string>
|
||||
<string name="content_description_chat_bubble_reply">This message is a reply to a previous message</string>
|
||||
<string name="content_description_chat_bubble_forward">This message was forwarded from another conversation</string>
|
||||
<string name="content_description_chat_bubble_delivery_status">Click to have delivery status</string>
|
||||
<string name="content_description_chat_bubble_toggle_voice_message_play_pause">Plays/pauses the voice message playback</string>
|
||||
<string name="content_description_chat_remove_attachments">Close attachments</string>
|
||||
<string name="content_description_chat_muted">Conversation has been silenced</string>
|
||||
<string name="content_description_chat_ephemeral_enabled">Ephemeral messages are enabled</string>
|
||||
<string name="content_description_chat_scroll_to_bottom_or_first_unread">Scrolls to first unread message or to the bottom</string>
|
||||
<string name="content_description_chat_close_participants_list">Closes participants list</string>
|
||||
<string name="content_description_cancel_voice_message_recording">Cancels voice message recording</string>
|
||||
<string name="content_description_stop_voice_message_recording">Stops voice message recording</string>
|
||||
<string name="content_description_chat_start_voice_message_recording">Starts recording a voice message</string>
|
||||
<string name="content_description_chat_send_message">Sends message in conversation</string>
|
||||
<string name="content_description_chat_cancel_reply">Message will no longer be a reply to a previous message</string>
|
||||
<string name="content_description_chat_open_emoji_picker">Opens emoji picker</string>
|
||||
<string name="content_description_chat_open_attach_media">Opens media picker</string>
|
||||
<string name="content_description_chat_take_picture">Opens camera to take a picture</string>
|
||||
<string name="content_description_chat_edit_conversation_subject">Click to edit the subject of this conversation</string>
|
||||
<string name="content_description_chat_toggle_mute">Silences on/off this conversation</string>
|
||||
<string name="content_description_chat_removal_in_progress">Conversation is being removed</string>
|
||||
<string name="content_description_chat_unsecured">This conversation isn\'t secured</string>
|
||||
<string name="content_description_chat_create">Start a new conversation</string>
|
||||
<string name="content_description_meeting_today">Scroll to today</string>
|
||||
<string name="content_description_schedule_meeting">Schedule a meeting</string>
|
||||
<string name="content_description_meeting_schedule">Schedule the meeting</string>
|
||||
<string name="content_description_meeting_edit">Edit the meeting</string>
|
||||
<string name="content_description_meeting_share">Share meeting address</string>
|
||||
<string name="content_description_meeting_participants_list">Participants list</string>
|
||||
<string name="content_description_contact_device_trusted">Device is trusted</string>
|
||||
<string name="content_description_contact_edit">Edit contact</string>
|
||||
<string name="content_description_contact_remove_field">Remove field</string>
|
||||
<string name="content_description_contacts_list_filters">Show contacts list filters</string>
|
||||
<string name="content_description_contact_create">Create a contact</string>
|
||||
<string name="content_description_join_conference">Join the conference</string>
|
||||
<string name="content_description_carddav_delete">Delete this CardDAV configuration</string>
|
||||
<string name="content_description_carddav_save">Save CardDAV configuration</string>
|
||||
<string name="content_description_ldap_delete">Delete this LDAP configuration</string>
|
||||
<string name="content_description_ldap_save">Save LDAP configuration</string>
|
||||
<string name="content_description_play_call_recording">Plays the call recording</string>
|
||||
</resources>
|
||||
|
|
@ -807,6 +807,7 @@
|
|||
<string name="content_description_chat_bubble_forward">This message was forwarded from another conversation</string>
|
||||
<string name="content_description_chat_bubble_delivery_status">Click to have delivery status</string>
|
||||
<string name="content_description_chat_bubble_toggle_voice_message_play_pause">Plays/pauses the voice message playback</string>
|
||||
<string name="content_description_chat_remove_attachment">Remove this file from attachments</string>
|
||||
<string name="content_description_chat_remove_attachments">Close attachments</string>
|
||||
<string name="content_description_chat_muted">Conversation has been silenced</string>
|
||||
<string name="content_description_chat_ephemeral_enabled">Ephemeral messages are enabled</string>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue