Media: clean up code

This commit is contained in:
ganfra
2023-06-06 22:18:13 +02:00
parent 730f50a433
commit e3457fb594
5 changed files with 8 additions and 9 deletions

View File

@@ -26,6 +26,4 @@ import kotlinx.parcelize.Parcelize
data class LocalMedia(
val uri: Uri,
val info: MediaInfo,
) : Parcelable {
}
) : Parcelable

View File

@@ -22,7 +22,7 @@ import io.element.android.libraries.matrix.api.media.MediaFile
interface LocalMediaFactory {
/**
* This method will create a [LocalMedia] with the given [MediaFile] and [MediaInfo]
* This method will create a [LocalMedia] with the given [MediaFile] and [MediaInfo].
*/
fun createFromMediaFile(
mediaFile: MediaFile,

View File

@@ -64,7 +64,6 @@ import io.element.android.libraries.designsystem.theme.components.TopAppBar
import io.element.android.libraries.designsystem.utils.rememberSnackbarHostState
import io.element.android.libraries.matrix.api.media.MediaSource
import io.element.android.libraries.matrix.ui.media.MediaRequestData
import io.element.android.libraries.ui.strings.R.*
import kotlinx.coroutines.delay
import io.element.android.libraries.ui.strings.R as StringR
@@ -181,7 +180,7 @@ private fun MediaViewerTopBar(
eventSink(MediaViewerEvents.OpenWith)
},
) {
Icon(imageVector = Icons.Default.OpenInNew, contentDescription = stringResource(id = string.action_share))
Icon(imageVector = Icons.Default.OpenInNew, contentDescription = stringResource(id = StringR.string.action_open_with))
}
IconButton(
enabled = actionsEnabled,
@@ -189,7 +188,7 @@ private fun MediaViewerTopBar(
eventSink(MediaViewerEvents.SaveOnDisk)
},
) {
Icon(imageVector = Icons.Default.Download, contentDescription = stringResource(id = string.action_save))
Icon(imageVector = Icons.Default.Download, contentDescription = stringResource(id = StringR.string.action_save))
}
IconButton(
enabled = actionsEnabled,
@@ -197,7 +196,7 @@ private fun MediaViewerTopBar(
eventSink(MediaViewerEvents.Share)
},
) {
Icon(imageVector = Icons.Default.Share, contentDescription = stringResource(id = string.action_share))
Icon(imageVector = Icons.Default.Share, contentDescription = stringResource(id = StringR.string.action_share))
}
}
)

View File

@@ -33,7 +33,8 @@ interface MatrixMediaLoader {
/**
* @param source to fetch the data for.
* @param mimeType: optional mime type
* @param mimeType: optional mime type.
* @param body: optional body which will be used to name the file.
* @return a [Result] of [MediaFile]
*/
suspend fun downloadMediaFile(source: MediaSource, mimeType: String?, body: String?): Result<MediaFile>

View File

@@ -34,6 +34,7 @@
<string name="action_no">"No"</string>
<string name="action_not_now">"Not now"</string>
<string name="action_ok">"OK"</string>
<string name="action_open_with">"Open with"</string>
<string name="action_quick_reply">"Quick reply"</string>
<string name="action_quote">"Quote"</string>
<string name="action_remove">"Remove"</string>