mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-25 03:11:10 +01:00
Convert AttachmentTable and models to kotlin.
This commit is contained in:
committed by
Alex Hart
parent
888a40a5c4
commit
3554f82ea3
@@ -77,7 +77,7 @@ object MediaIntentFactory {
|
||||
leftIsRecent,
|
||||
allMediaInRail = allMediaInRail,
|
||||
sorting = MediaTable.Sorting.Newest,
|
||||
isVideoGif = attachment.isVideoGif,
|
||||
isVideoGif = attachment.videoGif,
|
||||
sharedElementArgs = SharedElementArgs(
|
||||
attachment.width,
|
||||
attachment.height,
|
||||
|
||||
@@ -31,8 +31,8 @@ class MediaPreviewV2Adapter(fragment: Fragment) : FragmentStateAdapter(fragment)
|
||||
MediaPreviewFragment.DATA_URI to attachment.uri,
|
||||
MediaPreviewFragment.DATA_CONTENT_TYPE to contentType,
|
||||
MediaPreviewFragment.DATA_SIZE to attachment.size,
|
||||
MediaPreviewFragment.AUTO_PLAY to attachment.isVideoGif,
|
||||
MediaPreviewFragment.VIDEO_GIF to attachment.isVideoGif
|
||||
MediaPreviewFragment.AUTO_PLAY to attachment.videoGif,
|
||||
MediaPreviewFragment.VIDEO_GIF to attachment.videoGif
|
||||
)
|
||||
val fragment = if (MediaUtil.isVideo(contentType)) {
|
||||
VideoMediaPreviewFragment()
|
||||
|
||||
@@ -331,7 +331,7 @@ class MediaPreviewV2Fragment : LoggingFragment(R.layout.fragment_media_preview_v
|
||||
}
|
||||
|
||||
private fun bindMediaPreviewPlaybackControls(currentItem: MediaTable.MediaRecord, currentFragment: MediaPreviewFragment?) {
|
||||
val mediaType: MediaPreviewPlayerControlView.MediaMode = if (currentItem.attachment?.isVideoGif == true) {
|
||||
val mediaType: MediaPreviewPlayerControlView.MediaMode = if (currentItem.attachment?.videoGif == true) {
|
||||
MediaPreviewPlayerControlView.MediaMode.IMAGE
|
||||
} else {
|
||||
MediaPreviewPlayerControlView.MediaMode.fromString(currentItem.contentType)
|
||||
|
||||
@@ -127,8 +127,8 @@ fun MediaTable.MediaRecord.toMedia(): Media? {
|
||||
attachment.height,
|
||||
attachment.size,
|
||||
0,
|
||||
attachment.isBorderless,
|
||||
attachment.isVideoGif,
|
||||
attachment.borderless,
|
||||
attachment.videoGif,
|
||||
Optional.empty(),
|
||||
Optional.ofNullable(attachment.caption),
|
||||
Optional.empty()
|
||||
|
||||
Reference in New Issue
Block a user