mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-16 02:05:06 +08:00
lifting analytics extension to the common package
This commit is contained in:
parent
f44ccd739e
commit
b91b9cb973
@ -0,0 +1,29 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2022 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.extensions
|
||||||
|
|
||||||
|
import im.vector.app.features.analytics.plan.Identity
|
||||||
|
import im.vector.app.features.onboarding.FtueUseCase
|
||||||
|
|
||||||
|
fun FtueUseCase.toTrackingValue(): Identity.FtueUseCaseSelection {
|
||||||
|
return when (this) {
|
||||||
|
FtueUseCase.FRIENDS_FAMILY -> Identity.FtueUseCaseSelection.PersonalMessaging
|
||||||
|
FtueUseCase.TEAMS -> Identity.FtueUseCaseSelection.WorkMessaging
|
||||||
|
FtueUseCase.COMMUNITIES -> Identity.FtueUseCaseSelection.CommunityMessaging
|
||||||
|
FtueUseCase.SKIP -> Identity.FtueUseCaseSelection.Skip
|
||||||
|
}
|
||||||
|
}
|
@ -16,8 +16,6 @@
|
|||||||
|
|
||||||
package im.vector.app.features.onboarding
|
package im.vector.app.features.onboarding
|
||||||
|
|
||||||
import im.vector.app.features.analytics.plan.Identity
|
|
||||||
|
|
||||||
enum class FtueUseCase(val persistableValue: String) {
|
enum class FtueUseCase(val persistableValue: String) {
|
||||||
FRIENDS_FAMILY("friends_family"),
|
FRIENDS_FAMILY("friends_family"),
|
||||||
TEAMS("teams"),
|
TEAMS("teams"),
|
||||||
@ -28,12 +26,3 @@ enum class FtueUseCase(val persistableValue: String) {
|
|||||||
fun from(persistedValue: String) = values().first { it.persistableValue == persistedValue }
|
fun from(persistedValue: String) = values().first { it.persistableValue == persistedValue }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun FtueUseCase.toTrackingValue(): Identity.FtueUseCaseSelection {
|
|
||||||
return when (this) {
|
|
||||||
FtueUseCase.FRIENDS_FAMILY -> Identity.FtueUseCaseSelection.PersonalMessaging
|
|
||||||
FtueUseCase.TEAMS -> Identity.FtueUseCaseSelection.WorkMessaging
|
|
||||||
FtueUseCase.COMMUNITIES -> Identity.FtueUseCaseSelection.CommunityMessaging
|
|
||||||
FtueUseCase.SKIP -> Identity.FtueUseCaseSelection.Skip
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -37,6 +37,7 @@ import im.vector.app.core.resources.StringProvider
|
|||||||
import im.vector.app.core.utils.ensureTrailingSlash
|
import im.vector.app.core.utils.ensureTrailingSlash
|
||||||
import im.vector.app.features.VectorFeatures
|
import im.vector.app.features.VectorFeatures
|
||||||
import im.vector.app.features.analytics.AnalyticsTracker
|
import im.vector.app.features.analytics.AnalyticsTracker
|
||||||
|
import im.vector.app.features.analytics.extensions.toTrackingValue
|
||||||
import im.vector.app.features.analytics.plan.Identity
|
import im.vector.app.features.analytics.plan.Identity
|
||||||
import im.vector.app.features.login.HomeServerConnectionConfigFactory
|
import im.vector.app.features.login.HomeServerConnectionConfigFactory
|
||||||
import im.vector.app.features.login.LoginConfig
|
import im.vector.app.features.login.LoginConfig
|
||||||
|
Loading…
Reference in New Issue
Block a user