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

DROID-2517 Analytics | ScreenSearch event (#1382)

This commit is contained in:
Konstantin Ivanov 2024-07-09 13:56:04 +02:00 committed by Evgenii Kozlov
parent f10460d494
commit 0d899ada9d
6 changed files with 33 additions and 10 deletions

View file

@ -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"

View file

@ -85,6 +85,7 @@ class HomeScreenFragment : BaseComposeFragment() {
onChangeWidgetView = vm::onChangeCurrentWidgetView,
onToggleExpandedWidgetState = vm::onToggleCollapsedWidgetState,
onSearchClicked = {
vm.onSearchIconClicked()
runCatching { navigation().openPageSearch() }
},
onLibraryClicked = {

View file

@ -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))
}

View file

@ -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()

View file

@ -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) },

View file

@ -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()
}
}