From 7e40b933c056e71bf5bfb3b17200e726aa1b01d0 Mon Sep 17 00:00:00 2001 From: bmarty Date: Mon, 11 Dec 2023 00:03:18 +0000 Subject: [PATCH] Sync analytics plan --- .../app/features/analytics/plan/Composer.kt | 32 ++++++++++ .../features/analytics/plan/MobileScreen.kt | 20 ++++++ .../features/analytics/plan/PollCreation.kt | 63 +++++++++++++++++++ .../app/features/analytics/plan/PollEnd.kt | 43 +++++++++++++ .../app/features/analytics/plan/PollVote.kt | 43 +++++++++++++ 5 files changed, 201 insertions(+) create mode 100644 vector/src/main/java/im/vector/app/features/analytics/plan/PollCreation.kt create mode 100644 vector/src/main/java/im/vector/app/features/analytics/plan/PollEnd.kt create mode 100644 vector/src/main/java/im/vector/app/features/analytics/plan/PollVote.kt diff --git a/vector/src/main/java/im/vector/app/features/analytics/plan/Composer.kt b/vector/src/main/java/im/vector/app/features/analytics/plan/Composer.kt index 79be8aae2b..a590ac168d 100644 --- a/vector/src/main/java/im/vector/app/features/analytics/plan/Composer.kt +++ b/vector/src/main/java/im/vector/app/features/analytics/plan/Composer.kt @@ -39,12 +39,43 @@ data class Composer( * sent event. */ val isReply: Boolean, + /** + * The type of the message. + */ + val messageType: MessageType, /** * Whether this message begins a new thread or not. */ val startsThread: Boolean? = null, ) : VectorAnalyticsEvent { + enum class MessageType { + /** + * A pin drop location message. + */ + LocationPin, + + /** + * A user current location message. + */ + LocationUser, + + /** + * A poll message. + */ + Poll, + + /** + * A text message. + */ + Text, + + /** + * A voice message. + */ + VoiceMessage, + } + override fun getName() = "Composer" override fun getProperties(): Map? { @@ -52,6 +83,7 @@ data class Composer( put("inThread", inThread) put("isEditing", isEditing) put("isReply", isReply) + put("messageType", messageType.name) startsThread?.let { put("startsThread", it) } }.takeIf { it.isNotEmpty() } } diff --git a/vector/src/main/java/im/vector/app/features/analytics/plan/MobileScreen.kt b/vector/src/main/java/im/vector/app/features/analytics/plan/MobileScreen.kt index 7ea41e2d78..59b53aaa89 100644 --- a/vector/src/main/java/im/vector/app/features/analytics/plan/MobileScreen.kt +++ b/vector/src/main/java/im/vector/app/features/analytics/plan/MobileScreen.kt @@ -38,6 +38,11 @@ data class MobileScreen( */ Breadcrumbs, + /** + * The screen shown to create a poll. + */ + CreatePollView, + /** * The screen shown to create a new (non-direct) room. */ @@ -58,6 +63,11 @@ data class MobileScreen( */ Dialpad, + /** + * The screen shown to edit a poll. + */ + EditPollView, + /** * The Favourites tab on mobile that lists your favourite people/rooms. */ @@ -88,6 +98,16 @@ data class MobileScreen( */ Invites, + /** + * The screen shown to share location. + */ + LocationSend, + + /** + * The screen shown to view a shared location. + */ + LocationView, + /** * The screen that displays the login flow (when the user already has an * account). diff --git a/vector/src/main/java/im/vector/app/features/analytics/plan/PollCreation.kt b/vector/src/main/java/im/vector/app/features/analytics/plan/PollCreation.kt new file mode 100644 index 0000000000..ebb7a3efd0 --- /dev/null +++ b/vector/src/main/java/im/vector/app/features/analytics/plan/PollCreation.kt @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2021 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package im.vector.app.features.analytics.plan + +import im.vector.app.features.analytics.itf.VectorAnalyticsEvent + +// GENERATED FILE, DO NOT EDIT. FOR MORE INFORMATION VISIT +// https://github.com/matrix-org/matrix-analytics-events/ + +/** + * Triggered when a poll is created or edited. + */ +data class PollCreation( + /** + * Whether this poll has been created or edited. + */ + val action: Action, + /** + * Whether this poll is undisclosed. + */ + val isUndisclosed: Boolean, + /** + * Number of answers in the poll. + */ + val numberOfAnswers: Int, +) : VectorAnalyticsEvent { + + enum class Action { + /** + * Newly created poll + */ + Create, + + /** + * Edit of an existing poll + */ + Edit, + } + + override fun getName() = "PollCreation" + + override fun getProperties(): Map? { + return mutableMapOf().apply { + put("action", action.name) + put("isUndisclosed", isUndisclosed) + put("numberOfAnswers", numberOfAnswers) + }.takeIf { it.isNotEmpty() } + } +} diff --git a/vector/src/main/java/im/vector/app/features/analytics/plan/PollEnd.kt b/vector/src/main/java/im/vector/app/features/analytics/plan/PollEnd.kt new file mode 100644 index 0000000000..f55e39522d --- /dev/null +++ b/vector/src/main/java/im/vector/app/features/analytics/plan/PollEnd.kt @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2021 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package im.vector.app.features.analytics.plan + +import im.vector.app.features.analytics.itf.VectorAnalyticsEvent + +// GENERATED FILE, DO NOT EDIT. FOR MORE INFORMATION VISIT +// https://github.com/matrix-org/matrix-analytics-events/ + +/** + * Triggered when a poll has been ended. + */ +data class PollEnd( + /** + * Do not use this. Remove this property when the kotlin type generator + * can properly generate types without proprties other than the event + * name. + */ + val doNotUse: Boolean? = null, +) : VectorAnalyticsEvent { + + override fun getName() = "PollEnd" + + override fun getProperties(): Map? { + return mutableMapOf().apply { + doNotUse?.let { put("doNotUse", it) } + }.takeIf { it.isNotEmpty() } + } +} diff --git a/vector/src/main/java/im/vector/app/features/analytics/plan/PollVote.kt b/vector/src/main/java/im/vector/app/features/analytics/plan/PollVote.kt new file mode 100644 index 0000000000..722f52bdec --- /dev/null +++ b/vector/src/main/java/im/vector/app/features/analytics/plan/PollVote.kt @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2021 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package im.vector.app.features.analytics.plan + +import im.vector.app.features.analytics.itf.VectorAnalyticsEvent + +// GENERATED FILE, DO NOT EDIT. FOR MORE INFORMATION VISIT +// https://github.com/matrix-org/matrix-analytics-events/ + +/** + * Triggered when a poll vote has been cast. + */ +data class PollVote( + /** + * Do not use this. Remove this property when the kotlin type generator + * can properly generate types without proprties other than the event + * name. + */ + val doNotUse: Boolean? = null, +) : VectorAnalyticsEvent { + + override fun getName() = "PollVote" + + override fun getProperties(): Map? { + return mutableMapOf().apply { + doNotUse?.let { put("doNotUse", it) } + }.takeIf { it.isNotEmpty() } + } +}