1
0
Fork 0
mirror of https://github.com/anyproto/anytype-kotlin.git synced 2025-06-11 10:18:05 +09:00

#645: media placeholders (#703)

This commit is contained in:
Konstantin Ivanov 2020-08-19 15:48:29 +03:00 committed by GitHub
parent 44cfc0c821
commit ee097e37b0
Signed by: github
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 321 additions and 257 deletions

View file

@ -20,7 +20,7 @@ fun Block.Content.File.toPictureView(
indent: Int,
mode: BlockView.Mode
): BlockView = when (state) {
Block.Content.File.State.EMPTY -> BlockView.Picture.Placeholder(
Block.Content.File.State.EMPTY -> BlockView.MediaPlaceholder.Picture(
id = id,
indent = indent,
mode = mode
@ -54,7 +54,7 @@ fun Block.Content.File.toVideoView(
indent: Int,
mode: BlockView.Mode
): BlockView = when (state) {
Block.Content.File.State.EMPTY -> BlockView.Video.Placeholder(
Block.Content.File.State.EMPTY -> BlockView.MediaPlaceholder.File(
id = id,
indent = indent,
mode = mode
@ -88,7 +88,7 @@ fun Block.Content.File.toFileView(
indent: Int,
mode: BlockView.Mode
): BlockView = when (state) {
Block.Content.File.State.EMPTY -> BlockView.File.Placeholder(
Block.Content.File.State.EMPTY -> BlockView.MediaPlaceholder.File(
id = id,
indent = indent,
mode = mode

View file

@ -480,7 +480,7 @@ class DefaultBlockViewRenderer(
mode = if (mode == EditorMode.EDITING) BlockView.Mode.EDIT else BlockView.Mode.READ
)
}
} ?: BlockView.Bookmark.Placeholder(
} ?: BlockView.MediaPlaceholder.Bookmark(
id = block.id,
indent = indent,
mode = if (mode == EditorMode.EDITING) BlockView.Mode.EDIT else BlockView.Mode.READ

View file

@ -81,7 +81,7 @@ class MapperExtensionKtTest {
)
val expected = BlockView.File.Placeholder(id = id, indent = indent)
val expected = BlockView.MediaPlaceholder.File(id = id, indent = indent)
val actual = block.toFileView(id, urlBuilder, indent, mode)
assertEquals(expected, actual)
@ -220,7 +220,7 @@ class MapperExtensionKtTest {
)
val expected = BlockView.Picture.Placeholder(id = id, indent = indent)
val expected = BlockView.MediaPlaceholder.Picture(id = id, indent = indent)
val actual = block.toPictureView(id, urlBuilder, indent, mode)
assertEquals(expected, actual)
@ -409,7 +409,7 @@ class MapperExtensionKtTest {
type = type
)
val expected = BlockView.Video.Placeholder(
val expected = BlockView.MediaPlaceholder.File(
id = id,
indent = indent
)