Compare commits
1 Commits
develop
...
bugfix/eri
Author | SHA1 | Date | |
---|---|---|---|
|
92322aa4c6 |
@ -2008,7 +2008,7 @@ class TimelineFragment @Inject constructor(
|
|||||||
activity = requireActivity(),
|
activity = requireActivity(),
|
||||||
roomId = timelineArgs.roomId,
|
roomId = timelineArgs.roomId,
|
||||||
mediaData = mediaData,
|
mediaData = mediaData,
|
||||||
view = view
|
view = view,
|
||||||
) { pairs ->
|
) { pairs ->
|
||||||
pairs.add(Pair(views.roomToolbar, ViewCompat.getTransitionName(views.roomToolbar) ?: ""))
|
pairs.add(Pair(views.roomToolbar, ViewCompat.getTransitionName(views.roomToolbar) ?: ""))
|
||||||
pairs.add(Pair(views.composerLayout, ViewCompat.getTransitionName(views.composerLayout) ?: ""))
|
pairs.add(Pair(views.composerLayout, ViewCompat.getTransitionName(views.composerLayout) ?: ""))
|
||||||
|
@ -515,6 +515,7 @@ class MessageItemFactory @Inject constructor(
|
|||||||
filename = messageContent.body,
|
filename = messageContent.body,
|
||||||
mimeType = messageContent.mimeType,
|
mimeType = messageContent.mimeType,
|
||||||
url = messageContent.getFileUrl(),
|
url = messageContent.getFileUrl(),
|
||||||
|
filesize = messageContent.info?.size,
|
||||||
elementToDecrypt = messageContent.encryptedFileInfo?.toElementToDecrypt(),
|
elementToDecrypt = messageContent.encryptedFileInfo?.toElementToDecrypt(),
|
||||||
height = messageContent.info?.height,
|
height = messageContent.info?.height,
|
||||||
maxHeight = maxHeight,
|
maxHeight = maxHeight,
|
||||||
@ -557,6 +558,7 @@ class MessageItemFactory @Inject constructor(
|
|||||||
filename = messageContent.body,
|
filename = messageContent.body,
|
||||||
mimeType = messageContent.mimeType,
|
mimeType = messageContent.mimeType,
|
||||||
url = messageContent.videoInfo?.getThumbnailUrl(),
|
url = messageContent.videoInfo?.getThumbnailUrl(),
|
||||||
|
filesize = messageContent.videoInfo?.size,
|
||||||
elementToDecrypt = messageContent.videoInfo?.thumbnailFile?.toElementToDecrypt(),
|
elementToDecrypt = messageContent.videoInfo?.thumbnailFile?.toElementToDecrypt(),
|
||||||
height = messageContent.videoInfo?.height,
|
height = messageContent.videoInfo?.height,
|
||||||
maxHeight = maxHeight,
|
maxHeight = maxHeight,
|
||||||
@ -570,6 +572,7 @@ class MessageItemFactory @Inject constructor(
|
|||||||
filename = messageContent.body,
|
filename = messageContent.body,
|
||||||
mimeType = messageContent.mimeType,
|
mimeType = messageContent.mimeType,
|
||||||
url = messageContent.getFileUrl(),
|
url = messageContent.getFileUrl(),
|
||||||
|
filesize = messageContent.videoInfo?.size,
|
||||||
elementToDecrypt = messageContent.encryptedFileInfo?.toElementToDecrypt(),
|
elementToDecrypt = messageContent.encryptedFileInfo?.toElementToDecrypt(),
|
||||||
thumbnailMediaData = thumbnailData
|
thumbnailMediaData = thumbnailData
|
||||||
)
|
)
|
||||||
|
@ -36,6 +36,7 @@ fun TimelineEvent.buildImageContentRendererData(maxHeight: Int): ImageContentRen
|
|||||||
filename = messageImageContent.body,
|
filename = messageImageContent.body,
|
||||||
mimeType = messageImageContent.mimeType,
|
mimeType = messageImageContent.mimeType,
|
||||||
url = messageImageContent.getFileUrl(),
|
url = messageImageContent.getFileUrl(),
|
||||||
|
filesize = messageImageContent.info?.size,
|
||||||
elementToDecrypt = messageImageContent.encryptedFileInfo?.toElementToDecrypt(),
|
elementToDecrypt = messageImageContent.encryptedFileInfo?.toElementToDecrypt(),
|
||||||
height = messageImageContent.info?.height,
|
height = messageImageContent.info?.height,
|
||||||
maxHeight = maxHeight,
|
maxHeight = maxHeight,
|
||||||
@ -52,6 +53,7 @@ fun TimelineEvent.buildImageContentRendererData(maxHeight: Int): ImageContentRen
|
|||||||
filename = messageVideoContent.body,
|
filename = messageVideoContent.body,
|
||||||
mimeType = videoInfo?.thumbnailInfo?.mimeType,
|
mimeType = videoInfo?.thumbnailInfo?.mimeType,
|
||||||
url = videoInfo?.getThumbnailUrl(),
|
url = videoInfo?.getThumbnailUrl(),
|
||||||
|
filesize = messageVideoContent.videoInfo?.size,
|
||||||
elementToDecrypt = videoInfo?.thumbnailFile?.toElementToDecrypt(),
|
elementToDecrypt = videoInfo?.thumbnailFile?.toElementToDecrypt(),
|
||||||
height = videoInfo?.thumbnailInfo?.height,
|
height = videoInfo?.thumbnailInfo?.height,
|
||||||
maxHeight = maxHeight,
|
maxHeight = maxHeight,
|
||||||
|
@ -57,6 +57,7 @@ interface AttachmentData : Parcelable {
|
|||||||
val filename: String
|
val filename: String
|
||||||
val mimeType: String?
|
val mimeType: String?
|
||||||
val url: String?
|
val url: String?
|
||||||
|
val filesize: Long?
|
||||||
val elementToDecrypt: ElementToDecrypt?
|
val elementToDecrypt: ElementToDecrypt?
|
||||||
|
|
||||||
// If true will load non mxc url, be careful to set it only for attachments sent by you
|
// If true will load non mxc url, be careful to set it only for attachments sent by you
|
||||||
@ -79,6 +80,7 @@ class ImageContentRenderer @Inject constructor(
|
|||||||
override val filename: String,
|
override val filename: String,
|
||||||
override val mimeType: String?,
|
override val mimeType: String?,
|
||||||
override val url: String?,
|
override val url: String?,
|
||||||
|
override val filesize: Long?,
|
||||||
override val elementToDecrypt: ElementToDecrypt?,
|
override val elementToDecrypt: ElementToDecrypt?,
|
||||||
val height: Int?,
|
val height: Int?,
|
||||||
val maxHeight: Int,
|
val maxHeight: Int,
|
||||||
@ -254,7 +256,6 @@ class ImageContentRenderer @Inject constructor(
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.onlyRetrieveFromCache(true)
|
|
||||||
.fitCenter()
|
.fitCenter()
|
||||||
.into(imageView)
|
.into(imageView)
|
||||||
}
|
}
|
||||||
|
@ -63,6 +63,7 @@ class RoomEventsAttachmentProvider(
|
|||||||
filename = content.body,
|
filename = content.body,
|
||||||
mimeType = content.mimeType,
|
mimeType = content.mimeType,
|
||||||
url = content.getFileUrl(),
|
url = content.getFileUrl(),
|
||||||
|
filesize = content.info?.size,
|
||||||
elementToDecrypt = content.encryptedFileInfo?.toElementToDecrypt(),
|
elementToDecrypt = content.encryptedFileInfo?.toElementToDecrypt(),
|
||||||
maxHeight = -1,
|
maxHeight = -1,
|
||||||
maxWidth = -1,
|
maxWidth = -1,
|
||||||
@ -90,6 +91,7 @@ class RoomEventsAttachmentProvider(
|
|||||||
filename = content.body,
|
filename = content.body,
|
||||||
mimeType = content.mimeType,
|
mimeType = content.mimeType,
|
||||||
url = content.getFileUrl(),
|
url = content.getFileUrl(),
|
||||||
|
filesize = content.info?.size,
|
||||||
elementToDecrypt = content.encryptedFileInfo?.toElementToDecrypt(),
|
elementToDecrypt = content.encryptedFileInfo?.toElementToDecrypt(),
|
||||||
maxHeight = -1,
|
maxHeight = -1,
|
||||||
maxWidth = -1,
|
maxWidth = -1,
|
||||||
@ -117,6 +119,7 @@ class RoomEventsAttachmentProvider(
|
|||||||
filename = content.body,
|
filename = content.body,
|
||||||
mimeType = content.mimeType,
|
mimeType = content.mimeType,
|
||||||
url = content.videoInfo?.getThumbnailUrl(),
|
url = content.videoInfo?.getThumbnailUrl(),
|
||||||
|
filesize = content.videoInfo?.size,
|
||||||
elementToDecrypt = content.videoInfo?.thumbnailFile?.toElementToDecrypt(),
|
elementToDecrypt = content.videoInfo?.thumbnailFile?.toElementToDecrypt(),
|
||||||
height = content.videoInfo?.height,
|
height = content.videoInfo?.height,
|
||||||
maxHeight = -1,
|
maxHeight = -1,
|
||||||
@ -131,6 +134,7 @@ class RoomEventsAttachmentProvider(
|
|||||||
url = content.getFileUrl(),
|
url = content.getFileUrl(),
|
||||||
elementToDecrypt = content.encryptedFileInfo?.toElementToDecrypt(),
|
elementToDecrypt = content.encryptedFileInfo?.toElementToDecrypt(),
|
||||||
thumbnailMediaData = thumbnailData,
|
thumbnailMediaData = thumbnailData,
|
||||||
|
filesize = content.videoInfo?.size,
|
||||||
allowNonMxcUrls = it.root.sendState.isSending()
|
allowNonMxcUrls = it.root.sendState.isSending()
|
||||||
)
|
)
|
||||||
AttachmentInfo.Video(
|
AttachmentInfo.Video(
|
||||||
@ -154,7 +158,7 @@ class RoomEventsAttachmentProvider(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getTimelineEventAtPosition(position: Int): TimelineEvent? {
|
override fun getTimelineEventAtPosition(position: Int): TimelineEvent {
|
||||||
return getItem(position)
|
return getItem(position)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,6 +51,7 @@ class VideoContentRenderer @Inject constructor(
|
|||||||
override val filename: String,
|
override val filename: String,
|
||||||
override val mimeType: String?,
|
override val mimeType: String?,
|
||||||
override val url: String?,
|
override val url: String?,
|
||||||
|
override val filesize: Long?,
|
||||||
override val elementToDecrypt: ElementToDecrypt?,
|
override val elementToDecrypt: ElementToDecrypt?,
|
||||||
val thumbnailMediaData: ImageContentRenderer.Data,
|
val thumbnailMediaData: ImageContentRenderer.Data,
|
||||||
// If true will load non mxc url, be careful to set it only for video sent by you
|
// If true will load non mxc url, be careful to set it only for video sent by you
|
||||||
|
@ -76,6 +76,7 @@ import im.vector.app.features.matrixto.MatrixToBottomSheet
|
|||||||
import im.vector.app.features.matrixto.OriginOfMatrixTo
|
import im.vector.app.features.matrixto.OriginOfMatrixTo
|
||||||
import im.vector.app.features.media.AttachmentData
|
import im.vector.app.features.media.AttachmentData
|
||||||
import im.vector.app.features.media.BigImageViewerActivity
|
import im.vector.app.features.media.BigImageViewerActivity
|
||||||
|
import im.vector.app.features.media.ImageContentRenderer
|
||||||
import im.vector.app.features.media.VectorAttachmentViewerActivity
|
import im.vector.app.features.media.VectorAttachmentViewerActivity
|
||||||
import im.vector.app.features.onboarding.OnboardingActivity
|
import im.vector.app.features.onboarding.OnboardingActivity
|
||||||
import im.vector.app.features.pin.PinActivity
|
import im.vector.app.features.pin.PinActivity
|
||||||
@ -539,14 +540,18 @@ class DefaultNavigator @Inject constructor(
|
|||||||
inMemory: List<AttachmentData>,
|
inMemory: List<AttachmentData>,
|
||||||
options: ((MutableList<Pair<View, String>>) -> Unit)?
|
options: ((MutableList<Pair<View, String>>) -> Unit)?
|
||||||
) {
|
) {
|
||||||
VectorAttachmentViewerActivity.newIntent(
|
val intent = VectorAttachmentViewerActivity.newIntent(
|
||||||
activity,
|
activity,
|
||||||
mediaData,
|
mediaData,
|
||||||
roomId,
|
roomId,
|
||||||
mediaData.eventId,
|
mediaData.eventId,
|
||||||
inMemory,
|
inMemory,
|
||||||
ViewCompat.getTransitionName(view)
|
ViewCompat.getTransitionName(view)
|
||||||
).let { intent ->
|
)
|
||||||
|
|
||||||
|
|
||||||
|
val shouldTransition = mediaData !is ImageContentRenderer.Data || (mediaData.filesize ?: 0) < 1000000
|
||||||
|
if (shouldTransition) {
|
||||||
val pairs = ArrayList<Pair<View, String>>()
|
val pairs = ArrayList<Pair<View, String>>()
|
||||||
activity.window.decorView.findViewById<View>(android.R.id.statusBarBackground)?.let {
|
activity.window.decorView.findViewById<View>(android.R.id.statusBarBackground)?.let {
|
||||||
pairs.add(Pair(it, Window.STATUS_BAR_BACKGROUND_TRANSITION_NAME))
|
pairs.add(Pair(it, Window.STATUS_BAR_BACKGROUND_TRANSITION_NAME))
|
||||||
@ -560,6 +565,8 @@ class DefaultNavigator @Inject constructor(
|
|||||||
|
|
||||||
val bundle = ActivityOptionsCompat.makeSceneTransitionAnimation(activity, *pairs.toTypedArray()).toBundle()
|
val bundle = ActivityOptionsCompat.makeSceneTransitionAnimation(activity, *pairs.toTypedArray()).toBundle()
|
||||||
activity.startActivity(intent, bundle)
|
activity.startActivity(intent, bundle)
|
||||||
|
} else {
|
||||||
|
activity.startActivity(intent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ class RoomUploadsMediaFragment @Inject constructor(
|
|||||||
roomId = state.roomId,
|
roomId = state.roomId,
|
||||||
mediaData = mediaData,
|
mediaData = mediaData,
|
||||||
view = view,
|
view = view,
|
||||||
inMemory = inMemory
|
inMemory = inMemory,
|
||||||
) { pairs ->
|
) { pairs ->
|
||||||
trickFindAppBar()?.let {
|
trickFindAppBar()?.let {
|
||||||
pairs.add(Pair(it, ViewCompat.getTransitionName(it) ?: ""))
|
pairs.add(Pair(it, ViewCompat.getTransitionName(it) ?: ""))
|
||||||
@ -129,11 +129,12 @@ class RoomUploadsMediaFragment @Inject constructor(
|
|||||||
filename = content.body,
|
filename = content.body,
|
||||||
mimeType = content.mimeType,
|
mimeType = content.mimeType,
|
||||||
url = content.getFileUrl(),
|
url = content.getFileUrl(),
|
||||||
|
filesize = content.info?.size,
|
||||||
elementToDecrypt = content.encryptedFileInfo?.toElementToDecrypt(),
|
elementToDecrypt = content.encryptedFileInfo?.toElementToDecrypt(),
|
||||||
maxHeight = -1,
|
maxHeight = -1,
|
||||||
maxWidth = -1,
|
maxWidth = -1,
|
||||||
width = null,
|
width = null,
|
||||||
height = null
|
height = null,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
is MessageVideoContent -> {
|
is MessageVideoContent -> {
|
||||||
@ -142,17 +143,19 @@ class RoomUploadsMediaFragment @Inject constructor(
|
|||||||
filename = content.body,
|
filename = content.body,
|
||||||
mimeType = content.mimeType,
|
mimeType = content.mimeType,
|
||||||
url = content.videoInfo?.getThumbnailUrl(),
|
url = content.videoInfo?.getThumbnailUrl(),
|
||||||
|
filesize = content.videoInfo?.size,
|
||||||
elementToDecrypt = content.videoInfo?.thumbnailFile?.toElementToDecrypt(),
|
elementToDecrypt = content.videoInfo?.thumbnailFile?.toElementToDecrypt(),
|
||||||
height = content.videoInfo?.height,
|
height = content.videoInfo?.height,
|
||||||
maxHeight = -1,
|
maxHeight = -1,
|
||||||
width = content.videoInfo?.width,
|
width = content.videoInfo?.width,
|
||||||
maxWidth = -1
|
maxWidth = -1,
|
||||||
)
|
)
|
||||||
VideoContentRenderer.Data(
|
VideoContentRenderer.Data(
|
||||||
eventId = it.eventId,
|
eventId = it.eventId,
|
||||||
filename = content.body,
|
filename = content.body,
|
||||||
mimeType = content.mimeType,
|
mimeType = content.mimeType,
|
||||||
url = content.getFileUrl(),
|
url = content.getFileUrl(),
|
||||||
|
filesize = content.videoInfo?.size,
|
||||||
elementToDecrypt = content.encryptedFileInfo?.toElementToDecrypt(),
|
elementToDecrypt = content.encryptedFileInfo?.toElementToDecrypt(),
|
||||||
thumbnailMediaData = thumbnailData
|
thumbnailMediaData = thumbnailData
|
||||||
)
|
)
|
||||||
@ -169,7 +172,7 @@ class RoomUploadsMediaFragment @Inject constructor(
|
|||||||
roomId = state.roomId,
|
roomId = state.roomId,
|
||||||
mediaData = mediaData,
|
mediaData = mediaData,
|
||||||
view = view,
|
view = view,
|
||||||
inMemory = inMemory
|
inMemory = inMemory,
|
||||||
) { pairs ->
|
) { pairs ->
|
||||||
trickFindAppBar()?.let {
|
trickFindAppBar()?.let {
|
||||||
pairs.add(Pair(it, ViewCompat.getTransitionName(it) ?: ""))
|
pairs.add(Pair(it, ViewCompat.getTransitionName(it) ?: ""))
|
||||||
|
@ -111,11 +111,12 @@ class UploadsMediaController @Inject constructor(
|
|||||||
filename = messageContent.body,
|
filename = messageContent.body,
|
||||||
url = messageContent.getFileUrl(),
|
url = messageContent.getFileUrl(),
|
||||||
mimeType = messageContent.mimeType,
|
mimeType = messageContent.mimeType,
|
||||||
|
filesize = messageContent.info?.size,
|
||||||
elementToDecrypt = messageContent.encryptedFileInfo?.toElementToDecrypt(),
|
elementToDecrypt = messageContent.encryptedFileInfo?.toElementToDecrypt(),
|
||||||
height = messageContent.info?.height,
|
height = messageContent.info?.height,
|
||||||
maxHeight = itemSize,
|
maxHeight = itemSize,
|
||||||
width = messageContent.info?.width,
|
width = messageContent.info?.width,
|
||||||
maxWidth = itemSize
|
maxWidth = itemSize,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -127,11 +128,12 @@ class UploadsMediaController @Inject constructor(
|
|||||||
filename = messageContent.body,
|
filename = messageContent.body,
|
||||||
mimeType = messageContent.mimeType,
|
mimeType = messageContent.mimeType,
|
||||||
url = messageContent.videoInfo?.getThumbnailUrl(),
|
url = messageContent.videoInfo?.getThumbnailUrl(),
|
||||||
|
filesize = messageContent.videoInfo?.size,
|
||||||
elementToDecrypt = messageContent.videoInfo?.thumbnailFile?.toElementToDecrypt(),
|
elementToDecrypt = messageContent.videoInfo?.thumbnailFile?.toElementToDecrypt(),
|
||||||
height = messageContent.videoInfo?.height,
|
height = messageContent.videoInfo?.height,
|
||||||
maxHeight = itemSize,
|
maxHeight = itemSize,
|
||||||
width = messageContent.videoInfo?.width,
|
width = messageContent.videoInfo?.width,
|
||||||
maxWidth = itemSize
|
maxWidth = itemSize,
|
||||||
)
|
)
|
||||||
|
|
||||||
return VideoContentRenderer.Data(
|
return VideoContentRenderer.Data(
|
||||||
@ -139,6 +141,7 @@ class UploadsMediaController @Inject constructor(
|
|||||||
filename = messageContent.body,
|
filename = messageContent.body,
|
||||||
mimeType = messageContent.mimeType,
|
mimeType = messageContent.mimeType,
|
||||||
url = messageContent.getFileUrl(),
|
url = messageContent.getFileUrl(),
|
||||||
|
filesize = messageContent.videoInfo?.size,
|
||||||
elementToDecrypt = messageContent.encryptedFileInfo?.toElementToDecrypt(),
|
elementToDecrypt = messageContent.encryptedFileInfo?.toElementToDecrypt(),
|
||||||
thumbnailMediaData = thumbnailData
|
thumbnailMediaData = thumbnailData
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user