A cheap attempt at a native Bluesky client for Android

SkeetView: show media on top of embedwithmedia

This is how it's done

+13 -9
+13 -9
app/src/main/java/industries/geesawra/monarch/SkeetView.kt
··· 192 192 } 193 193 194 194 is PostViewEmbedUnion.RecordWithMediaView -> run { 195 + val media = embed.value.media 196 + val mediaValue = when (media) { 197 + is RecordWithMediaViewMediaUnion.ExternalView -> PostViewEmbedUnion.ExternalView( 198 + media.value 199 + ) 200 + 201 + is RecordWithMediaViewMediaUnion.ImagesView -> PostViewEmbedUnion.ImagesView(media.value) 202 + is RecordWithMediaViewMediaUnion.Unknown -> PostViewEmbedUnion.Unknown(media.value) 203 + is RecordWithMediaViewMediaUnion.VideoView -> PostViewEmbedUnion.VideoView(media.value) 204 + } 205 + 206 + Embeds(context, false, mediaValue) 207 + 195 208 OutlinedCard( 196 209 modifier = Modifier.padding(top = 8.dp) 197 210 ) { ··· 349 362 modifier: Modifier = Modifier, 350 363 rv: RecordWithMediaView 351 364 ) { 352 - val media = rv.media 353 - val embed = when (media) { 354 - is RecordWithMediaViewMediaUnion.ExternalView -> PostViewEmbedUnion.ExternalView(media.value) 355 - is RecordWithMediaViewMediaUnion.ImagesView -> PostViewEmbedUnion.ImagesView(media.value) 356 - is RecordWithMediaViewMediaUnion.Unknown -> PostViewEmbedUnion.Unknown(media.value) 357 - is RecordWithMediaViewMediaUnion.VideoView -> PostViewEmbedUnion.VideoView(media.value) 358 - } 359 - 360 365 val rv = rv.record.record 361 366 val record = when (rv) { 362 367 is RecordViewRecordUnion.FeedGeneratorView -> null ··· 371 376 } 372 377 373 378 record?.let { 374 - record.embed = embed 375 379 SkeetView( 376 380 modifier = modifier, 377 381 viewModel = null,