mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-29 14:38:45 +03:00
metrics for IA project (#5399)
This commit is contained in:
parent
0664afdf9a
commit
e2481fa8e6
24 changed files with 146 additions and 7 deletions
|
@ -26,11 +26,14 @@ import im.vector.app.core.di.MavericksAssistedViewModelFactory
|
|||
import im.vector.app.core.di.hiltMavericksViewModelFactory
|
||||
import im.vector.app.core.mvrx.runCatchingToAsync
|
||||
import im.vector.app.core.platform.VectorViewModel
|
||||
import im.vector.app.features.analytics.AnalyticsTracker
|
||||
import im.vector.app.features.analytics.plan.CreatedRoom
|
||||
import im.vector.app.features.raw.wellknown.getElementWellknown
|
||||
import im.vector.app.features.raw.wellknown.isE2EByDefault
|
||||
import im.vector.app.features.userdirectory.PendingSelection
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import org.matrix.android.sdk.api.extensions.orFalse
|
||||
import org.matrix.android.sdk.api.raw.RawService
|
||||
import org.matrix.android.sdk.api.session.Session
|
||||
import org.matrix.android.sdk.api.session.permalinks.PermalinkData
|
||||
|
@ -41,7 +44,8 @@ import org.matrix.android.sdk.api.session.user.model.User
|
|||
class CreateDirectRoomViewModel @AssistedInject constructor(
|
||||
@Assisted initialState: CreateDirectRoomViewState,
|
||||
private val rawService: RawService,
|
||||
val session: Session
|
||||
val session: Session,
|
||||
val analyticsTracker: AnalyticsTracker
|
||||
) :
|
||||
VectorViewModel<CreateDirectRoomViewState, CreateDirectRoomAction, CreateDirectRoomViewEvents>(initialState) {
|
||||
|
||||
|
@ -117,6 +121,7 @@ class CreateDirectRoomViewModel @AssistedInject constructor(
|
|||
val result = runCatchingToAsync {
|
||||
session.createRoom(roomParams)
|
||||
}
|
||||
analyticsTracker.capture(CreatedRoom(isDM = roomParams.isDirect.orFalse()))
|
||||
|
||||
setState {
|
||||
copy(
|
||||
|
|
|
@ -16,8 +16,11 @@
|
|||
|
||||
package im.vector.app.features.createdirect
|
||||
|
||||
import im.vector.app.features.analytics.AnalyticsTracker
|
||||
import im.vector.app.features.analytics.plan.CreatedRoom
|
||||
import im.vector.app.features.raw.wellknown.getElementWellknown
|
||||
import im.vector.app.features.raw.wellknown.isE2EByDefault
|
||||
import org.matrix.android.sdk.api.extensions.orFalse
|
||||
import org.matrix.android.sdk.api.extensions.tryOrNull
|
||||
import org.matrix.android.sdk.api.raw.RawService
|
||||
import org.matrix.android.sdk.api.session.Session
|
||||
|
@ -26,7 +29,8 @@ import javax.inject.Inject
|
|||
|
||||
class DirectRoomHelper @Inject constructor(
|
||||
private val rawService: RawService,
|
||||
private val session: Session
|
||||
private val session: Session,
|
||||
private val analyticsTracker: AnalyticsTracker
|
||||
) {
|
||||
|
||||
suspend fun ensureDMExists(userId: String): String {
|
||||
|
@ -45,6 +49,7 @@ class DirectRoomHelper @Inject constructor(
|
|||
enableEncryptionIfInvitedUsersSupportIt = adminE2EByDefault
|
||||
}
|
||||
roomId = session.createRoom(roomParams)
|
||||
analyticsTracker.capture(CreatedRoom(isDM = roomParams.isDirect.orFalse()))
|
||||
}
|
||||
return roomId
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@ import im.vector.app.core.platform.VectorBaseFragment
|
|||
import im.vector.app.core.utils.styleMatchingText
|
||||
import im.vector.app.core.utils.tappableMatchingText
|
||||
import im.vector.app.databinding.FragmentRoomPreviewNoPreviewBinding
|
||||
import im.vector.app.features.analytics.plan.MobileScreen
|
||||
import im.vector.app.features.home.AvatarRenderer
|
||||
import im.vector.app.features.navigation.Navigator
|
||||
import im.vector.app.features.roomdirectory.JoinState
|
||||
|
@ -69,6 +70,11 @@ class RoomPreviewNoPreviewFragment @Inject constructor(
|
|||
views.roomPreviewNoPreviewJoin.commonClicked = { roomPreviewViewModel.handle(RoomPreviewAction.Join) }
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
analyticsScreenName = MobileScreen.ScreenName.RoomPreview
|
||||
}
|
||||
|
||||
override fun invalidate() = withState(roomPreviewViewModel) { state ->
|
||||
|
||||
views.roomPreviewNoPreviewJoin.render(
|
||||
|
|
|
@ -251,7 +251,7 @@ class RoomPreviewViewModel @AssistedInject constructor(
|
|||
// Always false in this case (?)
|
||||
isDM = false,
|
||||
isSpace = false,
|
||||
roomSize = state.numJoinMembers.toAnalyticsRoomSize()
|
||||
roomSize = state.numJoinMembers.toAnalyticsRoomSize(),
|
||||
))
|
||||
// We do not update the joiningRoomsIds here, because, the room is not joined yet regarding the sync data.
|
||||
// Instead, we wait for the room to be joined
|
||||
|
|
|
@ -43,6 +43,7 @@ import im.vector.app.core.utils.copyToClipboard
|
|||
import im.vector.app.core.utils.startSharePlainTextIntent
|
||||
import im.vector.app.databinding.FragmentMatrixProfileBinding
|
||||
import im.vector.app.databinding.ViewStubRoomProfileHeaderBinding
|
||||
import im.vector.app.features.analytics.plan.Interaction
|
||||
import im.vector.app.features.analytics.plan.MobileScreen
|
||||
import im.vector.app.features.home.AvatarRenderer
|
||||
import im.vector.app.features.home.room.detail.RoomDetailPendingAction
|
||||
|
@ -90,7 +91,7 @@ class RoomProfileFragment @Inject constructor(
|
|||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
analyticsScreenName = MobileScreen.ScreenName.RoomSettings
|
||||
analyticsScreenName = MobileScreen.ScreenName.RoomDetails
|
||||
setFragmentResultListener(MigrateRoomBottomSheet.REQUEST_KEY) { _, bundle ->
|
||||
bundle.getString(MigrateRoomBottomSheet.BUNDLE_KEY_REPLACEMENT_ROOM)?.let { replacementRoomId ->
|
||||
roomDetailPendingActionStore.data = RoomDetailPendingAction.OpenRoom(replacementRoomId, closeCurrentRoom = true)
|
||||
|
@ -270,6 +271,11 @@ class RoomProfileFragment @Inject constructor(
|
|||
override fun createShortcut() {
|
||||
// Ask the view model to prepare it...
|
||||
roomProfileViewModel.handle(RoomProfileAction.CreateShortcut)
|
||||
analyticsTracker.capture(Interaction(
|
||||
index = null,
|
||||
interactionType = null,
|
||||
name = Interaction.Name.MobileRoomAddHome
|
||||
))
|
||||
}
|
||||
|
||||
private fun addShortcut(onShortcutReady: RoomProfileViewEvents.OnShortcutReady) {
|
||||
|
|
|
@ -26,6 +26,8 @@ import im.vector.app.core.di.MavericksAssistedViewModelFactory
|
|||
import im.vector.app.core.di.hiltMavericksViewModelFactory
|
||||
import im.vector.app.core.platform.VectorViewModel
|
||||
import im.vector.app.core.resources.StringProvider
|
||||
import im.vector.app.features.analytics.AnalyticsTracker
|
||||
import im.vector.app.features.analytics.plan.Interaction
|
||||
import im.vector.app.features.home.ShortcutCreator
|
||||
import im.vector.app.features.powerlevel.PowerLevelsFlowFactory
|
||||
import im.vector.app.features.session.coroutineScope
|
||||
|
@ -52,7 +54,8 @@ class RoomProfileViewModel @AssistedInject constructor(
|
|||
@Assisted private val initialState: RoomProfileViewState,
|
||||
private val stringProvider: StringProvider,
|
||||
private val shortcutCreator: ShortcutCreator,
|
||||
private val session: Session
|
||||
private val session: Session,
|
||||
private val analyticsTracker: AnalyticsTracker
|
||||
) : VectorViewModel<RoomProfileViewState, RoomProfileAction, RoomProfileViewEvents>(initialState) {
|
||||
|
||||
@AssistedFactory
|
||||
|
@ -186,6 +189,11 @@ class RoomProfileViewModel @AssistedInject constructor(
|
|||
viewModelScope.launch {
|
||||
try {
|
||||
session.leaveRoom(room.roomId)
|
||||
analyticsTracker.capture(Interaction(
|
||||
index = null,
|
||||
interactionType = null,
|
||||
name = Interaction.Name.MobileRoomLeave
|
||||
))
|
||||
// Do nothing, we will be closing the room automatically when it will get back from sync
|
||||
} catch (failure: Throwable) {
|
||||
_viewEvents.post(RoomProfileViewEvents.Failure(failure))
|
||||
|
|
|
@ -33,6 +33,7 @@ import im.vector.app.core.platform.VectorBaseFragment
|
|||
import im.vector.app.core.utils.shareText
|
||||
import im.vector.app.core.utils.toast
|
||||
import im.vector.app.databinding.FragmentRoomSettingGenericBinding
|
||||
import im.vector.app.features.analytics.plan.MobileScreen
|
||||
import im.vector.app.features.home.AvatarRenderer
|
||||
import im.vector.app.features.roomprofile.RoomProfileArgs
|
||||
import im.vector.app.features.roomprofile.alias.detail.RoomAliasBottomSheet
|
||||
|
@ -61,6 +62,11 @@ class RoomAliasFragment @Inject constructor(
|
|||
return FragmentRoomSettingGenericBinding.inflate(inflater, container, false)
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
analyticsScreenName = MobileScreen.ScreenName.RoomAddresses
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
sharedActionViewModel = activityViewModelProvider.get(RoomAliasBottomSheetSharedActionViewModel::class.java)
|
||||
|
|
|
@ -32,6 +32,7 @@ import im.vector.app.core.extensions.cleanup
|
|||
import im.vector.app.core.extensions.configureWith
|
||||
import im.vector.app.core.platform.VectorBaseFragment
|
||||
import im.vector.app.databinding.FragmentRoomMemberListBinding
|
||||
import im.vector.app.features.analytics.plan.MobileScreen
|
||||
import im.vector.app.features.home.AvatarRenderer
|
||||
import im.vector.app.features.roomprofile.RoomProfileArgs
|
||||
import org.matrix.android.sdk.api.session.events.model.Event
|
||||
|
@ -54,6 +55,11 @@ class RoomMemberListFragment @Inject constructor(
|
|||
return FragmentRoomMemberListBinding.inflate(inflater, container, false)
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
analyticsScreenName = MobileScreen.ScreenName.RoomMembers
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
roomMemberListController.callback = this
|
||||
|
|
|
@ -28,6 +28,7 @@ import im.vector.app.core.extensions.cleanup
|
|||
import im.vector.app.core.extensions.configureWith
|
||||
import im.vector.app.core.platform.VectorBaseFragment
|
||||
import im.vector.app.databinding.FragmentRoomSettingGenericBinding
|
||||
import im.vector.app.features.analytics.plan.MobileScreen
|
||||
import im.vector.app.features.home.AvatarRenderer
|
||||
import im.vector.app.features.settings.VectorSettingsActivity
|
||||
import org.matrix.android.sdk.api.session.room.notification.RoomNotificationState
|
||||
|
@ -47,6 +48,11 @@ class RoomNotificationSettingsFragment @Inject constructor(
|
|||
return FragmentRoomSettingGenericBinding.inflate(inflater, container, false)
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
analyticsScreenName = MobileScreen.ScreenName.RoomNotifications
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
setupToolbar(views.roomSettingsToolbar)
|
||||
|
|
|
@ -30,6 +30,7 @@ import im.vector.app.core.extensions.configureWith
|
|||
import im.vector.app.core.platform.VectorBaseFragment
|
||||
import im.vector.app.core.utils.toast
|
||||
import im.vector.app.databinding.FragmentRoomSettingGenericBinding
|
||||
import im.vector.app.features.analytics.plan.MobileScreen
|
||||
import im.vector.app.features.home.AvatarRenderer
|
||||
import im.vector.app.features.roommemberprofile.powerlevel.EditPowerLevelDialogs
|
||||
import im.vector.app.features.roomprofile.RoomProfileArgs
|
||||
|
@ -52,6 +53,11 @@ class RoomPermissionsFragment @Inject constructor(
|
|||
return FragmentRoomSettingGenericBinding.inflate(inflater, container, false)
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
analyticsScreenName = MobileScreen.ScreenName.RoomPermissions
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@ import im.vector.app.core.platform.VectorBaseFragment
|
|||
import im.vector.app.core.resources.ColorProvider
|
||||
import im.vector.app.core.utils.toast
|
||||
import im.vector.app.databinding.FragmentRoomSettingGenericBinding
|
||||
import im.vector.app.features.analytics.plan.MobileScreen
|
||||
import im.vector.app.features.home.AvatarRenderer
|
||||
import im.vector.app.features.roomprofile.RoomProfileArgs
|
||||
import im.vector.app.features.roomprofile.RoomProfileSharedActionViewModel
|
||||
|
@ -77,6 +78,11 @@ class RoomSettingsFragment @Inject constructor(
|
|||
|
||||
override fun getMenuRes() = R.menu.vector_room_settings
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
analyticsScreenName = MobileScreen.ScreenName.RoomSettings
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
roomProfileSharedActionViewModel = activityViewModelProvider.get(RoomProfileSharedActionViewModel::class.java)
|
||||
|
|
|
@ -16,12 +16,14 @@
|
|||
|
||||
package im.vector.app.features.settings
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.preference.Preference
|
||||
import androidx.preference.SeekBarPreference
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.platform.VectorBaseActivity
|
||||
import im.vector.app.core.preference.VectorPreferenceCategory
|
||||
import im.vector.app.core.preference.VectorSwitchPreference
|
||||
import im.vector.app.features.analytics.plan.MobileScreen
|
||||
import im.vector.app.features.rageshake.RageShake
|
||||
|
||||
class VectorSettingsAdvancedSettingsFragment : VectorSettingsBaseFragment() {
|
||||
|
@ -31,6 +33,11 @@ class VectorSettingsAdvancedSettingsFragment : VectorSettingsBaseFragment() {
|
|||
|
||||
private var rageshake: RageShake? = null
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
analyticsScreenName = MobileScreen.ScreenName.SettingsAdvanced
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
|
||||
|
|
|
@ -51,6 +51,7 @@ import im.vector.app.core.utils.toast
|
|||
import im.vector.app.databinding.DialogChangePasswordBinding
|
||||
import im.vector.app.features.MainActivity
|
||||
import im.vector.app.features.MainActivityArgs
|
||||
import im.vector.app.features.analytics.plan.MobileScreen
|
||||
import im.vector.app.features.discovery.DiscoverySettingsFragment
|
||||
import im.vector.app.features.navigation.SettingsActivityPayload
|
||||
import im.vector.app.features.workers.signout.SignOutUiWorker
|
||||
|
@ -117,6 +118,11 @@ class VectorSettingsGeneralFragment @Inject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
analyticsScreenName = MobileScreen.ScreenName.SettingsGeneral
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package im.vector.app.features.settings
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.preference.Preference
|
||||
import im.vector.app.BuildConfig
|
||||
import im.vector.app.R
|
||||
|
@ -24,6 +25,7 @@ import im.vector.app.core.utils.FirstThrottler
|
|||
import im.vector.app.core.utils.copyToClipboard
|
||||
import im.vector.app.core.utils.openAppSettingsPage
|
||||
import im.vector.app.core.utils.openUrlInChromeCustomTab
|
||||
import im.vector.app.features.analytics.plan.MobileScreen
|
||||
import im.vector.app.features.version.VersionProvider
|
||||
import org.matrix.android.sdk.api.Matrix
|
||||
import javax.inject.Inject
|
||||
|
@ -37,6 +39,11 @@ class VectorSettingsHelpAboutFragment @Inject constructor(
|
|||
|
||||
private val firstThrottler = FirstThrottler(1000)
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
analyticsScreenName = MobileScreen.ScreenName.SettingsHelp
|
||||
}
|
||||
|
||||
override fun bindPref() {
|
||||
// Help
|
||||
findPreference<VectorPreference>(VectorPreferences.SETTINGS_HELP_PREFERENCE_KEY)!!
|
||||
|
|
|
@ -16,11 +16,13 @@
|
|||
|
||||
package im.vector.app.features.settings
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.preference.Preference
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.preference.VectorSwitchPreference
|
||||
import im.vector.app.features.MainActivity
|
||||
import im.vector.app.features.MainActivityArgs
|
||||
import im.vector.app.features.analytics.plan.MobileScreen
|
||||
import org.matrix.android.sdk.internal.database.lightweight.LightweightSettingsStorage
|
||||
import javax.inject.Inject
|
||||
|
||||
|
@ -33,6 +35,11 @@ class VectorSettingsLabsFragment @Inject constructor(
|
|||
override var titleRes = R.string.room_settings_labs_pref_title
|
||||
override val preferenceXmlRes = R.xml.vector_settings_labs
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
analyticsScreenName = MobileScreen.ScreenName.SettingsLabs
|
||||
}
|
||||
|
||||
override fun bindPref() {
|
||||
findPreference<VectorSwitchPreference>(VectorPreferences.SETTINGS_LABS_AUTO_REPORT_UISI)?.let { pref ->
|
||||
// ensure correct default
|
||||
|
|
|
@ -18,6 +18,7 @@ package im.vector.app.features.settings
|
|||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
||||
import android.widget.CheckedTextView
|
||||
import androidx.core.view.children
|
||||
import androidx.preference.Preference
|
||||
|
@ -32,6 +33,7 @@ import im.vector.app.core.preference.VectorSwitchPreference
|
|||
import im.vector.app.databinding.DialogSelectTextSizeBinding
|
||||
import im.vector.app.features.MainActivity
|
||||
import im.vector.app.features.MainActivityArgs
|
||||
import im.vector.app.features.analytics.plan.MobileScreen
|
||||
import im.vector.app.features.configuration.VectorConfiguration
|
||||
import im.vector.app.features.themes.ThemeUtils
|
||||
import javax.inject.Inject
|
||||
|
@ -54,6 +56,11 @@ class VectorSettingsPreferencesFragment @Inject constructor(
|
|||
findPreference<VectorPreference>("SETTINGS_INTERFACE_TAKE_PHOTO_VIDEO")!!
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
analyticsScreenName = MobileScreen.ScreenName.SettingsPreferences
|
||||
}
|
||||
|
||||
override fun bindPref() {
|
||||
// user interface preferences
|
||||
setUserInterfacePreferences()
|
||||
|
|
|
@ -20,6 +20,7 @@ import android.app.Activity
|
|||
import android.content.Intent
|
||||
import android.media.RingtoneManager
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import androidx.preference.Preference
|
||||
import androidx.preference.SwitchPreference
|
||||
import im.vector.app.R
|
||||
|
@ -29,6 +30,7 @@ import im.vector.app.core.utils.getCallRingtoneName
|
|||
import im.vector.app.core.utils.getCallRingtoneUri
|
||||
import im.vector.app.core.utils.setCallRingtoneUri
|
||||
import im.vector.app.core.utils.setUseRiotDefaultRingtone
|
||||
import im.vector.app.features.analytics.plan.MobileScreen
|
||||
|
||||
class VectorSettingsVoiceVideoFragment : VectorSettingsBaseFragment() {
|
||||
|
||||
|
@ -42,6 +44,11 @@ class VectorSettingsVoiceVideoFragment : VectorSettingsBaseFragment() {
|
|||
findPreference<VectorPreference>(VectorPreferences.SETTINGS_CALL_RINGTONE_URI_PREFERENCE_KEY)!!
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
analyticsScreenName = MobileScreen.ScreenName.SettingsVoiceVideo
|
||||
}
|
||||
|
||||
override fun bindPref() {
|
||||
// Incoming call sounds
|
||||
mUseRiotCallRingtonePreference.onPreferenceClickListener = Preference.OnPreferenceClickListener {
|
||||
|
|
|
@ -32,6 +32,7 @@ import im.vector.app.core.extensions.cleanup
|
|||
import im.vector.app.core.extensions.configureWith
|
||||
import im.vector.app.core.platform.VectorBaseFragment
|
||||
import im.vector.app.databinding.FragmentGenericRecyclerBinding
|
||||
import im.vector.app.features.analytics.plan.MobileScreen
|
||||
import javax.inject.Inject
|
||||
|
||||
class VectorSettingsIgnoredUsersFragment @Inject constructor(
|
||||
|
@ -45,6 +46,11 @@ class VectorSettingsIgnoredUsersFragment @Inject constructor(
|
|||
|
||||
private val viewModel: IgnoredUsersViewModel by fragmentViewModel()
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
analyticsScreenName = MobileScreen.ScreenName.SettingsIgnoredUsers
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@ import im.vector.app.core.utils.FirstThrottler
|
|||
import im.vector.app.core.utils.displayInWebView
|
||||
import im.vector.app.core.utils.openUrlInChromeCustomTab
|
||||
import im.vector.app.databinding.FragmentGenericRecyclerBinding
|
||||
import im.vector.app.features.analytics.plan.MobileScreen
|
||||
import im.vector.app.features.discovery.ServerPolicy
|
||||
import im.vector.app.features.settings.VectorSettingsUrls
|
||||
import im.vector.app.openOssLicensesMenuActivity
|
||||
|
@ -47,6 +48,11 @@ class LegalsFragment @Inject constructor(
|
|||
private val viewModel by fragmentViewModel(LegalsViewModel::class)
|
||||
private val firstThrottler = FirstThrottler(1000)
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
analyticsScreenName = MobileScreen.ScreenName.SettingsLegals
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ import android.content.Context
|
|||
import android.content.Intent
|
||||
import android.media.RingtoneManager
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.os.Parcelable
|
||||
import android.widget.Toast
|
||||
import androidx.lifecycle.LiveData
|
||||
|
@ -40,6 +41,7 @@ import im.vector.app.core.pushers.PushersManager
|
|||
import im.vector.app.core.services.GuardServiceStarter
|
||||
import im.vector.app.core.utils.isIgnoringBatteryOptimizations
|
||||
import im.vector.app.core.utils.requestDisablingBatteryOptimization
|
||||
import im.vector.app.features.analytics.plan.MobileScreen
|
||||
import im.vector.app.features.notifications.NotificationUtils
|
||||
import im.vector.app.features.settings.BackgroundSyncMode
|
||||
import im.vector.app.features.settings.BackgroundSyncModeChooserDialog
|
||||
|
@ -72,6 +74,11 @@ class VectorSettingsNotificationPreferenceFragment @Inject constructor(
|
|||
|
||||
private var interactionListener: VectorSettingsFragmentInteractionListener? = null
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
analyticsScreenName = MobileScreen.ScreenName.SettingsNotifications
|
||||
}
|
||||
|
||||
override fun bindPref() {
|
||||
findPreference<VectorSwitchPreference>(VectorPreferences.SETTINGS_ENABLE_ALL_NOTIF_PREFERENCE_KEY)!!.let { pref ->
|
||||
val pushRuleService = session
|
||||
|
|
|
@ -28,6 +28,8 @@ import im.vector.app.RoomGroupingMethod
|
|||
import im.vector.app.core.di.MavericksAssistedViewModelFactory
|
||||
import im.vector.app.core.di.hiltMavericksViewModelFactory
|
||||
import im.vector.app.core.platform.VectorViewModel
|
||||
import im.vector.app.features.analytics.AnalyticsTracker
|
||||
import im.vector.app.features.analytics.plan.Interaction
|
||||
import im.vector.app.features.invite.AutoAcceptInvites
|
||||
import im.vector.app.features.session.coroutineScope
|
||||
import im.vector.app.features.settings.VectorPreferences
|
||||
|
@ -64,7 +66,8 @@ class SpaceListViewModel @AssistedInject constructor(@Assisted initialState: Spa
|
|||
private val appStateHandler: AppStateHandler,
|
||||
private val session: Session,
|
||||
private val vectorPreferences: VectorPreferences,
|
||||
private val autoAcceptInvites: AutoAcceptInvites
|
||||
private val autoAcceptInvites: AutoAcceptInvites,
|
||||
private val analyticsTracker: AnalyticsTracker
|
||||
) : VectorViewModel<SpaceListViewState, SpaceListAction, SpaceListViewEvents>(initialState) {
|
||||
|
||||
@AssistedFactory
|
||||
|
@ -225,9 +228,12 @@ class SpaceListViewModel @AssistedInject constructor(@Assisted initialState: Spa
|
|||
private fun handleSelectSpace(action: SpaceListAction.SelectSpace) = withState { state ->
|
||||
val groupingMethod = state.selectedGroupingMethod
|
||||
if (groupingMethod is RoomGroupingMethod.ByLegacyGroup || groupingMethod.space()?.roomId != action.spaceSummary?.roomId) {
|
||||
analyticsTracker.capture(Interaction(null, null, Interaction.Name.SpacePanelSwitchSpace))
|
||||
setState { copy(selectedGroupingMethod = RoomGroupingMethod.BySpace(action.spaceSummary)) }
|
||||
appStateHandler.setCurrentSpace(action.spaceSummary?.roomId)
|
||||
_viewEvents.post(SpaceListViewEvents.OpenSpace(groupingMethod is RoomGroupingMethod.ByLegacyGroup))
|
||||
} else {
|
||||
analyticsTracker.capture(Interaction(null, null, Interaction.Name.SpacePanelSelectedSpace))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@ import dagger.hilt.android.AndroidEntryPoint
|
|||
import im.vector.app.core.extensions.setTextOrHide
|
||||
import im.vector.app.core.platform.VectorBaseBottomSheetDialogFragment
|
||||
import im.vector.app.databinding.BottomSheetSpaceSettingsBinding
|
||||
import im.vector.app.features.analytics.plan.MobileScreen
|
||||
import im.vector.app.features.home.AvatarRenderer
|
||||
import im.vector.app.features.navigation.Navigator
|
||||
import im.vector.app.features.rageshake.BugReporter
|
||||
|
@ -71,6 +72,11 @@ class SpaceSettingsMenuBottomSheet : VectorBaseBottomSheetDialogFragment<BottomS
|
|||
return BottomSheetSpaceSettingsBinding.inflate(inflater, container, false)
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
analyticsScreenName = MobileScreen.ScreenName.SpaceMenu
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
|
|
|
@ -42,6 +42,7 @@ import im.vector.app.core.utils.colorizeMatchingText
|
|||
import im.vector.app.core.utils.isValidUrl
|
||||
import im.vector.app.core.utils.openUrlInExternalBrowser
|
||||
import im.vector.app.databinding.FragmentSpaceDirectoryBinding
|
||||
import im.vector.app.features.analytics.plan.MobileScreen
|
||||
import im.vector.app.features.home.room.detail.timeline.TimelineEventController
|
||||
import im.vector.app.features.matrixto.SpaceCardRenderer
|
||||
import im.vector.app.features.permalink.PermalinkHandler
|
||||
|
@ -79,6 +80,7 @@ class SpaceDirectoryFragment @Inject constructor(
|
|||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
analyticsScreenName = MobileScreen.ScreenName.SpaceExploreRooms
|
||||
childFragmentManager.setFragmentResultListener(SpaceAddRoomSpaceChooserBottomSheet.REQUEST_KEY, this) { _, bundle ->
|
||||
|
||||
bundle.getString(SpaceAddRoomSpaceChooserBottomSheet.BUNDLE_KEY_ACTION)?.let { action ->
|
||||
|
|
|
@ -26,10 +26,13 @@ import dagger.assisted.AssistedInject
|
|||
import im.vector.app.core.di.MavericksAssistedViewModelFactory
|
||||
import im.vector.app.core.di.hiltMavericksViewModelFactory
|
||||
import im.vector.app.core.platform.VectorViewModel
|
||||
import im.vector.app.features.analytics.AnalyticsTracker
|
||||
import im.vector.app.features.analytics.plan.CreatedRoom
|
||||
import im.vector.app.features.raw.wellknown.getElementWellknown
|
||||
import im.vector.app.features.raw.wellknown.isE2EByDefault
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import org.matrix.android.sdk.api.extensions.orFalse
|
||||
import org.matrix.android.sdk.api.raw.RawService
|
||||
import org.matrix.android.sdk.api.session.Session
|
||||
import org.matrix.android.sdk.api.session.room.model.create.CreateRoomParams
|
||||
|
@ -37,7 +40,8 @@ import org.matrix.android.sdk.api.session.room.model.create.CreateRoomParams
|
|||
class SpacePeopleViewModel @AssistedInject constructor(
|
||||
@Assisted val initialState: SpacePeopleViewState,
|
||||
private val rawService: RawService,
|
||||
private val session: Session
|
||||
private val session: Session,
|
||||
private val analyticsTracker: AnalyticsTracker
|
||||
) : VectorViewModel<SpacePeopleViewState, SpacePeopleViewAction, SpacePeopleViewEvents>(initialState) {
|
||||
|
||||
@AssistedFactory
|
||||
|
@ -83,6 +87,7 @@ class SpacePeopleViewModel @AssistedInject constructor(
|
|||
|
||||
try {
|
||||
val roomId = session.createRoom(roomParams)
|
||||
analyticsTracker.capture(CreatedRoom(isDM = roomParams.isDirect.orFalse()))
|
||||
_viewEvents.post(SpacePeopleViewEvents.OpenRoom(roomId))
|
||||
setState { copy(createAndInviteState = Success(roomId)) }
|
||||
} catch (failure: Throwable) {
|
||||
|
|
Loading…
Reference in a new issue