Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public class IncomingPreviewMessageViewHolder extends PreviewMessageViewHolder {
public IncomingPreviewMessageViewHolder(View itemView, Object payload) {
super(itemView, payload);
binding = ItemCustomIncomingPreviewMessageBinding.bind(itemView);
setVideoPlayButton(binding.videoPlayButton);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public class OutcomingPreviewMessageViewHolder extends PreviewMessageViewHolder
public OutcomingPreviewMessageViewHolder(View itemView) {
super(itemView, null);
binding = ItemCustomOutcomingPreviewMessageBinding.bind(itemView);
setVideoPlayButton(binding.videoPlayButton);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ abstract class PreviewMessageViewHolder(itemView: View?, payload: Any?) :
open var progressBar: ProgressBar? = null
open var reactionsBinding: ReactionsInsideMessageBinding? = null
open var threadsBinding: ItemThreadTitleBinding? = null
open var videoPlayButton: ImageView? = null
var fileViewerUtils: FileViewerUtils? = null
var clickView: View? = null

Expand All @@ -104,6 +105,8 @@ abstract class PreviewMessageViewHolder(itemView: View?, payload: Any?) :
viewThemeUtils!!.platform.colorCircularProgressBar(progressBar!!, ColorRole.PRIMARY)
clickView = image
messageText.visibility = View.VISIBLE
val isVideoPreview = message.selectedIndividualHashMap?.get(KEY_MIMETYPE)?.startsWith("video/") == true
videoPlayButton?.visibility = if (isVideoPreview) View.VISIBLE else View.GONE
if (message.getCalculateMessageType() === ChatMessage.MessageType.SINGLE_NC_ATTACHMENT_MESSAGE) {
fileViewerUtils = FileViewerUtils(context!!, message.activeUser!!)
val fileName = message.selectedIndividualHashMap!![KEY_NAME]
Expand Down
18 changes: 18 additions & 0 deletions app/src/main/res/drawable/outline_play_circle_24.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!--
~ Nextcloud Talk - Android Client
~
~ SPDX-FileCopyrightText: 2025 Google LLC
~ SPDX-License-Identifier: Apache-2.0
-->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="24dp"
android:tint="#FFFFFF"
android:viewportHeight="960"
android:viewportWidth="960"
android:width="24dp">

<path android:fillColor="@android:color/white"
android:pathData="M380,660L660,480L380,300L380,660ZM480,880Q397,880 324,848.5Q251,817 197,763Q143,709 111.5,636Q80,563 80,480Q80,397 111.5,324Q143,251 197,197Q251,143 324,111.5Q397,80 480,80Q563,80 636,111.5Q709,143 763,197Q817,251 848.5,324Q880,397 880,480Q880,563 848.5,636Q817,709 763,763Q709,817 636,848.5Q563,880 480,880ZM480,800Q614,800 707,707Q800,614 800,480Q800,346 707,253Q614,160 480,160Q346,160 253,253Q160,346 160,480Q160,614 253,707Q346,800 480,800ZM480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Z"/>

</vector>
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@
android:layout_height="wrap_content"
android:layout_gravity="center"
android:visibility="gone" />

<ImageView
android:id="@+id/video_play_button"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:contentDescription="@string/play_video_message"
android:src="@drawable/outline_play_circle_24"
android:visibility="gone" />
</FrameLayout>

<com.google.android.material.card.MaterialCardView
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@
android:layout_height="wrap_content"
android:layout_gravity="center"
android:visibility="gone" />

<ImageView
android:id="@+id/video_play_button"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:contentDescription="@string/play_video_message"
android:src="@drawable/outline_play_circle_24"
android:visibility="gone" />
</FrameLayout>

<com.google.android.material.card.MaterialCardView
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -907,4 +907,5 @@ How to translate with transifex:
<string name="turn_on_background_blur">Turn on background blur</string>
<string name="turn_off_background_blur">Turn off background blur</string>
<string name="please_continue_the_login_process_in_the_browser">Please continue login in browser</string>
<string name="play_video_message">Play video message</string>
</resources>
Loading