Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
8ea48aa
feat(chat): Group files uploaded together into one album message
mahibi Aug 26, 2026
69c6f07
fix(chat): Group files immediately while they are still uploading
mahibi Aug 26, 2026
f46d19d
fix(chat): Stop the generic-icon flash when a grouped upload syncs
mahibi Aug 26, 2026
a9cd825
fix(chat): Stop the generic icon overlaying the uploaded image
mahibi Aug 26, 2026
8e15d45
fix(chat): Fix crash from duplicate keys when a batch upload fails
mahibi Aug 26, 2026
a9542b6
fix(uploads): Don't crash when a picked file's uri access is revoked
mahibi Aug 26, 2026
c5650b4
fix(chat): Fix cancel doing nothing for uploads from a prior session
mahibi Aug 26, 2026
eb6633d
feat(chat): Add a swipeable, group-aware media viewer
mahibi Aug 26, 2026
cb6543c
fix(mediaviewer): Remove the swipe-to-close gesture from the viewer
mahibi Aug 26, 2026
5266e6b
fix(mediaviewer): Only autoplay the video the viewer was opened on
mahibi Aug 26, 2026
880cc74
fix(mediaviewer): Properly center the current thumbnail in the strip
mahibi Aug 26, 2026
7e89ace
feat(mediaviewer): Tap the shown item to toggle top bar and strip
mahibi Aug 26, 2026
af37a74
fix(mediaviewer): Fade controls in/out instead of sliding sideways
mahibi Aug 26, 2026
03d1f8c
fix(mediaviewer): Keep the video's own controller clear of the strip
mahibi Aug 26, 2026
4c36e56
feat(mediaviewer): Show sent date/time as an app bar subtitle
mahibi Aug 26, 2026
170e5d7
fix(chat): Give grouped media the same border as single images
mahibi Aug 26, 2026
299c91c
fix(mediaviewer): Make the top app bar semi-transparent
mahibi Aug 26, 2026
8224d38
feat(mediaviewer): Toggle the status/nav bars along with the controls
mahibi Aug 26, 2026
60a47bf
feat(mediaviewer): Migrate Shared Items gallery to the swipeable view…
mahibi Aug 26, 2026
7fc0b97
refactor(mediaviewer): Remove FullScreenImageActivity, now fully repl…
mahibi Aug 26, 2026
df86880
format code
mahibi Aug 26, 2026
00c75b1
fix(mediaviewer): Exclude non-image/video files from the chat-seeded …
mahibi Aug 26, 2026
8ef2053
fix(mediaviewer): Silence ReturnCount finding in toMediaViewerItem
mahibi Aug 26, 2026
83f605d
fix(mediaviewer): Cap the media viewer seed to avoid TransactionTooLa…
mahibi Aug 26, 2026
9cc8272
fix(mediaviewer): Show sticky date header for grouped media items
mahibi Aug 27, 2026
cc93b6d
simplify date handling for stickyHeader
mahibi Aug 27, 2026
e521a12
fix(mediaviewer): Stop stale spinner and video-source mismatch on swipe
mahibi Aug 27, 2026
7dec3b9
drop usage of referenceId as stableKey (fix IllegalArgumentException …
mahibi Aug 27, 2026
4174c06
fix(chat): Open media viewer for images/videos regardless of exact mi…
mahibi Aug 27, 2026
456e38f
fix(chat): Mark grouped media messages as read
mahibi Aug 27, 2026
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
10 changes: 5 additions & 5 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,6 @@
android:taskAffinity=".call"
android:theme="@style/AppTheme.CallLauncher" />

<activity
android:name=".fullscreenfile.FullScreenImageActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="@style/FullScreenImageTheme" />

<activity
android:name=".fullscreenfile.FullScreenMediaActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
Expand All @@ -226,6 +221,11 @@
android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="@style/FullScreenTextTheme" />

<activity
android:name=".mediaviewer.activities.MediaViewerActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="@style/FullScreenImageTheme" />

<activity
android:name=".shareditems.activities.SharedItemsActivity"
android:theme="@style/AppTheme" />
Expand Down
39 changes: 31 additions & 8 deletions app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ import com.nextcloud.talk.jobs.DownloadFileToCacheWorker
import com.nextcloud.talk.jobs.ShareOperationWorker
import com.nextcloud.talk.jobs.UploadAndShareFilesWorker
import com.nextcloud.talk.location.LocationPickerActivity
import com.nextcloud.talk.mediaviewer.activities.MediaViewerActivity
import com.nextcloud.talk.mediaviewer.model.capSeedAroundMessage
import com.nextcloud.talk.models.ExternalSignalingServer
import com.nextcloud.talk.models.domain.ConversationModel
import com.nextcloud.talk.models.json.capabilities.SpreedCapability
Expand Down Expand Up @@ -251,6 +253,7 @@ import java.time.ZoneId
import java.time.ZonedDateTime
import java.util.Date
import java.util.Locale
import java.util.UUID
import java.util.concurrent.ExecutionException
import javax.inject.Inject
import java.util.concurrent.CancellationException
Expand Down Expand Up @@ -1285,11 +1288,24 @@ class ChatActivity :
) {
lifecycleScope.launch {
val chatMessage = chatViewModel.getMessageById(messageId.toLong()).first()
FileViewerUtils(this@ChatActivity, conversationUser).openFile(
chatMessage,
openWhenDownloadState,
downloadState
)
val mimetype = chatMessage.fileParameters.mimetype
val fileViewerUtils = FileViewerUtils(this@ChatActivity, conversationUser)

val isViewableMedia = mimetype.startsWith(Mimetype.IMAGE_PREFIX) ||
mimetype.startsWith(Mimetype.VIDEO_PREFIX)
val seedItems = if (isViewableMedia) {
chatViewModel.mediaViewerSeed().flatMap { it.items }.capSeedAroundMessage(messageId.toLong())
} else {
emptyList()
}

if (isViewableMedia && seedItems.any { it.messageId == messageId.toLong() }) {
startActivity(
MediaViewerActivity.newIntent(this@ChatActivity, roomToken, seedItems, messageId.toLong())
)
} else {
fileViewerUtils.openFile(chatMessage, openWhenDownloadState, downloadState)
}
}
}

Expand Down Expand Up @@ -2760,6 +2776,7 @@ class ChatActivity :
}

private fun uploadFiles(files: MutableList<String>, caption: String = "", compressImages: Boolean = false) {
val uploadId = UUID.randomUUID().toString()
for (i in 0 until files.size) {
uploadFile(
fileUri = files[i],
Expand All @@ -2768,7 +2785,9 @@ class ChatActivity :
roomToken = roomToken,
replyToMessageId = getReplyToMessageId(),
displayName = currentConversation?.displayName!!,
compressImages = compressImages
compressImages = compressImages,
uploadId = uploadId,
order = i + 1
)
}
}
Expand Down Expand Up @@ -4159,7 +4178,9 @@ class ChatActivity :
roomToken: String = "",
replyToMessageId: Int? = null,
displayName: String,
compressImages: Boolean = false
compressImages: Boolean = false,
uploadId: String? = null,
order: Int = 1
) {
chatViewModel.uploadFile(
fileUri,
Expand All @@ -4168,7 +4189,9 @@ class ChatActivity :
roomToken,
replyToMessageId,
displayName,
compressImages
compressImages,
uploadId,
order
)
cancelReply()
}
Expand Down
Loading
Loading