diff --git a/analytics/src/main/java/com/anytypeio/anytype/analytics/base/EventsDictionary.kt b/analytics/src/main/java/com/anytypeio/anytype/analytics/base/EventsDictionary.kt index bc6b27f09f..928298680a 100644 --- a/analytics/src/main/java/com/anytypeio/anytype/analytics/base/EventsDictionary.kt +++ b/analytics/src/main/java/com/anytypeio/anytype/analytics/base/EventsDictionary.kt @@ -45,10 +45,7 @@ object EventsDictionary { const val deletionWarningShow = "ShowDeletionWarning" const val keychainPhraseScreenShow = "ScreenKeychain" const val relationsScreenShow = "ScreenObjectRelation" - const val personalisationSettingsShow = "ScreenSettingsPersonal" const val wallpaperScreenShow = "ScreenSettingsWallpaper" - const val accountDataSettingsShow = "ScreenSettingsAccount" - const val appearanceScreenShow = "ScreenSettingsAppearance" const val screenSettingsStorage = "ScreenSettingsStorageIndex" const val screenSettingsStorageManage = "ScreenSettingsStorageManager" const val screenSettingsSpaceStorageManager = "ScreenSettingsSpaceStorageManager" @@ -191,7 +188,6 @@ object EventsDictionary { // Sharing spaces const val shareSpace = "ShareSpace" const val screenSettingsSpaceShare = "ScreenSettingsSpaceShare" - const val clickShareSpaceCopyLink = "ClickShareSpaceCopyLink" const val screenStopShare = "ScreenStopShare" const val stopSpaceShare = "StopSpaceShare" const val clickSettingsSpaceShare = "ClickSettingsSpaceShare" @@ -204,7 +200,6 @@ object EventsDictionary { const val removeSpaceMember = "RemoveSpaceMember" const val screenInviteRequest = "ScreenInviteRequest" const val screenRequestSent = "ScreenRequestSent" - const val screenSettingsSpaceList = "ScreenSettingsSpaceList" const val screenSettingsSpaceMembers = "ScreenSettingsSpaceMembers" const val screenLeaveSpace = "ScreenLeaveSpace" const val leaveSpace = "LeaveSpace" diff --git a/app/src/main/java/com/anytypeio/anytype/ui/home/HomeScreenFragment.kt b/app/src/main/java/com/anytypeio/anytype/ui/home/HomeScreenFragment.kt index cb8628f004..d18f357fa6 100644 --- a/app/src/main/java/com/anytypeio/anytype/ui/home/HomeScreenFragment.kt +++ b/app/src/main/java/com/anytypeio/anytype/ui/home/HomeScreenFragment.kt @@ -85,6 +85,7 @@ class HomeScreenFragment : BaseComposeFragment() { onChangeWidgetView = vm::onChangeCurrentWidgetView, onToggleExpandedWidgetState = vm::onToggleCollapsedWidgetState, onSearchClicked = { + vm.onSearchIconClicked() runCatching { navigation().openPageSearch() } }, onLibraryClicked = { diff --git a/presentation/src/main/java/com/anytypeio/anytype/presentation/editor/EditorViewModel.kt b/presentation/src/main/java/com/anytypeio/anytype/presentation/editor/EditorViewModel.kt index 2fb52c9eb6..52d5135162 100644 --- a/presentation/src/main/java/com/anytypeio/anytype/presentation/editor/EditorViewModel.kt +++ b/presentation/src/main/java/com/anytypeio/anytype/presentation/editor/EditorViewModel.kt @@ -7,7 +7,9 @@ import androidx.lifecycle.viewModelScope import com.anytypeio.anytype.analytics.base.Analytics import com.anytypeio.anytype.analytics.base.EventsDictionary import com.anytypeio.anytype.analytics.base.EventsDictionary.searchScreenShow +import com.anytypeio.anytype.analytics.base.EventsPropertiesKey import com.anytypeio.anytype.analytics.base.sendEvent +import com.anytypeio.anytype.analytics.props.Props import com.anytypeio.anytype.core_models.Block import com.anytypeio.anytype.core_models.Block.Content import com.anytypeio.anytype.core_models.Block.Prototype @@ -4313,7 +4315,8 @@ class EditorViewModel( viewModelScope.sendEvent( analytics = analytics, - eventName = searchScreenShow + eventName = searchScreenShow, + props = Props(mapOf(EventsPropertiesKey.route to EventsDictionary.Routes.navigation)) ) navigation.postValue(EventWrapper(AppNavigation.Command.OpenPageSearch)) } diff --git a/presentation/src/main/java/com/anytypeio/anytype/presentation/home/HomeScreenViewModel.kt b/presentation/src/main/java/com/anytypeio/anytype/presentation/home/HomeScreenViewModel.kt index 9aa2b06f66..f608c80ef8 100644 --- a/presentation/src/main/java/com/anytypeio/anytype/presentation/home/HomeScreenViewModel.kt +++ b/presentation/src/main/java/com/anytypeio/anytype/presentation/home/HomeScreenViewModel.kt @@ -5,6 +5,9 @@ import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.viewModelScope import com.anytypeio.anytype.analytics.base.Analytics import com.anytypeio.anytype.analytics.base.EventsDictionary +import com.anytypeio.anytype.analytics.base.EventsPropertiesKey +import com.anytypeio.anytype.analytics.base.sendEvent +import com.anytypeio.anytype.analytics.props.Props import com.anytypeio.anytype.core_models.Block import com.anytypeio.anytype.core_models.Config import com.anytypeio.anytype.core_models.DVFilter @@ -1623,6 +1626,14 @@ class HomeScreenViewModel( } } + fun onSearchIconClicked() { + viewModelScope.sendEvent( + analytics = analytics, + eventName = EventsDictionary.searchScreenShow, + props = Props(mapOf(EventsPropertiesKey.route to EventsDictionary.Routes.navigation)) + ) + } + sealed class Navigation { data class OpenObject(val ctx: Id, val space: Id) : Navigation() data class OpenSet(val ctx: Id, val space: Id) : Navigation() diff --git a/presentation/src/main/java/com/anytypeio/anytype/presentation/sets/ObjectSetViewModel.kt b/presentation/src/main/java/com/anytypeio/anytype/presentation/sets/ObjectSetViewModel.kt index 49ceb5aa14..008b82df55 100644 --- a/presentation/src/main/java/com/anytypeio/anytype/presentation/sets/ObjectSetViewModel.kt +++ b/presentation/src/main/java/com/anytypeio/anytype/presentation/sets/ObjectSetViewModel.kt @@ -5,6 +5,9 @@ import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.anytypeio.anytype.analytics.base.Analytics import com.anytypeio.anytype.analytics.base.EventsDictionary +import com.anytypeio.anytype.analytics.base.EventsPropertiesKey +import com.anytypeio.anytype.analytics.base.sendEvent +import com.anytypeio.anytype.analytics.props.Props import com.anytypeio.anytype.analytics.props.Props.Companion.OBJ_TYPE_CUSTOM import com.anytypeio.anytype.core_models.DVViewer import com.anytypeio.anytype.core_models.DVViewerCardSize @@ -1655,6 +1658,11 @@ class ObjectSetViewModel( } fun onSearchButtonClicked() { + viewModelScope.sendEvent( + analytics = analytics, + eventName = EventsDictionary.searchScreenShow, + props = Props(mapOf(EventsPropertiesKey.route to EventsDictionary.Routes.navigation)) + ) viewModelScope.launch { closeBlock.async(context).fold( onSuccess = { dispatch(AppNavigation.Command.OpenPageSearch) }, diff --git a/presentation/src/main/java/com/anytypeio/anytype/presentation/widgets/collection/CollectionViewModel.kt b/presentation/src/main/java/com/anytypeio/anytype/presentation/widgets/collection/CollectionViewModel.kt index f73689651b..fd65b8f86f 100644 --- a/presentation/src/main/java/com/anytypeio/anytype/presentation/widgets/collection/CollectionViewModel.kt +++ b/presentation/src/main/java/com/anytypeio/anytype/presentation/widgets/collection/CollectionViewModel.kt @@ -824,6 +824,11 @@ class CollectionViewModel( } fun onSearchClicked() { + viewModelScope.sendEvent( + analytics = analytics, + eventName = EventsDictionary.searchScreenShow, + props = Props(mapOf(EventsPropertiesKey.route to EventsDictionary.Routes.navigation)) + ) launch { commands.emit(Command.ToSearch) } @@ -976,10 +981,10 @@ class CollectionViewModel( data class OpenCollection(val subscription: Subscription, val space: Id) : Command() data class LaunchObjectSet(val target: Id, val space: Id) : Command() - object ToDesktop : Command() - object ToSearch : Command() - object SelectSpace : Command() - object Exit : Command() + data object ToDesktop : Command() + data object ToSearch : Command() + data object SelectSpace : Command() + data object Exit : Command() } }