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

DROID-2584 Protocol | Integrate 0.34.2 (#1292)

This commit is contained in:
Konstantin Ivanov 2024-06-12 22:18:43 +02:00 committed by konstantiniiv
parent fa871e2d39
commit bff3662bf0
8 changed files with 13 additions and 2 deletions

View file

@ -22,6 +22,7 @@ object WidgetAnalytics {
const val WIDGET_LAYOUT_LIST = "List"
const val WIDGET_LAYOUT_COMPACT_LIST = "CompactList"
const val WIDGET_LAYOUT_LINK = "Link"
const val WIDGET_LAYOUT_VIEW = "View"
const val WIDGET_SOURCE_FAVORITES = "Favorites"
const val WIDGET_SOURCE_RECENT = "Recent"

View file

@ -379,7 +379,7 @@ data class Block(
val activeView: Id? = null
) : Content() {
enum class Layout {
TREE, LINK, LIST, COMPACT_LIST
TREE, LINK, LIST, COMPACT_LIST, VIEW
}
}
}

View file

@ -1,5 +1,5 @@
[versions]
middlewareVersion = "v0.34.1"
middlewareVersion = "v0.34.2"
kotlinVersion = '1.9.22'
androidxCoreVersion = "1.13.0"

View file

@ -427,6 +427,7 @@ fun MBlock.toCoreWidget(): Block.Content.Widget {
MWidgetLayout.Tree -> Block.Content.Widget.Layout.TREE
MWidgetLayout.List -> Block.Content.Widget.Layout.LIST
MWidgetLayout.CompactList -> Block.Content.Widget.Layout.COMPACT_LIST
MWidgetLayout.View -> Block.Content.Widget.Layout.VIEW
},
limit = content.limit,
activeView = content.viewId.ifEmpty { null }

View file

@ -508,6 +508,7 @@ fun Block.Content.Widget.Layout.mw() : MWidgetLayout = when(this) {
Block.Content.Widget.Layout.LINK -> MWidgetLayout.Link
Block.Content.Widget.Layout.LIST -> MWidgetLayout.List
Block.Content.Widget.Layout.COMPACT_LIST -> MWidgetLayout.CompactList
Block.Content.Widget.Layout.VIEW -> MWidgetLayout.View
}
fun NetworkMode.toMiddlewareModel(): MNetworkMode = when (this) {

View file

@ -1488,6 +1488,9 @@ fun CoroutineScope.sendChangeWidgetLayoutEvent(
Block.Content.Widget.Layout.COMPACT_LIST -> {
put(WidgetAnalytics.LAYOUT, WidgetAnalytics.WIDGET_LAYOUT_COMPACT_LIST)
}
Block.Content.Widget.Layout.VIEW -> {
put(WidgetAnalytics.LAYOUT, WidgetAnalytics.WIDGET_LAYOUT_VIEW)
}
}
if (isInEditMode)
put(WidgetAnalytics.CONTEXT, WidgetAnalytics.CONTEXT_EDITOR)

View file

@ -162,6 +162,10 @@ fun List<Block>.parseWidgets(
)
)
}
Block.Content.Widget.Layout.VIEW -> {
}
}
}
}

View file

@ -568,6 +568,7 @@ message Block {
Tree = 1;
List = 2;
CompactList = 3;
View = 4;
}
}
}