refactor(feeds): push content warning into ZoomableContentView per media
Move the blurhash-aware sensitivity warning from feed card wrappers into
ZoomableContentView so every media item shows its own warning sized to
its own aspect ratio over its own blurhash. Grid posts now warn per
image instead of once over the whole grid.
- Add isSensitive to MediaUrl{Image,Video} (defaults to contentWarning != null)
- Populate isSensitive and contentWarning when building media in the
picture, video, and file-header feeds plus their display variants
- Drop the outer SensitivityWarning wrappers now handled inside
ZoomableContentView via SensitivityWarningOverBlurhash
This commit is contained in:
+6
-2
@@ -51,6 +51,7 @@ open class MediaUrlImage(
|
||||
dim: DimensionTag? = null,
|
||||
uri: String? = null,
|
||||
val contentWarning: String? = null,
|
||||
val isSensitive: Boolean = contentWarning != null,
|
||||
mimeType: String? = null,
|
||||
) : MediaUrlContent(url, description, hash, dim, blurhash, uri, mimeType)
|
||||
|
||||
@@ -62,11 +63,12 @@ class EncryptedMediaUrlImage(
|
||||
dim: DimensionTag? = null,
|
||||
uri: String? = null,
|
||||
contentWarning: String? = null,
|
||||
isSensitive: Boolean = contentWarning != null,
|
||||
mimeType: String? = null,
|
||||
val encryptionAlgo: String,
|
||||
val encryptionKey: ByteArray,
|
||||
val encryptionNonce: ByteArray,
|
||||
) : MediaUrlImage(url, description, hash, blurhash, dim, uri, contentWarning, mimeType)
|
||||
) : MediaUrlImage(url, description, hash, blurhash, dim, uri, contentWarning, isSensitive, mimeType)
|
||||
|
||||
@Immutable
|
||||
open class MediaUrlVideo(
|
||||
@@ -79,6 +81,7 @@ open class MediaUrlVideo(
|
||||
val authorName: String? = null,
|
||||
blurhash: String? = null,
|
||||
val contentWarning: String? = null,
|
||||
val isSensitive: Boolean = contentWarning != null,
|
||||
mimeType: String? = null,
|
||||
) : MediaUrlContent(url, description, hash, dim, blurhash, uri, mimeType)
|
||||
|
||||
@@ -93,11 +96,12 @@ class EncryptedMediaUrlVideo(
|
||||
authorName: String? = null,
|
||||
blurhash: String? = null,
|
||||
contentWarning: String? = null,
|
||||
isSensitive: Boolean = contentWarning != null,
|
||||
mimeType: String? = null,
|
||||
val encryptionAlgo: String,
|
||||
val encryptionKey: ByteArray,
|
||||
val encryptionNonce: ByteArray,
|
||||
) : MediaUrlVideo(url, description, hash, dim, uri, artworkUri, authorName, blurhash, contentWarning, mimeType)
|
||||
) : MediaUrlVideo(url, description, hash, dim, uri, artworkUri, authorName, blurhash, contentWarning, isSensitive, mimeType)
|
||||
|
||||
@Immutable
|
||||
abstract class MediaPreloadedContent(
|
||||
|
||||
Reference in New Issue
Block a user